[Mlir-commits] [mlir] [mlir][vector] Sink vector.extract/splat into load/store ops (PR #134389)

Andrzej WarzyƄski llvmlistbot at llvm.org
Tue Apr 22 05:35:32 PDT 2025


================
@@ -1043,6 +1047,144 @@ class ExtractOpFromElementwise final
   }
 };
 
+static bool isSupportedMemSinkElementType(Type type) {
+  if (isa<IndexType>(type))
+    return true;
+
+  // Non-byte-aligned types are tricky, skip them.
+  return type.isIntOrFloat() && type.getIntOrFloatBitWidth() % 8 == 0;
+}
+
+/// Pattern to rewrite vector.extract(vector.load) -> vector/memref.load.
----------------
banach-space wrote:

To me the fact that this is limited to 1-D vectors is quite a constraint. Could you add a note so that it is clear? Thanks!

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


More information about the Mlir-commits mailing list