diff --git a/mlir/lib/Transforms/Utils/GreedyPatternRewriteDriver.cpp b/mlir/lib/Transforms/Utils/GreedyPatternRewriteDriver.cpp --- a/mlir/lib/Transforms/Utils/GreedyPatternRewriteDriver.cpp +++ b/mlir/lib/Transforms/Utils/GreedyPatternRewriteDriver.cpp @@ -94,12 +94,6 @@ llvm::SmallDenseSet strictModeFilteredOps; private: - /// Look over the provided operands for any defining operations that should - /// be re-added to the worklist. This function should be called when an - /// operation is modified or removed, as it may trigger further - /// simplifications. - void addOperandsToWorklist(ValueRange operands); - /// Pop the next operation from the worklist. Operation *popFromWorklist(); @@ -318,20 +312,6 @@ addToWorklist(op); } -void GreedyPatternRewriteDriver::addOperandsToWorklist(ValueRange operands) { - for (Value operand : operands) { - // If the use count of this operand is now < 2, we re-add the defining - // operation to the worklist. - // TODO: This is based on the fact that zero use operations - // may be deleted, and that single use values often have more - // canonicalization opportunities. - if (!operand || (!operand.use_empty() && !operand.hasOneUse())) - continue; - if (auto *defOp = operand.getDefiningOp()) - addToWorklist(defOp); - } -} - void GreedyPatternRewriteDriver::notifyOperationRemoved(Operation *op) { LLVM_DEBUG({ logger.startLine() << "** Erase : '" << op->getName() << "'(" << op @@ -340,7 +320,6 @@ if (config.listener) config.listener->notifyOperationRemoved(op); - addOperandsToWorklist(op->getOperands()); op->walk([this](Operation *operation) { removeFromWorklist(operation); folder.notifyRemoval(operation);