forked from OSchip/llvm-project
[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:
parent
a283125ef2
commit
bf112139ac
|
@ -2608,22 +2608,14 @@ ChangeStatus Attributor::run() {
|
||||||
Worklist.clear();
|
Worklist.clear();
|
||||||
Worklist.insert(ChangedAAs.begin(), ChangedAAs.end());
|
Worklist.insert(ChangedAAs.begin(), ChangedAAs.end());
|
||||||
|
|
||||||
} while (!Worklist.empty() && IterationCounter++ < MaxFixpointIterations);
|
} while (!Worklist.empty() && (IterationCounter++ < MaxFixpointIterations ||
|
||||||
|
VerifyMaxFixpointIterations));
|
||||||
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!");
|
|
||||||
}
|
|
||||||
|
|
||||||
LLVM_DEBUG(dbgs() << "\n[Attributor] Fixpoint iteration done after: "
|
LLVM_DEBUG(dbgs() << "\n[Attributor] Fixpoint iteration done after: "
|
||||||
<< IterationCounter << "/" << MaxFixpointIterations
|
<< IterationCounter << "/" << MaxFixpointIterations
|
||||||
<< " iterations\n");
|
<< " iterations\n");
|
||||||
|
|
||||||
|
size_t NumFinalAAs = AllAbstractAttributes.size();
|
||||||
|
|
||||||
bool FinishedAtFixpoint = Worklist.empty();
|
bool FinishedAtFixpoint = Worklist.empty();
|
||||||
|
|
||||||
|
@ -2737,6 +2729,15 @@ ChangeStatus Attributor::run() {
|
||||||
Fn->eraseFromParent();
|
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;
|
return ManifestChange;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue