summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/LoopInfo.cpp
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2011-12-14 23:49:11 +0000
committerDan Gohman <gohman@apple.com>2011-12-14 23:49:11 +0000
commit75d7d5e988539819d596f345d99c26a7aa3bd09b (patch)
tree16a51fb02f09e88467601a2d6ae95565d0ecfb2b /llvm/lib/Analysis/LoopInfo.cpp
parent9efd7ebf0a071d757d2c7d95920673e3433d9e7a (diff)
downloadbcm5719-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/Analysis/LoopInfo.cpp')
-rw-r--r--llvm/lib/Analysis/LoopInfo.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Analysis/LoopInfo.cpp b/llvm/lib/Analysis/LoopInfo.cpp
index eb355537f77..858cc642f41 100644
--- a/llvm/lib/Analysis/LoopInfo.cpp
+++ b/llvm/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;
OpenPOWER on IntegriCloud