[Mlir-commits] [mlir] [mlir][vector][spirv] Lower vector.transfer_read and vector.transfer_write to SPIR-V (PR #69708)
Lei Zhang
llvmlistbot at llvm.org
Fri Oct 27 09:36:48 PDT 2023
================
@@ -509,6 +509,87 @@ struct VectorShuffleOpConvert final
}
};
+struct VectorTransferReadOpConverter final
+ : public OpConversionPattern<vector::TransferReadOp> {
+ using OpConversionPattern::OpConversionPattern;
+
+ LogicalResult
+ matchAndRewrite(vector::TransferReadOp transferReadOp, OpAdaptor adaptor,
+ ConversionPatternRewriter &rewriter) const override {
+ if (transferReadOp.getMask())
+ return rewriter.notifyMatchFailure(transferReadOp,
+ "unsupported transfer_read with mask");
+ auto sourceType = transferReadOp.getSource().getType();
+ if (!llvm::isa<MemRefType>(sourceType))
----------------
antiagainst wrote:
```c++
auto memrefType = dyn_cast<MemRefType>(sourceType);
if (!memrefType) ...
```
https://github.com/llvm/llvm-project/pull/69708
More information about the Mlir-commits
mailing list