Skip to content

Commit caf7f05

Browse files
committed
[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
1 parent 99d72eb commit caf7f05

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

llvm/lib/Transforms/IPO/Attributor.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -1639,13 +1639,13 @@ void Attributor::runTillFixpoint() {
16391639
} while (!Worklist.empty() && (IterationCounter++ < MaxFixedPointIterations ||
16401640
VerifyMaxFixpointIterations));
16411641

1642-
if (IterationCounter > MaxFixedPointIterations && !Worklist.empty()) {
1642+
if (IterationCounter > MaxFixedPointIterations && !Functions.empty()) {
16431643
auto Remark = [&](OptimizationRemarkMissed ORM) {
16441644
return ORM << "Attributor did not reach a fixpoint after "
16451645
<< ore::NV("Iterations", MaxFixedPointIterations)
16461646
<< " iterations.";
16471647
};
1648-
Function *F = Worklist.front()->getIRPosition().getAssociatedFunction();
1648+
Function *F = Functions.front();
16491649
emitRemark<OptimizationRemarkMissed>(F, "FixedPoint", Remark);
16501650
}
16511651

0 commit comments

Comments
 (0)