aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Analysis/LoopInfo.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Analysis/LoopInfo.cpp')
-rw-r--r--lib/Analysis/LoopInfo.cpp9
1 files changed, 2 insertions, 7 deletions
diff --git a/lib/Analysis/LoopInfo.cpp b/lib/Analysis/LoopInfo.cpp
index d350fa6f9e..bef6bef337 100644
--- a/lib/Analysis/LoopInfo.cpp
+++ b/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) {