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 | f0426601977c3e386d2d26c72a2cca691dc42072 (patch) | |
tree | 91fd661ded01669ee95c1d1d2115a010644545e8 /lib/Analysis/LoopInfo.cpp | |
parent | 299b059cd675f1e5beac1a2383a44e062e2eef43 (diff) | |
download | external_llvm-f0426601977c3e386d2d26c72a2cca691dc42072.zip external_llvm-f0426601977c3e386d2d26c72a2cca691dc42072.tar.gz external_llvm-f0426601977c3e386d2d26c72a2cca691dc42072.tar.bz2 |
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146610 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/LoopInfo.cpp')
-rw-r--r-- | lib/Analysis/LoopInfo.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Analysis/LoopInfo.cpp b/lib/Analysis/LoopInfo.cpp index eb35553..858cc64 100644 --- a/lib/Analysis/LoopInfo.cpp +++ b/lib/Analysis/LoopInfo.cpp @@ -19,6 +19,7 @@ #include "llvm/Instructions.h" #include "llvm/Analysis/Dominators.h" #include "llvm/Analysis/LoopIterator.h" +#include "llvm/Analysis/ValueTracking.h" #include "llvm/Assembly/Writer.h" #include "llvm/Support/CFG.h" #include "llvm/Support/CommandLine.h" @@ -95,7 +96,7 @@ bool Loop::makeLoopInvariant(Instruction *I, bool &Changed, // Test if the value is already loop-invariant. if (isLoopInvariant(I)) return true; - if (!I->isSafeToSpeculativelyExecute()) + if (!isSafeToSpeculativelyExecute(I)) return false; if (I->mayReadFromMemory()) return false; |