summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Analysis')
-rw-r--r--llvm/lib/Analysis/ScalarEvolution.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/Analysis/ScalarEvolution.cpp b/llvm/lib/Analysis/ScalarEvolution.cpp
index fa828acc5be..b675e286bad 100644
--- a/llvm/lib/Analysis/ScalarEvolution.cpp
+++ b/llvm/lib/Analysis/ScalarEvolution.cpp
@@ -2719,6 +2719,11 @@ const SCEV *ScalarEvolution::createNodeForPHI(PHINode *PN) {
HasNUW = true;
if (OBO->hasNoSignedWrap())
HasNSW = true;
+ } else if (isa<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;
}
const SCEV *StartVal = getSCEV(StartValueV);
OpenPOWER on IntegriCloud