<br><br><div class="gmail_quote">On Sun, Feb 5, 2012 at 5:15 PM, Eric Christopher <span dir="ltr"><<a href="mailto:echristo@apple.com">echristo@apple.com</a>></span> wrote:<br><blockquote style="margin:0px 0px 0px 0.8ex;padding-left:1ex;border-left-color:rgb(204,204,204);border-left-width:1px;border-left-style:solid" class="gmail_quote">
<div class="im"><br>
On Feb 2, 2012, at 5:13 PM, Ryan Taylor wrote:<br>
<br>
> So my best bet is to try and work in reg2mem mode and then go back to mem2reg?<br>
><br>
<br>
</div>I wouldn't. That sounds painful.<br>
<div class="im"><br>
> I'm curious, it seems though when you split a block that the phis get updated, right?<br>
<br>
</div>Sure. There's code in splitBasicBlock to do this. It should just take a little bit of work to get what you want done.<br>
<span class="HOEnZb"><font color="#888888"><br>
-eric<br>
</font></span></blockquote></div><div> </div><div>Yes, the first DOES sound painful (I want to avoid it) and the second is not an option. I'm adding a second path in a loop.</div><div> </div><div>The old path: BB1->BB2/BB3, BB2->BB1/BB3, BB3->n/a</div>
<div> </div><div>The new path: BB1->H/BB2, BB2->F/K, H->F, K->F,  F->BB1/G, G->BB3</div><div> </div><div>There are PHI nodes in BB1 that come in from BB2 for values defined in BB2. With the new possible path: BB1->H->F, BB2. Without adding new PHIs or Values, there exists a dominance instruction issue. So I want to create PHIs in F for each value in BB2 that is used in BB1. The update the PHI Values in BB1 (that used to come from BB2) to the new values in F (which are getting values from BB2/H). </div>
<div><br>The problem is that there is no way to copy the value from BB2, since there exists no Value constructor!? </div><div> </div><div>This seems like a pretty large limitation anytime anyone wants to add a branch inside a loop? Is there an easier way to get what I want that I'm missing?</div>