[Mlir-commits] [mlir] [mlir][vector] Fix VectorToSCF in-bounds check for negative indices (PR #224843)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Fri Sep 25 23:43:14 PDT 2026
================
@@ -923,3 +943,24 @@ func.func private @transfer_write_no_alloc_scope()
%cst = arith.constant dense<0.0> : vector<2x3xf32>
%m = memref.alloc() : memref<2x3xf32>
vector.transfer_write %cst, %m[%c0, %c0] : vector<2x3xf32>, memref<2x3xf32>
+
+// -----
+
+// Negative test: dynamic start index. Access is only valid when
+// 0 <= memrefIdx < memrefDim, so the guard must check both bounds
+// explicitly rather than relying on an unsigned reinterpretation trick.
----------------
StarOne01 wrote:
Two real reasons: it uses a static shape (`memref<4x8xf32>`), so the dim's a compile-time constant, different folding path than transfer_read_progressive's dynamic one. Also it's basically the issue's own second reproducer, same shapes and pad value, kept as a regression test tied to #223258.
CHECK-NOT lines are more documentation than unique coverage at this point though, sibling tests already catch a regression to `sgt`/`ugt`. Fine dropping it if you'd rather keep things lean, but the repro-match makes me want to keep it.
https://github.com/llvm/llvm-project/pull/224843
More information about the Mlir-commits
mailing list