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 | 6d5a2411aad379141df29687b8cec0938ab7ae61 (patch) | |
tree | 7949687e72243113a25f85b2be1ce3efc56a3cd5 /lib/Analysis/ScalarEvolution.cpp | |
parent | f1859891b7bef1ac8d5cea100f152aeb5783c3b3 (diff) | |
download | external_llvm-6d5a2411aad379141df29687b8cec0938ab7ae61.zip external_llvm-6d5a2411aad379141df29687b8cec0938ab7ae61.tar.gz external_llvm-6d5a2411aad379141df29687b8cec0938ab7ae61.tar.bz2 |
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123105 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/ScalarEvolution.cpp')
-rw-r--r-- | lib/Analysis/ScalarEvolution.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/Analysis/ScalarEvolution.cpp b/lib/Analysis/ScalarEvolution.cpp index fa828ac..b675e28 100644 --- a/lib/Analysis/ScalarEvolution.cpp +++ b/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); |