[llvm-dev] Help in understanding physreg LiveVariables

Matthias Braun via llvm-dev llvm-dev at lists.llvm.org
Tue Aug 23 14:17:07 PDT 2016


> On Aug 23, 2016, at 2:07 PM, Tyler Kenney <tjkenney at us.ibm.com> wrote:
> 
> 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? 
> 
> Can I create a single virtual register and build both a CopyToReg and a CopyFromReg node with it? I assumed that would break SSA.
> 
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.
> 
> 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.
> 
You have to remember the number somewhere, so you can use CopyFromReg on the vreg.

- Matthias

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160823/632e72d0/attachment.html>


More information about the llvm-dev mailing list