[Mlir-commits] [mlir] [mlir][VectorToLLVM] add opt-in `enable-gep-inbounds-nuw` pass flag for `vector.load/store` (PR #202118)

Federico Bruzzone llvmlistbot at llvm.org
Thu Jun 18 06:38:53 PDT 2026


================
@@ -345,6 +345,18 @@ def AffineScalarReplacement : Pass<"affine-scalrep", "func::FuncOp"> {
 
 def AffineVectorize : Pass<"affine-super-vectorize", "func::FuncOp"> {
   let summary = "Vectorize to a target independent n-D vector abstraction";
+  let description = [{
+    Vectorizes affine loops into `vector.transfer_read` / `vector.transfer_write`
+    operations. When an access is provably within bounds (all loop bounds are
+    statically known and the access pattern fits the memref), the generated
+    transfer ops carry `in_bounds = [true, ...]`, asserting that no
+    out-of-bounds masking is needed.
+
+    When this pass is combined with `ConvertVectorToLLVM` and its
+    `enable-gep-inbounds-nuw` option is set, the lowering of those
+    `vector.load` / `vector.store` ops (produced by lowering the
+    in-bounds transfers) emits `llvm.getelementptr inbounds|nuw`.
+  }];
----------------
FedericoBruzzone wrote:

Thanks, and sorry for wasting your time :(

I'm planning to open a PR to document this. However, I feel the need to make users who want to use "affine + super-vec" aware of this. They can't experience worse performance than not using it.

I'll make sure not to limit the documentation to just the little things I've made here. 
Thanks again Andrzej :D

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


More information about the Mlir-commits mailing list