[llvm-commits] [llvm] r132416 - /llvm/trunk/lib/Analysis/ScalarEvolution.cpp
Andrew Trick
atrick at apple.com
Wed Jun 1 12:14:56 PDT 2011
Author: atrick
Date: Wed Jun 1 14:14:56 2011
New Revision: 132416
URL: http://llvm.org/viewvc/llvm-project?rev=132416&view=rev
Log:
SCEV: missing null check fix for r132360, dragonegg crash.
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=132416&r1=132415&r2=132416&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/ScalarEvolution.cpp (original)
+++ llvm/trunk/lib/Analysis/ScalarEvolution.cpp Wed Jun 1 14:14:56 2011
@@ -1081,9 +1081,8 @@
const SCEVAddRecExpr *PreAR = dyn_cast<SCEVAddRecExpr>(
SE->getAddRecExpr(PreStart, Step, L, SCEV::FlagAnyWrap));
- if (PreAR && PreAR->getNoWrapFlags(SCEV::FlagNSW)) {
+ if (PreAR && PreAR->getNoWrapFlags(SCEV::FlagNSW))
return PreStart;
- }
// 2. Direct overflow check on the step operation's expression.
unsigned BitWidth = SE->getTypeSizeInBits(AR->getType());
@@ -1104,7 +1103,8 @@
ICmpInst::Predicate Pred;
const SCEV *OverflowLimit = getOverflowLimitForStep(Step, &Pred, SE);
- if (SE->isLoopEntryGuardedByCond(L, Pred, PreStart, OverflowLimit)) {
+ if (OverflowLimit &&
+ SE->isLoopEntryGuardedByCond(L, Pred, PreStart, OverflowLimit)) {
return PreStart;
}
return 0;
More information about the llvm-commits
mailing list