[llvm] r309480 - [SCEV] Change an early exit to an assert; NFC
Sanjoy Das via llvm-commits
llvm-commits at lists.llvm.org
Fri Jul 28 22:32:47 PDT 2017
Author: sanjoy
Date: Fri Jul 28 22:32:47 2017
New Revision: 309480
URL: http://llvm.org/viewvc/llvm-project?rev=309480&view=rev
Log:
[SCEV] Change an early exit to an assert; NFC
Modified:
llvm/trunk/lib/Analysis/ScalarEvolution.cpp
Modified: llvm/trunk/lib/Analysis/ScalarEvolution.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ScalarEvolution.cpp?rev=309480&r1=309479&r2=309480&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/ScalarEvolution.cpp (original)
+++ llvm/trunk/lib/Analysis/ScalarEvolution.cpp Fri Jul 28 22:32:47 2017
@@ -7337,8 +7337,8 @@ ScalarEvolution::getConstantEvolutionLoo
Value *BEValue = PN->getIncomingValueForBlock(Latch);
// Execute the loop symbolically to determine the exit value.
- if (BEs.getActiveBits() >= 32)
- return RetVal = nullptr; // More than 2^32-1 iterations?? Not doing it!
+ assert(BEs.getActiveBits() < CHAR_BIT * sizeof(unsigned) &&
+ "BEs is <= MaxBruteForceIterations which is an 'unsigned'!");
unsigned NumIterations = BEs.getZExtValue(); // must be in range
unsigned IterationNum = 0;
More information about the llvm-commits
mailing list