summaryrefslogtreecommitdiffstats
path: root/mlir/lib/Transforms
diff options
context:
space:
mode:
Diffstat (limited to 'mlir/lib/Transforms')
-rw-r--r--mlir/lib/Transforms/DialectConversion.cpp18
-rw-r--r--mlir/lib/Transforms/Utils/GreedyPatternRewriteDriver.cpp11
2 files changed, 10 insertions, 19 deletions
diff --git a/mlir/lib/Transforms/DialectConversion.cpp b/mlir/lib/Transforms/DialectConversion.cpp
index 6d34db90912..ea4ad681693 100644
--- a/mlir/lib/Transforms/DialectConversion.cpp
+++ b/mlir/lib/Transforms/DialectConversion.cpp
@@ -802,13 +802,6 @@ void ConversionPatternRewriter::replaceUsesOfBlockArgument(BlockArgument *from,
impl->mapping.map(impl->mapping.lookupOrDefault(from), to);
}
-/// Clone the given operation without cloning its regions.
-Operation *ConversionPatternRewriter::cloneWithoutRegions(Operation *op) {
- Operation *newOp = OpBuilder::cloneWithoutRegions(*op);
- impl->createdOps.push_back(newOp);
- return newOp;
-}
-
/// Return the converted value that replaces 'key'. Return 'key' if there is
/// no such a converted value.
Value *ConversionPatternRewriter::getRemappedValue(Value *key) {
@@ -854,12 +847,11 @@ void ConversionPatternRewriter::cloneRegionBefore(
}
/// PatternRewriter hook for creating a new operation.
-Operation *
-ConversionPatternRewriter::createOperation(const OperationState &state) {
- LLVM_DEBUG(llvm::dbgs() << "** Creating operation : " << state.name << "\n");
- auto *result = OpBuilder::createOperation(state);
- impl->createdOps.push_back(result);
- return result;
+Operation *ConversionPatternRewriter::insert(Operation *op) {
+ LLVM_DEBUG(llvm::dbgs() << "** Inserting operation : " << op->getName()
+ << "\n");
+ impl->createdOps.push_back(op);
+ return OpBuilder::insert(op);
}
/// PatternRewriter hook for updating the root operation in-place.
diff --git a/mlir/lib/Transforms/Utils/GreedyPatternRewriteDriver.cpp b/mlir/lib/Transforms/Utils/GreedyPatternRewriteDriver.cpp
index aa4563c96e4..e2ca3f8fc5e 100644
--- a/mlir/lib/Transforms/Utils/GreedyPatternRewriteDriver.cpp
+++ b/mlir/lib/Transforms/Utils/GreedyPatternRewriteDriver.cpp
@@ -86,12 +86,11 @@ public:
// These are hooks implemented for PatternRewriter.
protected:
- // Implement the hook for creating operations, and make sure that newly
- // created ops are added to the worklist for processing.
- Operation *createOperation(const OperationState &state) override {
- auto *result = OpBuilder::createOperation(state);
- addToWorklist(result);
- return result;
+ // Implement the hook for inserting operations, and make sure that newly
+ // inserted ops are added to the worklist for processing.
+ Operation *insert(Operation *op) override {
+ addToWorklist(op);
+ return OpBuilder::insert(op);
}
// If an operation is about to be removed, make sure it is not in our
OpenPOWER on IntegriCloud