summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/ScalarEvolutionExpander.cpp
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2009-07-28 01:40:03 +0000
committerDan Gohman <gohman@apple.com>2009-07-28 01:40:03 +0000
commit31a9b9880b8641b0a9e1f5182c45fbf76f732764 (patch)
treee4035b5ecab96f6e4b55cab794c00b997390c142 /llvm/lib/Analysis/ScalarEvolutionExpander.cpp
parent38a579fe5accb8f74263ab7189bdef359f103862 (diff)
downloadbcm5719-llvm-31a9b9880b8641b0a9e1f5182c45fbf76f732764.tar.gz
bcm5719-llvm-31a9b9880b8641b0a9e1f5182c45fbf76f732764.zip
Teach instcombine to respect and preserve inbounds. Add inbounds
to a few tests where it is required for the expected transformation. llvm-svn: 77290
Diffstat (limited to 'llvm/lib/Analysis/ScalarEvolutionExpander.cpp')
-rw-r--r--llvm/lib/Analysis/ScalarEvolutionExpander.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/Analysis/ScalarEvolutionExpander.cpp b/llvm/lib/Analysis/ScalarEvolutionExpander.cpp
index eb2236b2d77..e098ea256ff 100644
--- a/llvm/lib/Analysis/ScalarEvolutionExpander.cpp
+++ b/llvm/lib/Analysis/ScalarEvolutionExpander.cpp
@@ -349,7 +349,9 @@ Value *SCEVExpander::expandAddToGEP(const SCEV *const *op_begin,
return GEP;
}
- // Insert a pretty getelementptr.
+ // Insert a pretty getelementptr. Note that this GEP is not marked inbounds,
+ // because ScalarEvolution may have changed the address arithmetic to
+ // compute a value which is beyond the end of the allocated object.
Value *GEP = Builder.CreateGEP(V,
GepIndices.begin(),
GepIndices.end(),
OpenPOWER on IntegriCloud