[llvm] caf7f05 - [Attributor] Emit fixed-point remark on function list
Joseph Huber via llvm-commits
llvm-commits at lists.llvm.org
Tue Feb 8 09:10:28 PST 2022
Author: Joseph Huber
Date: 2022-02-08T12:10:21-05:00
New Revision: caf7f05c1c7320fe29c2ec4ebecac91a5c970633
URL: https://github.com/llvm/llvm-project/commit/caf7f05c1c7320fe29c2ec4ebecac91a5c970633
DIFF: https://github.com/llvm/llvm-project/commit/caf7f05c1c7320fe29c2ec4ebecac91a5c970633.diff
LOG: [Attributor] Emit fixed-point remark on function list
This patch replaces the function we emit the remark on when we run into
the fix-point limit. Previously we got a function to emit a remark on
from the worklist's associated function. However, the worklist may not
always have an associated function in the case of global variables.
Replace this with the function set, and if there are no functions don't
emit the remark.
Reviewed By: jdoerfert
Differential Revision: https://reviews.llvm.org/D119248
Added:
Modified:
llvm/lib/Transforms/IPO/Attributor.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Transforms/IPO/Attributor.cpp b/llvm/lib/Transforms/IPO/Attributor.cpp
index d66140a726f69..70db80160e5e8 100644
--- a/llvm/lib/Transforms/IPO/Attributor.cpp
+++ b/llvm/lib/Transforms/IPO/Attributor.cpp
@@ -1639,13 +1639,13 @@ void Attributor::runTillFixpoint() {
} while (!Worklist.empty() && (IterationCounter++ < MaxFixedPointIterations ||
VerifyMaxFixpointIterations));
- if (IterationCounter > MaxFixedPointIterations && !Worklist.empty()) {
+ if (IterationCounter > MaxFixedPointIterations && !Functions.empty()) {
auto Remark = [&](OptimizationRemarkMissed ORM) {
return ORM << "Attributor did not reach a fixpoint after "
<< ore::NV("Iterations", MaxFixedPointIterations)
<< " iterations.";
};
- Function *F = Worklist.front()->getIRPosition().getAssociatedFunction();
+ Function *F = Functions.front();
emitRemark<OptimizationRemarkMissed>(F, "FixedPoint", Remark);
}
More information about the llvm-commits
mailing list