Skip to content

Commit f572484

Browse files
[mlir][Transforms][NFC] GreedyPatternRewriteDriver: Remove redundant worklist management code (#74796)
Do not add the previous users of replaced ops to the worklist during `notifyOperationReplaced`. The previous users are modified inplace as part of `PatternRewriter::replaceOp`, which calls `PatternRewriter::replaceAllUsesWith`. The latter function updates all users with `updateRootInPlace`, which already puts all previous users of the replaced op on the worklist. No further worklist management work is needed in the `notifyOperationReplaced` callback.
1 parent 286ef12 commit f572484

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

mlir/lib/Transforms/Utils/GreedyPatternRewriteDriver.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -581,9 +581,6 @@ void GreedyPatternRewriteDriver::notifyOperationReplaced(
581581
});
582582
if (config.listener)
583583
config.listener->notifyOperationReplaced(op, replacement);
584-
for (auto result : op->getResults())
585-
for (auto *user : result.getUsers())
586-
addToWorklist(user);
587584
}
588585

589586
LogicalResult GreedyPatternRewriteDriver::notifyMatchFailure(

0 commit comments

Comments
 (0)