From: Tres Popp Date: Thu, 29 Oct 2020 10:01:05 +0000 (+0100) Subject: [mlir] Reorder shape assuming bufferization. X-Git-Tag: llvmorg-13-init~7761 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9dbffe4a28f46a9fd5dab36bf443a090588ac6de;p=platform%2Fupstream%2Fllvm.git [mlir] Reorder shape assuming bufferization. The previous ordering continued to use the original assuming after replacing it which is not allowed. Now, inline the region from the old into the new before the replacement. Differential Revision: https://reviews.llvm.org/D90375 --- diff --git a/mlir/lib/Dialect/Shape/Transforms/StructuralTypeConversions.cpp b/mlir/lib/Dialect/Shape/Transforms/StructuralTypeConversions.cpp index 61e8628..041b54b 100644 --- a/mlir/lib/Dialect/Shape/Transforms/StructuralTypeConversions.cpp +++ b/mlir/lib/Dialect/Shape/Transforms/StructuralTypeConversions.cpp @@ -32,10 +32,9 @@ public: auto newAssumingOp = rewriter.create(op.getLoc(), newResultTypes, op.witness()); - - rewriter.replaceOp(op, newAssumingOp.getResults()); rewriter.inlineRegionBefore(op.doRegion(), newAssumingOp.doRegion(), newAssumingOp.doRegion().end()); + rewriter.replaceOp(op, newAssumingOp.getResults()); return success(); }