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/GVN.cpp | |
parent | 01eba397936941f35dfb0995beace7ed03b847f2 (diff) |
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.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Transforms/Scalar/GVN.cpp b/lib/Transforms/Scalar/GVN.cpp index 292a4b311d..9c18452665 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; } |