[LLVMdev] Register Allocation of Globals

Chris Lattner sabre at nondot.org
Sun Oct 29 10:18:32 PST 2006


On Sat, 28 Oct 2006, Nikhil Patil wrote:
> Is it possible to bind a physical register to a particular global value? For
> instance, can I say that the global variable %omnipresent should be
> allocated not to memory, but instead to register %EAX.

GCC has an extension to do this (see its user manual) and we support this. 
Note that this does not guarantee that the register will always hold the 
value of the global: the guarantee only holds during inline asm blocks.

-Chris

-- 
http://nondot.org/sabre/
http://llvm.org/



More information about the llvm-dev mailing list