diff options
Diffstat (limited to 'lib/Analysis/ScalarEvolution.cpp')
-rw-r--r-- | lib/Analysis/ScalarEvolution.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/Analysis/ScalarEvolution.cpp b/lib/Analysis/ScalarEvolution.cpp index 922751fe3d..8deade345f 100644 --- a/lib/Analysis/ScalarEvolution.cpp +++ b/lib/Analysis/ScalarEvolution.cpp @@ -2722,11 +2722,12 @@ const SCEV *ScalarEvolution::createNodeForPHI(PHINode *PN) { HasNUW = true; if (OBO->hasNoSignedWrap()) HasNSW = true; - } else if (isa<GEPOperator>(BEValueV)) { + } else if (const GEPOperator *GEP = + dyn_cast<GEPOperator>(BEValueV)) { // If the increment is a GEP, then we know it won't perform an // unsigned overflow, because the address space cannot be // wrapped around. - HasNUW = true; + HasNUW |= GEP->isInBounds(); } const SCEV *StartVal = getSCEV(StartValueV); |