<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=""><br class=""><div><blockquote type="cite" class=""><div class="">On Aug 23, 2016, at 2:07 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 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.<br class=""></p></div></div></blockquote><div>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.</div><blockquote type="cite" class=""><div class=""><div class=""><p 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.<br class=""></p></div></div></blockquote><div>You have to remember the number somewhere, so you can use CopyFromReg on the vreg.</div><div><br class=""></div><div>- Matthias</div><div><br class=""></div></div></body></html>