diff options
author | Chris Lattner <sabre@nondot.org> | 2009-06-16 17:23:12 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-06-16 17:23:12 +0000 |
commit | 6cc8a93c486f889c5767278508bc655942ba408e (patch) | |
tree | f9df28ad13a94e2e1eea5c3f79030970c6c75f1b /include/llvm/Transforms/Utils/Local.h | |
parent | 003263bb9ffb170723e3f403d3d34855a302b519 (diff) |
Generalize instcombine's isSafeToLoadUnconditionally() function
to ignore readonly calls, and factor it out of instcombine so
that it can be used by other passes. Patch by Frits van Bommel!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73506 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Transforms/Utils/Local.h')
-rw-r--r-- | include/llvm/Transforms/Utils/Local.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/include/llvm/Transforms/Utils/Local.h b/include/llvm/Transforms/Utils/Local.h index 5ea1a500c5..7ab8721af7 100644 --- a/include/llvm/Transforms/Utils/Local.h +++ b/include/llvm/Transforms/Utils/Local.h @@ -31,6 +31,16 @@ struct DbgInfoIntrinsic; template<typename T> class SmallVectorImpl; //===----------------------------------------------------------------------===// +// Local analysis. +// + +/// isSafeToLoadUnconditionally - Return true if we know that executing a load +/// 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); + +//===----------------------------------------------------------------------===// // Local constant propagation. // |