[Mlir-commits] [mlir] [mlir][vector] reject negative strides for `vector.load`/`vector.store` (PR #204611)

Federico Bruzzone llvmlistbot at llvm.org
Mon Jun 22 03:26:40 PDT 2026


================
@@ -6194,6 +6194,13 @@ LogicalResult vector::LoadOp::verify() {
   if (failed(verifyLoadStoreMemRefLayout(*this, resVecTy, memRefTy)))
     return failure();
 
+  // Negative strides are not supported on vector.load.
+  auto [strides, offset] = memRefTy.getStridesAndOffset();
+  for (int64_t stride : strides) {
+    if (ShapedType::isStatic(stride) && stride < 0)
+      return emitOpError("memref strides must be non-negative");
+  }
----------------
FedericoBruzzone wrote:

That's a good catch.
We absolutely have to do this, thank you!

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


More information about the Mlir-commits mailing list