[Mlir-commits] [mlir] [mlir][VectorToLLVM] emit `inbounds|nuw` GEP flags when lowering `vector.load/store` (PR #202118)

Andrzej Warzyński llvmlistbot at llvm.org
Wed Jun 10 08:53:51 PDT 2026


================
@@ -256,10 +256,19 @@ class VectorLoadStoreConversion : public ConvertOpToLLVMPattern<LoadOrStoreOp> {
                                          "could not resolve alignment");
 
     // Resolve address.
+    // Per vector.load/store spec, indices must be in-bounds (0 <= idx <
+    // dim_size). Emit inbounds|nuw so LLVM can apply no-wrap optimizations on
----------------
banach-space wrote:

>From https://mlir.llvm.org/docs/Dialects/Vector/#vectorload-vectorloadop:
> Representation-wise, the ‘vector.load’ operation permits out-of-bounds reads. 

That's more about out-of-bounds **reads** than out-of-bounds **indices**, but I also haven't found anything implying that indices must be in-bounds.

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


More information about the Mlir-commits mailing list