[PATCH] D46178: [SCEV] Reduce the number of invocation to non trivial getExact function
Serguei Katkov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Apr 27 20:58:52 PDT 2018
This revision was automatically updated to reflect the committed changes.
Closed by commit rL331099: [SCEV] Reduce the number of invocation to non trivial getExact function (authored by skatkov, committed by ).
Changed prior to commit:
https://reviews.llvm.org/D46178?vs=144297&id=144433#toc
Repository:
rL LLVM
https://reviews.llvm.org/D46178
Files:
llvm/trunk/lib/Analysis/ScalarEvolution.cpp
Index: llvm/trunk/lib/Analysis/ScalarEvolution.cpp
===================================================================
--- llvm/trunk/lib/Analysis/ScalarEvolution.cpp
+++ llvm/trunk/lib/Analysis/ScalarEvolution.cpp
@@ -6512,8 +6512,10 @@
// must be cleared in this scope.
BackedgeTakenInfo Result = computeBackedgeTakenCount(L);
- if (Result.getExact(L, this) != getCouldNotCompute()) {
- assert(isLoopInvariant(Result.getExact(L, this), L) &&
+#if LLVM_ENABLE_STATS || !defined(NDEBUG)
+ const SCEV *BEExact = Result.getExact(L, this);
+ if (BEExact != getCouldNotCompute()) {
+ assert(isLoopInvariant(BEExact, L) &&
isLoopInvariant(Result.getMax(this), L) &&
"Computed backedge-taken count isn't loop invariant for loop!");
++NumTripCountsComputed;
@@ -6523,6 +6525,7 @@
// Only count loops that have phi nodes as not being computable.
++NumTripCountsNotComputed;
}
+#endif // LLVM_ENABLE_STATS || !defined(NDEBUG)
// Now that we know more about the trip count for this loop, forget any
// existing SCEV values for PHI nodes in this loop since they are only
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D46178.144433.patch
Type: text/x-patch
Size: 1127 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180428/dabb2852/attachment.bin>
More information about the llvm-commits
mailing list