summaryrefslogtreecommitdiff
path: root/lib/Transforms/Scalar/Sink.cpp
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2010-11-11 16:20:28 +0000
committerDan Gohman <gohman@apple.com>2010-11-11 16:20:28 +0000
commit2c71f18ff7f5e1504ffeff85f643314e84e6e5d9 (patch)
treef1ebc827ec4e859bf3d88a321bd660072bf2fd03 /lib/Transforms/Scalar/Sink.cpp
parente7ae70b137f9944da30494a45dc660fa60b80b66 (diff)
downloadllvm-2c71f18ff7f5e1504ffeff85f643314e84e6e5d9.tar.gz
llvm-2c71f18ff7f5e1504ffeff85f643314e84e6e5d9.tar.bz2
llvm-2c71f18ff7f5e1504ffeff85f643314e84e6e5d9.tar.xz
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
Diffstat (limited to 'lib/Transforms/Scalar/Sink.cpp')
-rw-r--r--lib/Transforms/Scalar/Sink.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/Transforms/Scalar/Sink.cpp b/lib/Transforms/Scalar/Sink.cpp
index 1aca908267..d6f1e93a81 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