<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">This is probably the first target building PHIs in the selection DAG, but I don't see a reason why it wouldn't work.</div><div class=""><br class=""></div><div class="">- Matthias</div><br class=""><div><blockquote type="cite" class=""><div class="">On Aug 23, 2016, at 2:35 PM, Tyler Kenney <<a href="mailto:tjkenney@us.ibm.com" class="">tjkenney@us.ibm.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class=""><p class="">So if I first create the value in an entry BB and then build a CopyToReg but then I have to read it in a BB that loops back to itself, with it's own CopyToReg at the end, then I have two CopyToReg nodes for the same value. In this case, I need to create 3 virt regs, 1 for each CopyToReg and a third for the CopyFromReg in the beginning of the loop BB, right? And then I need to build a PHI instruction at the beginning of the loop MBB that relates the 3 virt regs, right? Is there anything else I need to do regarding the creation of the new phi instruction, do you know?<br class=""><br class="">Tyler<br class=""><br class=""><br class=""><span id="cid:1__=0ABB0A8BDFE5AA848f9e8a93df938690918c0AB@"><graycol.gif></span><font color="#424282" class="">Matthias Braun ---08/23/2016 05:17:14 PM---> On Aug 23, 2016, at 2:07 PM, Tyler Kenney <<a href="mailto:tjkenney@us.ibm.com" class="">tjkenney@us.ibm.com</a>> wrote: ></font><br class=""><br class=""><font size="2" color="#5F5F5F" class="">From:        </font><font size="2" class="">Matthias Braun <<a href="mailto:mbraun@apple.com" class="">mbraun@apple.com</a>></font><br class=""><font size="2" color="#5F5F5F" class="">To:        </font><font size="2" class="">Tyler Kenney/Marlborough/IBM@IBMUS</font><br class=""><font size="2" color="#5F5F5F" class="">Cc:        </font><font size="2" class=""><a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a></font><br class=""><font size="2" color="#5F5F5F" class="">Date:        </font><font size="2" class="">08/23/2016 05:17 PM</font><br class=""><font size="2" color="#5F5F5F" class="">Subject:        </font><font size="2" class="">Re: [llvm-dev] Help in understanding physreg LiveVariables</font><br class=""><font size="2" color="#5F5F5F" class="">Sent by:        </font><font size="2" class=""><a href="mailto:mbraun@apple.com" class="">mbraun@apple.com</a></font><br class=""></p><hr width="100%" size="2" align="left" noshade="" style="color:#8091A5; " class=""><br class=""><br class=""><br class="">
<ul class=""><ul class=""><font size="4" class="">On Aug 23, 2016, at 2:07 PM, Tyler Kenney <</font><a href="mailto:tjkenney@us.ibm.com" class=""><u class=""><font size="4" color="#0000FF" class="">tjkenney@us.ibm.com</font></u></a><font size="4" class="">> wrote:</font><br class=""><p class=""><font size="4" class="">So if I create a value with a DAG.getUndef(myVT); call during instruction legalization, how can I access that value as input in another BB/DAG (also during instruction legalization) without worrying about live-ins and/or phi nodes? <br class=""><br class="">Can I create a single virtual register and build both a CopyToReg and a CopyFromReg node with it? I assumed that would break SSA.</font></p></ul></ul><font size="4" class="">Yes in Selection to you need to use CopyToReg/CoptFromReg to write to/from vregs that should cross basic blocks. Yes indeed this currently has to respect SSA form, so there should only be a single CopyToReg for each vreg and that def should dominate all users.</font><ul class=""><ul class=""><font size="4" class=""><br class="">Perhaps I should have said that what stops me is that I don't know how to pass a newly created virtual register from one MBB/DAG to another.</font></ul></ul><font size="4" class="">You have to remember the number somewhere, so you can use CopyFromReg on the vreg.</font><br class=""><br class=""><font size="4" class="">- Matthias</font><br class=""><br class=""><br class="">
</div>
</div></blockquote></div><br class=""></body></html>