[llvm] r251991 - InstCombine: fix sinking of convergent calls
Fiona Glaser via llvm-commits
llvm-commits at lists.llvm.org
Tue Nov 3 14:23:40 PST 2015
Author: escha
Date: Tue Nov 3 16:23:39 2015
New Revision: 251991
URL: http://llvm.org/viewvc/llvm-project?rev=251991&view=rev
Log:
InstCombine: fix sinking of convergent calls
Modified:
llvm/trunk/lib/Transforms/InstCombine/InstructionCombining.cpp
Modified: llvm/trunk/lib/Transforms/InstCombine/InstructionCombining.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/InstCombine/InstructionCombining.cpp?rev=251991&r1=251990&r2=251991&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/InstCombine/InstructionCombining.cpp (original)
+++ llvm/trunk/lib/Transforms/InstCombine/InstructionCombining.cpp Tue Nov 3 16:23:39 2015
@@ -2694,6 +2694,12 @@ static bool TryToSinkInstruction(Instruc
&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()) {
More information about the llvm-commits
mailing list