diff options
author | Chris Lattner <sabre@nondot.org> | 2011-01-09 02:28:48 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2011-01-09 02:28:48 +0000 |
commit | 10223a3fbf632a7693cafa76204b520fc2d800cd (patch) | |
tree | d11414c5457c29b01a8fe1457644c62160053e2e /llvm/lib/Analysis | |
parent | a337f5ec5c2b3bd8b0725641c69b508f5dc6f742 (diff) | |
download | bcm5719-llvm-10223a3fbf632a7693cafa76204b520fc2d800cd.tar.gz bcm5719-llvm-10223a3fbf632a7693cafa76204b520fc2d800cd.zip |
teach SCEV analysis of PHI nodes that PHI recurences formed
with GEP instructions are always NUW, because PHIs cannot wrap
the end of the address space.
llvm-svn: 123105
Diffstat (limited to 'llvm/lib/Analysis')
-rw-r--r-- | llvm/lib/Analysis/ScalarEvolution.cpp | 5 |
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); |