[Mlir-commits] [mlir] [mlir][vector] Relax constraints on shape_cast (PR #136587)
James Newling
llvmlistbot at llvm.org
Mon Apr 28 09:01:52 PDT 2025
================
@@ -543,6 +543,20 @@ func.func @vector_print_on_scalar(%arg0: i64) {
return
}
+// CHECK-LABEL: @shape_cast_valid_rank_reduction
+func.func @shape_cast_valid_rank_reduction(%arg0 : vector<5x1x3x2xf32>) {
+ // CHECK: vector.shape_cast %{{.*}} : vector<5x1x3x2xf32> to vector<2x15xf32>
+ %0 = vector.shape_cast %arg0 : vector<5x1x3x2xf32> to vector<2x15xf32>
+ return
+}
----------------
newling wrote:
Yes, it's not a valid collapse or expand (dimensions of the 'before' and 'after' shapes do not factorize), and the previous verifier would reject this (I just copied it from invalid.mlir to ops.mlir directly with minimal change). I've removed these 2 tests and added a more 'canonical' example of a general reshape, with comments and better function name.
https://github.com/llvm/llvm-project/pull/136587
More information about the Mlir-commits
mailing list