[Mlir-commits] [mlir] [MLIR][Vector] Implement XferOp To {Load|Store}Lowering as MaskableOpRewritePattern (PR #92892)

Han-Chung Wang llvmlistbot at llvm.org
Thu May 30 16:11:12 PDT 2024


================
@@ -639,14 +643,15 @@ struct TransferWriteToVectorStoreLowering
                    << write;
             });
 
-      rewriter.replaceOpWithNewOp<vector::MaskedStoreOp>(
-          write, write.getSource(), write.getIndices(), write.getMask(),
-          write.getVector());
+      rewriter.create<vector::MaskedStoreOp>(
+          write.getLoc(), write.getSource(), write.getIndices(),
+          write.getMask(), write.getVector());
+      return Value();
----------------
hanhanW wrote:

It is confusing when it returns `Value()`. I think it is better to return a `FailureOr<Operation *>` in `matchAndRewriteMaskableOp` method. Because we eventually will just replace the op with the new operation.

And perhaps we don't need the check anymore.

https://github.com/llvm/llvm-project/blob/d4ff9615a1531f4a466b7d1fb0f175e3ae489289/mlir/include/mlir/Dialect/Vector/Utils/VectorUtils.h#L160-L167

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


More information about the Mlir-commits mailing list