diff --git a/compiler/src/iree/compiler/Codegen/Common/ConcretizePadResultShape.cpp b/compiler/src/iree/compiler/Codegen/Common/ConcretizePadResultShape.cpp index a18577058fe6..13fcc9518173 100644 --- a/compiler/src/iree/compiler/Codegen/Common/ConcretizePadResultShape.cpp +++ b/compiler/src/iree/compiler/Codegen/Common/ConcretizePadResultShape.cpp @@ -137,11 +137,12 @@ class ConcretizePadResultShapePass final auto funcOp = getOperation(); ConfigTrackingListener listener; + GreedyRewriteConfig config; + config.listener = &listener; + { RewritePatternSet patterns(context); populateConcretizePadResultShapePatterns(patterns); - GreedyRewriteConfig config; - config.listener = &listener; if (failed(applyPatternsAndFoldGreedily(funcOp, std::move(patterns), config))) { return signalPassFailure(); diff --git a/compiler/src/iree/compiler/Codegen/Common/ConfigTrackingCanonicalizer.cpp b/compiler/src/iree/compiler/Codegen/Common/ConfigTrackingCanonicalizer.cpp index 54d3cf6d11e1..d2a299db0e59 100644 --- a/compiler/src/iree/compiler/Codegen/Common/ConfigTrackingCanonicalizer.cpp +++ b/compiler/src/iree/compiler/Codegen/Common/ConfigTrackingCanonicalizer.cpp @@ -96,6 +96,7 @@ struct ConfigTrackingCanonicalizerPass final config.listener = &listener; LogicalResult didConverge = applyPatternsAndFoldGreedily(getOperation(), *patterns, config); + config.listener = nullptr; if (this->testConvergence && failed(didConverge)) { getOperation()->emitError("Canonicalizer failed to converge"); return signalPassFailure();