[LLVMdev] mapping a virtual register to a specific address

John Criswell criswell at illinois.edu
Fri Jun 22 12:14:30 PDT 2012


On 6/22/12 2:04 PM, Justin Holewinski wrote:
> On Fri, Jun 22, 2012 at 2:46 PM, amruth.rd <amruth.rd at knights.ucf.edu 
> <mailto:amruth.rd at knights.ucf.edu>> wrote:
>
>
>     Does LLVM allow mapping a virtual register to a specific memory
>     location? If not, how do we extract information on where the
>     virtual registers are mapped to?
>
>
> In general, you do not know where a virtual register is mapped, and 
> the mapping is dependent on the back-end.  It could be allocated or 
> spilled onto the stack, or it may live entirely within a physical 
> register (e.g. no address).

To elaborate on what Justin said, at the LLVM IR level, you don't know 
where a virtual register will live after code generation (or even if it 
will live in the same "place;" the code generator is free to allocate it 
to a register for part of its life and a stack spill slot for another 
part of its life).

You may be able to get this information if you write a MachineFunction 
pass or some other code that is run by LLVM after code generation and 
register allocation (because you can see the generated code).  However, 
I don't know enough about MachineFunction passes to be sure that it's 
possible; that's just where I'd look if I were you.

-- John T.

>
>     Thanks,
>     Amruth
>
>
>
>     _______________________________________________
>     LLVM Developers mailing list
>     LLVMdev at cs.uiuc.edu <mailto:LLVMdev at cs.uiuc.edu>
>     http://llvm.cs.uiuc.edu
>     http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>
>
>
>
> -- 
>
> Thanks,
>
> Justin Holewinski
>
>
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20120622/9f96c415/attachment.html>


More information about the llvm-dev mailing list