Skip to content

Commit a436c01

Browse files
committed
Post review follow-up
1 parent 3624e3a commit a436c01

File tree

2 files changed

+10
-19
lines changed

2 files changed

+10
-19
lines changed

mlir/lib/Dialect/Math/Transforms/ExpandPatterns.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ static LogicalResult convertFmaFOp(math::FmaOp op, PatternRewriter &rewriter) {
222222
// if (x > y) then incr = 1 else incr = 0
223223
// y = y + incr <= replace this op with the ceilf op.
224224
static LogicalResult convertCeilOp(math::CeilOp op, PatternRewriter &rewriter) {
225-
// Creating constants assumes the statis shaped type.
225+
// Creating constants assumes the static shaped type.
226226
auto shapedType = dyn_cast<ShapedType>(op.getType());
227227
if (shapedType && !shapedType.hasStaticShape())
228228
return failure();

mlir/test/Dialect/Math/expand-math.mlir

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -764,22 +764,13 @@ func.func @rsqrt_tns(%float: tensor<5x8xf32>) -> (tensor<5x8xf32>) {
764764

765765
// -----
766766

767-
// CHECK-LABEL func.func @non_static_shape_ceil_op
768-
// CHECK: %[[IDX:.*]] = index.constant 0
769-
// CHECK: %[[CST:.*]] = arith.constant dense<1.000000e+00> : tensor<2xf32>
770-
// CHECK: %[[CAST:.*]] = tensor.cast %[[CST]] : tensor<2xf32> to tensor<?xf32>
771-
// CHECK: %[[CEIL:.*]] = math.ceil %[[CAST]] : tensor<?xf32>
772-
// CHECK: %[[DIM:.*]] = tensor.dim %[[CEIL]], %[[IDX]] : tensor<?xf32>
773-
// CHECK: vector.print %[[DIM]] : index
774-
// CHECK: return
775-
776-
func.func @non_static_shape_ceil_op() {
777-
%idx0 = index.constant 0
778-
%cst_90 = arith.constant 1.000000e+00 : f32
779-
%from_elements_92 = tensor.from_elements %cst_90, %cst_90 : tensor<2xf32>
780-
%cast_93 = tensor.cast %from_elements_92 : tensor<2xf32> to tensor<?xf32>
781-
%112 = math.ceil %cast_93 : tensor<?xf32>
782-
%dim_233 = tensor.dim %112, %idx0 : tensor<?xf32>
783-
vector.print %dim_233 : index
784-
return
767+
// CHECK-LABEL: func.func @non_static_shape_ceil_op
768+
// CHECK-SAME: (%[[ARG:.*]]: tensor<?xf32>)
769+
// CHECK-SAME: -> tensor<?xf32>
770+
// CHECK: %[[CEIL:.*]] = math.ceil %[[ARG]] : tensor<?xf32>
771+
// CHECK: return %[[CEIL]] : tensor<?xf32>
772+
773+
func.func @non_static_shape_ceil_op(%arg: tensor<?xf32>) -> tensor<?xf32>{
774+
%a = math.ceil %arg : tensor<?xf32>
775+
return %a: tensor<?xf32>
785776
}

0 commit comments

Comments
 (0)