[LLVMdev] How to Allocate a Variable to a Specific register

Quentin Colombet qcolombet at apple.com
Fri Mar 13 11:02:00 PDT 2015

Hi Avinash,

Could you give more details on what you are trying to achieve?

> On Mar 12, 2015, at 11:52 PM, Avinash Bole <boleavinash at gmail.com> wrote:
> Hi,
> Im trying to allocate registers for given code..,and my requirement is to allocate a specific register to a given variable( ex:  int a ; // I want to allocate register R1 to a). 
> I think one way to do this is by writing an llvm pass as described here <http://llvm.org/docs/WritingAnLLVMPass.html#the-machinefunctionpass-class>. But im not sure it will work..,Another way i thought of is to change Allocation order in "AltOrder" in "xxxRegisterInfo.td". This worked for 1 variable..,but if i have two or more variables and more registers.,i cant get the exact register i want for the exact variable. 
> Please suggest me a way to do this.
> Also..,Is there a way to check contents of each "bit" in a register?
> Thanks,
> Avinash
> _______________________________________________
> 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/20150313/c796a536/attachment.html>

More information about the llvm-dev mailing list