<div dir="ltr">You should add an assert (MU->getBlock() == MU->getMemoryInst()->getParent()) and bugpoint it.<div><br></div><div>Are you sure you have moved the instruction at the point you create the access?<br>It pulls the block from instruction->getParent() at that point :)</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jul 29, 2016 at 9:32 PM, Sebastian Pop <span dir="ltr"><<a href="mailto:sebpop@gmail.com" target="_blank">sebpop@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">sebpop added inline comments.<br>
<br>
================<br>
Comment at: lib/Transforms/Scalar/GVNHoist.cpp:311<br>
@@ -314,1 +310,3 @@<br>
<span class="">+        // FIXME: MU->getBlock() does not get updated when we move the instruction.<br>
+        BasicBlock *UBB = MU->getMemoryInst()->getParent();<br>
         // Only analyze uses in BB.<br>
</span>----------------<br>
Note that if I remove this change there are tests in the test-suite that fail.  I will reduce a testcase for this.<br>
<br>
<br>
<a href="https://reviews.llvm.org/D22966" rel="noreferrer" target="_blank">https://reviews.llvm.org/D22966</a><br>
<br>
<br>
<br>
</blockquote></div><br></div>