[Attributor] Improve messages in iteration verify mode

When we now verify the iteration count we will see the actual count
and the expected count before the assertion is triggered.

llvm-svn: 370285
This commit is contained in:
Johannes Doerfert 2019-08-29 01:29:44 +00:00
parent a283125ef2
commit bf112139ac
1 changed files with 12 additions and 11 deletions

View File

@ -2608,22 +2608,14 @@ ChangeStatus Attributor::run() {
Worklist.clear();
Worklist.insert(ChangedAAs.begin(), ChangedAAs.end());
} while (!Worklist.empty() && IterationCounter++ < MaxFixpointIterations);
size_t NumFinalAAs = AllAbstractAttributes.size();
if (VerifyMaxFixpointIterations && IterationCounter != MaxFixpointIterations) {
errs() << "\n[Attributor] Fixpoint iteration done after: "
<< IterationCounter << "/" << MaxFixpointIterations
<< " iterations\n";
llvm_unreachable("The fixpoint was not reached with exactly the number of "
"specified iterations!");
}
} while (!Worklist.empty() && (IterationCounter++ < MaxFixpointIterations ||
VerifyMaxFixpointIterations));
LLVM_DEBUG(dbgs() << "\n[Attributor] Fixpoint iteration done after: "
<< IterationCounter << "/" << MaxFixpointIterations
<< " iterations\n");
size_t NumFinalAAs = AllAbstractAttributes.size();
bool FinishedAtFixpoint = Worklist.empty();
@ -2737,6 +2729,15 @@ ChangeStatus Attributor::run() {
Fn->eraseFromParent();
}
if (VerifyMaxFixpointIterations &&
IterationCounter != MaxFixpointIterations) {
errs() << "\n[Attributor] Fixpoint iteration done after: "
<< IterationCounter << "/" << MaxFixpointIterations
<< " iterations\n";
llvm_unreachable("The fixpoint was not reached with exactly the number of "
"specified iterations!");
}
return ManifestChange;
}