[Mlir-commits] [mlir] [mlir][vector] Account for vector.mask in transfer RAW/WAW checks (PR #228328)

Federico Bruzzone llvmlistbot at llvm.org
Sat Oct 3 00:44:46 PDT 2026


================
@@ -239,6 +239,10 @@ static bool isSplatWriteConsistentWithMaskedRead(vector::TransferWriteOp write,
 
 bool mlir::vector::checkSameValueRAW(vector::TransferWriteOp defWrite,
                                      vector::TransferReadOp read) {
+  // An enclosing vector.mask leaves some lanes unwritten or padded, so the
+  // read does not see the written vector as a whole.
+  if (defWrite.isMasked() || read.isMasked())
----------------
FedericoBruzzone wrote:

It makes perfect sense! Thank you for this detailed explanation. 

> Treating an all-true region mask as unmasked in the helpers would only matter when transferOpflowOpt runs before canonicalization, and I can add that if you think it is useful.

That said, I simply document this fact. Does it sounds good?

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


More information about the Mlir-commits mailing list