[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.
----------------
banach-space wrote:

To me, this method should only check whether `type` is a byte-aligned and that's it. It shouldn't really have any opinion whether handling sub-bytes is tricky as it doesn't _handle_ them. Indeed, it simply provides an information - "Is this type byte-aligned?"

Now, this comment is in fact very helpful, but I would **move it** to L1091 (`ExtractOpFromLoad` provides context that makes dealing with sub-bytes tricky and that deserves this comment).

I hope that this makes sense :)

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


More information about the Mlir-commits mailing list