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 | bdca60b955f3c8fcc0a7145452909ccf334b60a8 (patch) | |
tree | 9ad9e9d474fae169ffb5303be1b8ff1336e6704e /include/llvm/Transforms | |
parent | 4071514fee13e75d1337cced10ffa237d9d2f173 (diff) | |
download | external_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 'include/llvm/Transforms')
-rw-r--r-- | include/llvm/Transforms/Utils/Local.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/include/llvm/Transforms/Utils/Local.h b/include/llvm/Transforms/Utils/Local.h index f6d9f82..3211518 100644 --- a/include/llvm/Transforms/Utils/Local.h +++ b/include/llvm/Transforms/Utils/Local.h @@ -38,7 +38,8 @@ template<typename T> class SmallVectorImpl; /// from this value cannot trap. If it is not obviously safe to load from the /// specified pointer, we do a quick local scan of the basic block containing /// ScanFrom, to determine if the address is already accessed. -bool isSafeToLoadUnconditionally(Value *V, Instruction *ScanFrom); +bool isSafeToLoadUnconditionally(Value *V, Instruction *ScanFrom, + const TargetData *TD = 0); //===----------------------------------------------------------------------===// // Local constant propagation. |