[llvm] r370285 - [Attributor] Improve messages in iteration verify mode
Johannes Doerfert via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 28 18:29:44 PDT 2019
Author: jdoerfert
Date: Wed Aug 28 18:29:44 2019
New Revision: 370285
URL: http://llvm.org/viewvc/llvm-project?rev=370285&view=rev
Log:
[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.
Modified:
llvm/trunk/lib/Transforms/IPO/Attributor.cpp
Modified: llvm/trunk/lib/Transforms/IPO/Attributor.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/Attributor.cpp?rev=370285&r1=370284&r2=370285&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/IPO/Attributor.cpp (original)
+++ llvm/trunk/lib/Transforms/IPO/Attributor.cpp Wed Aug 28 18:29:44 2019
@@ -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;
}
More information about the llvm-commits
mailing list