aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Transforms/Scalar/GVN.cpp
diff options
context:
space:
mode:
authorBob Wilson <bob.wilson@apple.com>2010-01-29 19:19:08 +0000
committerBob Wilson <bob.wilson@apple.com>2010-01-29 19:19:08 +0000
commitbdca60b955f3c8fcc0a7145452909ccf334b60a8 (patch)
tree9ad9e9d474fae169ffb5303be1b8ff1336e6704e /lib/Transforms/Scalar/GVN.cpp
parent4071514fee13e75d1337cced10ffa237d9d2f173 (diff)
downloadexternal_llvm-bdca60b955f3c8fcc0a7145452909ccf334b60a8.zip
external_llvm-bdca60b955f3c8fcc0a7145452909ccf334b60a8.tar.gz
external_llvm-bdca60b955f3c8fcc0a7145452909ccf334b60a8.tar.bz2
Improve isSafeToLoadUnconditionally to recognize that GEPs with constant
indices are safe if the result is known to be within the bounds of the underlying object. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94829 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Scalar/GVN.cpp')
-rw-r--r--lib/Transforms/Scalar/GVN.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Transforms/Scalar/GVN.cpp b/lib/Transforms/Scalar/GVN.cpp
index 292a4b3..9c18452 100644
--- a/lib/Transforms/Scalar/GVN.cpp
+++ b/lib/Transforms/Scalar/GVN.cpp
@@ -1650,7 +1650,8 @@ bool GVN::processNonLocalLoad(LoadInst *LI,
// put anywhere; this can be improved, but should be conservatively safe.
if (!allSingleSucc &&
// FIXME: REEVALUTE THIS.
- !isSafeToLoadUnconditionally(LoadPtr, UnavailablePred->getTerminator())) {
+ !isSafeToLoadUnconditionally(LoadPtr,
+ UnavailablePred->getTerminator(), TD)) {
assert(NewInsts.empty() && "Should not have inserted instructions");
return false;
}