diff options
author | Eli Friedman <eli.friedman@gmail.com> | 2009-07-17 04:28:42 +0000 |
---|---|---|
committer | Eli Friedman <eli.friedman@gmail.com> | 2009-07-17 04:28:42 +0000 |
commit | 490e6c73d6d9761edee8ff9e271528cd19f88bcd (patch) | |
tree | 660f0ded255f727b4f60161a752eec3bad39b6e4 /lib/Analysis/LoopInfo.cpp | |
parent | 11cfb006bf80e30c3ac4cae0f60f61c790d19462 (diff) | |
download | external_llvm-490e6c73d6d9761edee8ff9e271528cd19f88bcd.zip external_llvm-490e6c73d6d9761edee8ff9e271528cd19f88bcd.tar.gz external_llvm-490e6c73d6d9761edee8ff9e271528cd19f88bcd.tar.bz2 |
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76150 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/LoopInfo.cpp')
-rw-r--r-- | lib/Analysis/LoopInfo.cpp | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/lib/Analysis/LoopInfo.cpp b/lib/Analysis/LoopInfo.cpp index d350fa6..bef6bef 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) { |