[Mlir-commits] [mlir] [mlir][vector] Teach `TransferOptimization` to forward masked stores (PR #87794)

Andrzej WarzyƄski llvmlistbot at llvm.org
Tue May 14 02:50:14 PDT 2024


================
@@ -170,12 +170,43 @@ AffineMap mlir::vector::getTransferMinorIdentityMap(ShapedType shapedType,
       shapedType.getContext());
 }
 
+/// Returns true if the value written by `defWrite` could be the same as the
+/// value read by `read`. Note: True is 'could be' not 'definitely' (as this
+/// simply looks at the masks and the value written). For a definite answer use
+/// `checkSameValueRAW()` -- which calls this function.
----------------
banach-space wrote:

> True is 'could be' not 'definitely' (as this simply looks at the masks and the value written).

"could be" is neither "true" nor "false". I think that you are trying to document what `checkSameValueRAW` does instead of focusing on this hook. To me, this method sounds like "haveIdenticalMasksAndMatchingPadAndSplatValues"? And then, 
> Returns true if either:
>   * there are no masks
>   * both Ops are masked, masks are identical and ... "write" writes a splat and the value for splat matches the padding value for "read"

What if only one op is masked?

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


More information about the Mlir-commits mailing list