diff options
author | Owen Anderson <resistor@mac.com> | 2015-10-09 18:06:13 +0000 |
---|---|---|
committer | Owen Anderson <resistor@mac.com> | 2015-10-09 18:06:13 +0000 |
commit | d95b08a0a72ef47268b94738360c9319dcdc4772 (patch) | |
tree | d54e64de26d1882bfd24227d20d92290cff4a0cb /llvm/lib/Transforms/Scalar/Sink.cpp | |
parent | c7b054a60cc1dc5c972b29ee694e7bbf8d186d22 (diff) | |
download | bcm5719-llvm-d95b08a0a72ef47268b94738360c9319dcdc4772.tar.gz bcm5719-llvm-d95b08a0a72ef47268b94738360c9319dcdc4772.zip |
Refine the definition of convergent to only disallow the addition of new control dependencies.
This covers the common case of operations that cannot be sunk.
Operations that cannot be hoisted should already be handled properly via
the safe-to-speculate rules and mechanisms.
llvm-svn: 249865
Diffstat (limited to 'llvm/lib/Transforms/Scalar/Sink.cpp')
-rw-r--r-- | llvm/lib/Transforms/Scalar/Sink.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Scalar/Sink.cpp b/llvm/lib/Transforms/Scalar/Sink.cpp index adc53b17bdf..17a6858a0c0 100644 --- a/llvm/lib/Transforms/Scalar/Sink.cpp +++ b/llvm/lib/Transforms/Scalar/Sink.cpp @@ -172,7 +172,8 @@ static bool isSafeToMove(Instruction *Inst, AliasAnalysis *AA, if (isa<TerminatorInst>(Inst) || isa<PHINode>(Inst)) return false; - // Convergent operations can only be moved to control equivalent blocks. + // Convergent operations cannot be made control-dependent on additional + // values. if (auto CS = CallSite(Inst)) { if (CS.hasFnAttr(Attribute::Convergent)) return false; |