diff options
| author | Dan Gohman <gohman@apple.com> | 2011-12-14 23:49:11 +0000 |
|---|---|---|
| committer | Dan Gohman <gohman@apple.com> | 2011-12-14 23:49:11 +0000 |
| commit | 75d7d5e988539819d596f345d99c26a7aa3bd09b (patch) | |
| tree | 16a51fb02f09e88467601a2d6ae95565d0ecfb2b /llvm/lib/Transforms/Scalar/Sink.cpp | |
| parent | 9efd7ebf0a071d757d2c7d95920673e3433d9e7a (diff) | |
| download | bcm5719-llvm-75d7d5e988539819d596f345d99c26a7aa3bd09b.tar.gz bcm5719-llvm-75d7d5e988539819d596f345d99c26a7aa3bd09b.zip | |
Move Instruction::isSafeToSpeculativelyExecute out of VMCore and
into Analysis as a standalone function, since there's no need for
it to be in VMCore. Also, update it to use isKnownNonZero and
other goodies available in Analysis, making it more precise,
enabling more aggressive optimization.
llvm-svn: 146610
Diffstat (limited to 'llvm/lib/Transforms/Scalar/Sink.cpp')
| -rw-r--r-- | llvm/lib/Transforms/Scalar/Sink.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Scalar/Sink.cpp b/llvm/lib/Transforms/Scalar/Sink.cpp index c83f56c4d2d..ef65c0a3a90 100644 --- a/llvm/lib/Transforms/Scalar/Sink.cpp +++ b/llvm/lib/Transforms/Scalar/Sink.cpp @@ -18,6 +18,7 @@ #include "llvm/Analysis/Dominators.h" #include "llvm/Analysis/LoopInfo.h" #include "llvm/Analysis/AliasAnalysis.h" +#include "llvm/Analysis/ValueTracking.h" #include "llvm/Assembly/Writer.h" #include "llvm/ADT/Statistic.h" #include "llvm/Support/CFG.h" @@ -240,7 +241,7 @@ bool Sinking::SinkInstruction(Instruction *Inst, if (SuccToSinkTo->getUniquePredecessor() != ParentBlock) { // We cannot sink a load across a critical edge - there may be stores in // other code paths. - if (!Inst->isSafeToSpeculativelyExecute()) { + if (!isSafeToSpeculativelyExecute(Inst)) { DEBUG(dbgs() << " *** PUNTING: Wont sink load along critical edge.\n"); return false; } |

