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

Federico Bruzzone llvmlistbot at llvm.org
Fri Jun 19 02:33:25 PDT 2026


================
@@ -0,0 +1,25 @@
+// RUN: mlir-opt %s -split-input-file -verify-diagnostics
+
+// -----
+
+func.func @load_negative_stride(%base: memref<100x100xf32>) -> vector<8xf32> {
+  // expected-error @+5 {{'vector.load' op memref strides must be non-negative}}
+  %flip = memref.reinterpret_cast %base to
+      offset: [0], sizes: [100, 100], strides: [-100, 1]
+      : memref<100x100xf32> to memref<100x100xf32, strided<[-100, 1]>>
----------------
FedericoBruzzone wrote:

You're right!

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


More information about the Mlir-commits mailing list