[Mlir-commits] [mlir] [mlir][Transforms] `GreedyPatternRewriteDriver`: Hash ops separately (PR #78312)
Matthias Springer
llvmlistbot at llvm.org
Sun Jan 21 01:49:41 PST 2024
================
@@ -125,14 +128,18 @@ struct ExpensiveChecks : public RewriterBase::ForwardingListener {
protected:
/// Invalidate the finger print of the given op, i.e., remove it from the map.
- void invalidateFingerPrint(Operation *op) {
- // Invalidate all finger prints until the top level.
- while (op && op != topLevel) {
- fingerprints.erase(op);
- op = op->getParentOp();
- }
- }
+ void invalidateFingerPrint(Operation *op) { fingerprints.erase(op); }
+ void notifyBlockRemoved(Block *block) override {
+ RewriterBase::ForwardingListener::notifyBlockRemoved(block);
+
+ // The block structure (number of blocks, types of block arguments, etc.)
+ // is part of the fingerprint of the parent op.
+ // TODO: The parent op fingerprint should also be invalidated when modifying
+ // the block arguments of a block, but we do not have a
+ // `notifyBlockModified` callback yet.
+ invalidateFingerPrint(block->getParentOp());
----------------
matthias-springer wrote:
It is. The entire class is inside of an `#if MLIR_ENABLE_EXPENSIVE_CHECKS`.
https://github.com/llvm/llvm-project/pull/78312
More information about the Mlir-commits
mailing list