From: Fiona Glaser Date: Tue, 3 Nov 2015 22:23:39 +0000 (+0000) Subject: InstCombine: fix sinking of convergent calls X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=0b7ecee988cd936b92e191fba248e72a8e936ccf;p=oota-llvm.git InstCombine: fix sinking of convergent calls git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251991 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Transforms/InstCombine/InstructionCombining.cpp b/lib/Transforms/InstCombine/InstructionCombining.cpp index b51ec291f91..ac535f97bb1 100644 --- a/lib/Transforms/InstCombine/InstructionCombining.cpp +++ b/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(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()) {