From 263dcf0b99083080052263d61063dfe4be078a77 Mon Sep 17 00:00:00 2001 From: Scott Todd Date: Tue, 3 Dec 2024 09:24:54 -0800 Subject: [PATCH] Fix `-Werror=dangling-pointer` errors reported linux-aarch64 gcc build. (#19351) Another tentative fix for https://github.com/iree-org/iree/issues/19264. This was not fixed by https://github.com/iree-org/iree/pull/19265. (Untested beyond what presubmit covers) --- .../compiler/Codegen/Common/ConcretizePadResultShape.cpp | 5 +++-- .../compiler/Codegen/Common/ConfigTrackingCanonicalizer.cpp | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) 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();