[Mlir-commits] [mlir] [mlir][bufferization] Unranked memref support for clone (PR #94757)

Spenser Bauman llvmlistbot at llvm.org
Fri Jun 7 12:58:38 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);
----------------
sabauma wrote:

These constants are only used in the new branch for unranked memrefs, can they be moved there to avoid creating additional constants.

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


More information about the Mlir-commits mailing list