diff options
| author | Fiona Glaser <escha@apple.com> | 2015-11-03 22:23:39 +0000 |
|---|---|---|
| committer | Fiona Glaser <escha@apple.com> | 2015-11-03 22:23:39 +0000 |
| commit | a8b653a3727156de9c3c5c2c081de2b5ac15b3e8 (patch) | |
| tree | e4b7eca9521bf1811634850808819cfa6ce4cdb6 /llvm/lib | |
| parent | 191ac7c679165618269836e442fe81753a7951c4 (diff) | |
| download | bcm5719-llvm-a8b653a3727156de9c3c5c2c081de2b5ac15b3e8.tar.gz bcm5719-llvm-a8b653a3727156de9c3c5c2c081de2b5ac15b3e8.zip | |
InstCombine: fix sinking of convergent calls
llvm-svn: 251991
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/Transforms/InstCombine/InstructionCombining.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp b/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp index b51ec291f91..ac535f97bb1 100644 --- a/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp +++ b/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp @@ -2694,6 +2694,12 @@ static bool TryToSinkInstruction(Instruction *I, BasicBlock *DestBlock) { &DestBlock->getParent()->getEntryBlock()) return false; + // Do not sink convergent call instructions. + if (auto *CI = dyn_cast<CallInst>(I)) { + if (CI->isConvergent()) + return false; + } + // We can only sink load instructions if there is nothing between the load and // the end of block that could change the value. if (I->mayReadFromMemory()) { |

