[Mlir-commits] [mlir] [MLIR] Fix canonicalization pattern for 'shape.shape_of' (PR #134234)

Sayan Saha llvmlistbot at llvm.org
Thu Apr 3 17:13:01 PDT 2025


================
@@ -1389,10 +1389,25 @@ func.func @shape_of_from_reshape(%arg0: tensor<*xf32>, %arg1: tensor<?xindex>) -
 
 // -----
 
-// CHECK-LABEL: func @shape_of_from_reshape_compatible_types
+// Check statically shaped types, with element types i32 to index.
+// CHECK-LABEL: func @shape_of_from_reshape_compatible_types1
+// CHECK-SAME: %[[INPUT:.*]]: tensor<?x1xf32>
+// CHECK-SAME: %[[SHAPE:.*]]: tensor<3xi32>
+func.func @shape_of_from_reshape_compatible_types1(%arg0: tensor<?x1xf32>, %arg1: tensor<3xi32>) -> tensor<3xindex> {
----------------
sahas3 wrote:

nit: instead of `1,2,3` prefix renaming the functions as `shape_of_from_reshape_compatible_types_static_to_static`, `shape_of_from_reshape_compatible_types_static_to_dynamic` etc will be more meaningful to read the IR. Also is the `compatible_types` term adding any value -- if not, can remove it to shorten the function name.

https://github.com/llvm/llvm-project/pull/134234


More information about the Mlir-commits mailing list