diff options
author | Bob Wilson <bob.wilson@apple.com> | 2010-01-29 19:19:08 +0000 |
---|---|---|
committer | Bob Wilson <bob.wilson@apple.com> | 2010-01-29 19:19:08 +0000 |
commit | 3eb4f7e2dd98038f94e45d1c45ccff49e6659c87 (patch) | |
tree | 9ad9e9d474fae169ffb5303be1b8ff1336e6704e /lib/Transforms/Scalar | |
parent | 01eba397936941f35dfb0995beace7ed03b847f2 (diff) | |
download | external_llvm-3eb4f7e2dd98038f94e45d1c45ccff49e6659c87.zip external_llvm-3eb4f7e2dd98038f94e45d1c45ccff49e6659c87.tar.gz external_llvm-3eb4f7e2dd98038f94e45d1c45ccff49e6659c87.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')
-rw-r--r-- | lib/Transforms/Scalar/GVN.cpp | 3 |
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; } |