diff options
author | Dan Gohman <gohman@apple.com> | 2010-11-11 16:20:28 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2010-11-11 16:20:28 +0000 |
commit | 2c71f18ff7f5e1504ffeff85f643314e84e6e5d9 (patch) | |
tree | f1ebc827ec4e859bf3d88a321bd660072bf2fd03 | |
parent | e7ae70b137f9944da30494a45dc660fa60b80b66 (diff) | |
download | external_llvm-2c71f18ff7f5e1504ffeff85f643314e84e6e5d9.zip external_llvm-2c71f18ff7f5e1504ffeff85f643314e84e6e5d9.tar.gz external_llvm-2c71f18ff7f5e1504ffeff85f643314e84e6e5d9.tar.bz2 |
It's safe to sink some instructions which are not safe to speculatively
execute. Make Sink's predicate more precise.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118787 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Transforms/Scalar/Sink.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/Transforms/Scalar/Sink.cpp b/lib/Transforms/Scalar/Sink.cpp index 1aca908..d6f1e93 100644 --- a/lib/Transforms/Scalar/Sink.cpp +++ b/lib/Transforms/Scalar/Sink.cpp @@ -169,7 +169,10 @@ static bool isSafeToMove(Instruction *Inst, AliasAnalysis *AA, return false; } - return Inst->isSafeToSpeculativelyExecute(); + if (isa<TerminatorInst>(Inst) || isa<PHINode>(Inst)) + return false; + + return true; } /// SinkInstruction - Determine whether it is safe to sink the specified machine |