Might be nice to share the logic with Sink.cpp, I guess it would hinge on an appropriate name for a predicate.<br><br>On Monday, October 26, 2015, escha via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">escha created this revision.<br>
escha added reviewers: resistor, arsenm.<br>
escha added a subscriber: llvm-commits.<br>
escha set the repository for this revision to rL LLVM.<br>
<br>
Repository:<br>
rL LLVM<br>
<br>
<a href="http://reviews.llvm.org/D14056" target="_blank">http://reviews.llvm.org/D14056</a><br>
<br>
Files:<br>
lib/Transforms/InstCombine/InstructionCombining.cpp<br>
<br>
Index: lib/Transforms/InstCombine/InstructionCombining.cpp<br>
===================================================================<br>
--- lib/Transforms/InstCombine/InstructionCombining.cpp<br>
+++ lib/Transforms/InstCombine/InstructionCombining.cpp<br>
@@ -2681,6 +2681,12 @@<br>
&DestBlock->getParent()->getEntryBlock())<br>
return false;<br>
<br>
+ // Do not sink convergent call instructions.<br>
+ if (auto *CI = dyn_cast<CallInst>(I)) {<br>
+ if (CI->isConvergent())<br>
+ return false;<br>
+ }<br>
+<br>
// We can only sink load instructions if there is nothing between the load and<br>
// the end of block that could change the value.<br>
if (I->mayReadFromMemory()) {<br>
<br>
<br>
</blockquote>