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

Andrzej WarzyƄski llvmlistbot at llvm.org
Thu Apr 18 08:20:27 PDT 2024


================
@@ -170,12 +170,37 @@ AffineMap mlir::vector::getTransferMinorIdentityMap(ShapedType shapedType,
       shapedType.getContext());
 }
 
+static bool couldBeSameValueWithMasking(vector::TransferWriteOp defWrite,
+                                        vector::TransferReadOp read) {
+  if (!defWrite.getMask() && !read.getMask())
+    return true; // Success: No masks (values will be the same).
----------------
banach-space wrote:

```suggestion
  if (!defWrite.getMask() && !read.getMask()) {
     // Success: No masks (values will be the same).
    return true;
 }
```
I think that this would be more "canonical" in LLVM. This is a nit, feel free to ignore.

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


More information about the Mlir-commits mailing list