Skip to content

Commit

Permalink
NFC: Add a note to 'applyPatternsGreedily' that it also performs fold…
Browse files Browse the repository at this point in the history
…ing/dce.

Fixes tensorflow/mlir#72

PiperOrigin-RevId: 265097597
  • Loading branch information
River707 authored and tensorflower-gardener committed Aug 23, 2019
1 parent 7f42b3d commit 32052c8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 2 additions & 0 deletions mlir/include/mlir/IR/PatternMatch.h
Expand Up @@ -456,6 +456,8 @@ class RewritePatternMatcher {
/// work-list driven manner. Return true if no more patterns can be matched in
/// the result operation regions.
/// Note: This does not apply patterns to the top-level operation itself.
/// Note: This method also performs folding and simply dead-code elimination
/// before attempting to match any of the provided patterns.
///
bool applyPatternsGreedily(Operation *op,
const OwningRewritePatternList &patterns);
Expand Down
5 changes: 2 additions & 3 deletions mlir/lib/Transforms/Utils/GreedyPatternRewriteDriver.cpp
Expand Up @@ -204,9 +204,8 @@ bool GreedyPatternRewriteDriver::simplify(Operation *op, int maxIterations) {
// Make sure that any new operations are inserted at this point.
setInsertionPoint(op);

// Try to match one of the canonicalization patterns. The rewriter is
// automatically notified of any necessary changes, so there is nothing
// else to do here.
// Try to match one of the patterns. The rewriter is automatically
// notified of any necessary changes, so there is nothing else to do here.
changed |= matcher.matchAndRewrite(op, *this);
}
} while (changed && ++i < maxIterations);
Expand Down

0 comments on commit 32052c8

Please sign in to comment.