[Mlir-commits] [mlir] [mlir][vector] Clarify the semantics of gather/scatter indexing (nfc) (PR #181357)

Andrzej Warzyński llvmlistbot at llvm.org
Mon Feb 16 12:05:01 PST 2026


================
@@ -2087,7 +2087,10 @@ def Vector_GatherOp :
     result[i,j] := if mask[i,j] then base[i0, i1, i2 + indices[i,j]]
                    else pass_thru[i,j]
     ```
-    The index into `base` only varies in the innermost ((k-1)-th) dimension.
+    The index into `base` only varies in the innermost ((k-1)-th) dimension and
+    is treated as a logical rather than a physical index, i.e. it does not
+    encode any potential non-identity strides in the underlying MemRef layout
----------------
banach-space wrote:

Thanks!

>     The access into `base` is contiguous within the innermost ((k-1)-th) dimension a

This wouldn't be accurate - the point of `vector.gather` is that we can load non-contiguous elements. Let me try rephrasing while incorporating your suggestion.

This might take us a few iterations 😅 

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


More information about the Mlir-commits mailing list