summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Scalar
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
commitc3b4ea7b7d7e1c6f2e29ef3c85f798d94741111a (patch)
tree81a4d704481f0a84b1c53a314d454f3f30db00b6 /llvm/lib/Transforms/Scalar
parentaeed5fe6a271e459cc19aa77428a2fc4f8f2ec2b (diff)
downloadbcm5719-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/Transforms/Scalar')
-rw-r--r--llvm/lib/Transforms/Scalar/Sink.cpp5
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
OpenPOWER on IntegriCloud