<div dir="ltr">ok thanks.<div><br></div><div>David</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Oct 31, 2017 at 2:37 PM, Florian Hahn via Phabricator <span dir="ltr"><<a href="mailto:reviews@reviews.llvm.org" target="_blank">reviews@reviews.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">fhahn added inline comments.<br>
<span class=""><br>
<br>
================<br>
Comment at: lib/Transforms/Utils/<wbr>CodeExtractor.cpp:312<br>
</span><span class="">+       PI != PE;) {<br>
+    BasicBlock *Pred = *PI++;<br>
     if (Blocks.count(Pred))<br>
</span>----------------<br>
<span class="">davidxl wrote:<br>
> Move ++ into the for clause?<br>
</span>I think we have to increment the iterator at the beginning of the loop, as replaceUsesOfWith may remove the element PI references and then the iterator would become invalid and `Transforms/CodeExtractor/<wbr>live_shrink_hoist.ll` crashes.<br>
<br>
<br>
<a href="https://reviews.llvm.org/D39112" rel="noreferrer" target="_blank">https://reviews.llvm.org/<wbr>D39112</a><br>
<br>
<br>
<br>
</blockquote></div><br></div>