<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">ryta1203@gmail.com</a>></span><br>Date: Mon, Feb 6, 2012 at 10:36 AM<br>
Subject: Re: [LLVMdev] Updating PHI for Instruction Domination?<br>To: Eric Christopher <<a href="mailto:echristo@apple.com">echristo@apple.com</a>><br><br><br>Since I'm not sure which instructions I might want to replicate, would it be possible to cast the Value from "PHINode::getIncomingValue" to "Instruction" and then copy that and cast it back?<div class="HOEnZb">
<div class="h5"><br><br>
<div class="gmail_quote">On Sun, Feb 5, 2012 at 8:49 PM, Ryan Taylor <span dir="ltr"><<a href="mailto:ryta1203@gmail.com" target="_blank">ryta1203@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div><div><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" target="_blank">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><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><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><font color="#888888"><br>
-eric<br>
</font></span></blockquote></div><div> </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>


</blockquote></div><br>
</div></div></div><br>