[Mlir-commits] [mlir] [mlir][vector] Canonicalize gathers/scatters with trivial offsets (PR #117939)

Andrzej WarzyƄski llvmlistbot at llvm.org
Tue Dec 31 08:21:10 PST 2024


================
@@ -5202,11 +5219,28 @@ class GatherFolder final : public OpRewritePattern<GatherOp> {
     llvm_unreachable("Unexpected 1DMaskFormat on GatherFolder");
   }
 };
+
+/// Fold gathers with consecutive offsets [0, 1, 2, ...] into contiguous
+/// maskedload. Only 1D non-scalable vectors are supported for now.
----------------
banach-space wrote:

Please add tests for scalable vectors and highlight where in the implementation the assumption about "non-scalability" is made.  Also, please add a negative test with 2D vectors.

[nit] We tend to say "fixed width vs scalable" rather than "non-scalable vs scalable" :_

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


More information about the Mlir-commits mailing list