[Mlir-commits] [mlir] [mlir][bufferization] Unranked memref support for clone (PR #94757)
Matthias Springer
llvmlistbot at llvm.org
Sun Jun 9 01:38:45 PDT 2024
================
@@ -42,39 +42,78 @@ struct CloneOpConversion : public OpConversionPattern<bufferization::CloneOp> {
LogicalResult
matchAndRewrite(bufferization::CloneOp op, OpAdaptor adaptor,
ConversionPatternRewriter &rewriter) const override {
- // Check for unranked memref types which are currently not supported.
+ Location loc = op->getLoc();
+
+ Value zero = rewriter.create<arith::ConstantIndexOp>(loc, 0);
+ Value one = rewriter.create<arith::ConstantIndexOp>(loc, 1);
+
Type type = op.getType();
+ Value alloc;
+
if (isa<UnrankedMemRefType>(type)) {
----------------
matthias-springer wrote:
`if (auto unrankedType = dyn_cast<UnrankedMemRefType>(type)) {`
Then you don't need the `UnrankedMemRefType unranked = cast<UnrankedMemRefType>(type)` below.
https://github.com/llvm/llvm-project/pull/94757
More information about the Mlir-commits
mailing list