So my best bet is to try and work in reg2mem mode and then go back to mem2reg?<br><br>I'm curious, it seems though when you split a block that the phis get updated, right?<br><br><div class="gmail_quote">On Thu, Feb 2, 2012 at 5:05 PM, Eric Christopher <span dir="ltr"><<a href="mailto:echristo@apple.com">echristo@apple.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">Not that I'm aware of.<div><br></div><div>-eric</div><div><br><div><div><div class="h5">
<div>On Feb 2, 2012, at 3:47 PM, Ryan Taylor wrote:</div><br></div></div><blockquote type="cite"><div><div class="h5">So essentially I'm adding a path inside of the loop. Is there a way to have llvm automatically create new IR and update the PHIs simply by adding a block like this and changing the DomTree?<br>
<br><div class="gmail_quote">
---------- Forwarded message ----------<br>From: <b class="gmail_sendername">Ryan Taylor</b> <span dir="ltr"><<a href="mailto:ryta1203@gmail.com" target="_blank">ryta1203@gmail.com</a>></span><br>Date: Thu, Feb 2, 2012 at 12:08 PM<br>

Subject: Updating PHI for Instruction Domination?<br>To: <a href="mailto:llvmdev@cs.uiuc.edu" target="_blank">llvmdev@cs.uiuc.edu</a><br><br><br>So I have a loop with two blocks, a header (which points to return and latch) and a latch (which points to return and header). I have inserted a few new blocks, called H and F. <br>

<br>Header now points to H and latch. Latch now points to F. H points to F. F points to Header and return.<br>
<br>The PHI Nodes have been updated in Header accordingly, now coming from the preheader and F (instead of latch).<br><br>My issue is this: The values in the PHI instruction in the Header for F are actually defined in Latch and so if you follow the path: Header->H->F, there becomes an issue with "Instruction does not dominate all uses" (since the Header PHI is getting values defined in Latch coming from F but never going to Latch) since they haven't been defined in that path.<br>


<br>My question is: Is there some call where I can rearrange the basic blocks and call some functions/utils that solve this issue? Or do I have to manually solve this myself?<br><br>Thanks again.<br>
</div><br></div></div>
_______________________________________________<br>LLVM Developers mailing list<br><a href="mailto:LLVMdev@cs.uiuc.edu" target="_blank">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br></blockquote></div><br></div></div>
</blockquote></div><br>