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 | b8f6a4fc8e554d44d9dd4759f503ee74f5cc58df (patch) | |
tree | b9ca4e65ad9c2e10f23f15fda8f426c8d283f294 /llvm/lib/Transforms/Scalar/TailDuplication.cpp | |
parent | 1fa07e1aeaac2347e549056093bbc60dac4f7941 (diff) | |
download | bcm5719-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/Transforms/Scalar/TailDuplication.cpp')
-rw-r--r-- | llvm/lib/Transforms/Scalar/TailDuplication.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Scalar/TailDuplication.cpp b/llvm/lib/Transforms/Scalar/TailDuplication.cpp index 684b0963456..6d05fdf18c2 100644 --- a/llvm/lib/Transforms/Scalar/TailDuplication.cpp +++ b/llvm/lib/Transforms/Scalar/TailDuplication.cpp @@ -258,7 +258,8 @@ void TailDup::eliminateUnconditionalBranch(BranchInst *Branch) { while (!isa<TerminatorInst>(BBI)) { Instruction *I = BBI++; - bool CanHoist = !I->isTrapping() && !I->mayHaveSideEffects(); + bool CanHoist = I->isSafeToSpeculativelyExecute() && + !I->mayReadFromMemory(); if (CanHoist) { for (unsigned op = 0, e = I->getNumOperands(); op != e; ++op) if (Instruction *OpI = dyn_cast<Instruction>(I->getOperand(op))) |