[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:23:49 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]+]]
+// CHECK-NOT: memref.subview
+// CHECK: %[[READ:.+]] = vector.transfer_read %[[SRC]]
+// CHECK: return %[[READ]] : vector<4x8xf32>
----------------
hanhanW wrote:
added a comment
https://github.com/llvm/llvm-project/pull/71752
More information about the Mlir-commits
mailing list