[Mlir-commits] [mlir] [mlir][vector] Take dim sizes into account in DropInnerMostUnitDims. (PR #71752)

Han-Chung Wang llvmlistbot at llvm.org
Thu Nov 9 16:10:03 PST 2023


================
@@ -60,3 +60,17 @@ func.func @contiguous_inner_most_dim_bounds_2d(%A: memref<1000x1x1xf32>, %i:inde
 //      CHECK:   %[[V:.+]] = vector.transfer_read %[[SRC_1]]
 // CHECK-SAME:       {in_bounds = [true]}
 // CHECK-SAME:       vector<4xf32>
+
+// -----
+
+func.func @contiguous_inner_most_dim_out_of_bounds_2d(%arg0: memref<1x1xf32>) -> vector<4x8xf32> {
+  %c0 = arith.constant 0 : index
+  %cst = arith.constant 0.000000e+00 : f32
+  %0 = vector.transfer_read %arg0[%c0, %c0], %cst : memref<1x1xf32>, vector<4x8xf32>
+  return %0 : vector<4x8xf32>
+}
+//      CHECK: func.func @contiguous_inner_most_dim_out_of_bounds_2d
+// CHECK-SAME:   %[[SRC:[a-zA-Z0-9]+]]
----------------
hanhanW wrote:

It would ask me to match `tensor<xxx>` in the lit test, so I prefer `[a-zA-Z0-9]+`. It is a trick that I learn from other MLIR lit tests.

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


More information about the Mlir-commits mailing list