summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2009-07-17 04:28:42 +0000
committerEli Friedman <eli.friedman@gmail.com>2009-07-17 04:28:42 +0000
commitb8f6a4fc8e554d44d9dd4759f503ee74f5cc58df (patch)
treeb9ca4e65ad9c2e10f23f15fda8f426c8d283f294 /llvm/lib/Analysis
parent1fa07e1aeaac2347e549056093bbc60dac4f7941 (diff)
downloadbcm5719-llvm-b8f6a4fc8e554d44d9dd4759f503ee74f5cc58df.tar.gz
bcm5719-llvm-b8f6a4fc8e554d44d9dd4759f503ee74f5cc58df.zip
Replace isTrapping with a new, similar method called
isSafeToSpeculativelyExecute. The new method is a bit closer to what the callers actually care about in that it rejects more things callers don't want. It also adds more precise handling for integer division, and unifies code for analyzing the legality of a speculative load. llvm-svn: 76150
Diffstat (limited to 'llvm/lib/Analysis')
-rw-r--r--llvm/lib/Analysis/LoopInfo.cpp9
1 files changed, 2 insertions, 7 deletions
diff --git a/llvm/lib/Analysis/LoopInfo.cpp b/llvm/lib/Analysis/LoopInfo.cpp
index d350fa6f9eb..bef6bef3370 100644
--- a/llvm/lib/Analysis/LoopInfo.cpp
+++ b/llvm/lib/Analysis/LoopInfo.cpp
@@ -79,14 +79,9 @@ bool Loop::makeLoopInvariant(Instruction *I, bool &Changed,
// Test if the value is already loop-invariant.
if (isLoopInvariant(I))
return true;
- // Don't hoist instructions with side-effects.
- if (I->isTrapping())
+ if (!I->isSafeToSpeculativelyExecute())
return false;
- // Don't hoist PHI nodes.
- if (isa<PHINode>(I))
- return false;
- // Don't hoist allocation instructions.
- if (isa<AllocationInst>(I))
+ if (I->mayReadFromMemory())
return false;
// Determine the insertion point, unless one was given.
if (!InsertPt) {
OpenPOWER on IntegriCloud