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 | c3b4ea7b7d7e1c6f2e29ef3c85f798d94741111a (patch) | |
| tree | 81a4d704481f0a84b1c53a314d454f3f30db00b6 /llvm/lib | |
| parent | aeed5fe6a271e459cc19aa77428a2fc4f8f2ec2b (diff) | |
| download | bcm5719-llvm-c3b4ea7b7d7e1c6f2e29ef3c85f798d94741111a.tar.gz bcm5719-llvm-c3b4ea7b7d7e1c6f2e29ef3c85f798d94741111a.zip | |
It's safe to sink some instructions which are not safe to speculatively
execute. Make Sink's predicate more precise.
llvm-svn: 118787
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/Transforms/Scalar/Sink.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Scalar/Sink.cpp b/llvm/lib/Transforms/Scalar/Sink.cpp index 1aca908267b..d6f1e93a812 100644 --- a/llvm/lib/Transforms/Scalar/Sink.cpp +++ b/llvm/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 |

