[LLVMdev] Explicit register usage in LLVM assembly

Samuel Crow samuraileumas at yahoo.com
Sat Apr 2 08:26:13 PDT 2011

Hello Yiannis,

You could write a custom backend that doesn't allocate %r15 for general usage. 
 The normal way to do this is to set up a custom calling convention for all 
functions that keeps a sentinel in %r15 so that it always holds the sentinel. 
 This is how new operating systems are supported with custom ABIs.  The only 
problem is that you cannot be assured that %r15 stays put between function calls 
such as for an interrupt.

If you had asked "Is there another EASY way to force explicit register usage?" 
the answer would have been "No."

--Sam Crow

----- Original Message ----
> From: Yiannis Tsiouris <yiannis.tsiouris at gmail.com>
> To: llvmdev at cs.uiuc.edu
> Cc: Chris Stavrakakis <hydralisk.r at gmail.com>
> Sent: Sat, April 2, 2011 9:39:13 AM
> Subject: [LLVMdev] Explicit register usage in LLVM assembly
> Hello!
>      Is there a way to force explicit register usage (e.g.  %r15 in amd64 
> architecture) in
> LLVM assembly code? I was proposed in  #llvm channel at irc.oftc.net to 
> use inline
> assembly but i find it rather impractical in my case. Is  there any other 
> way?
> Thanx,
> ~y.
> _______________________________________________
> LLVM  Developers mailing list
> LLVMdev at cs.uiuc.edu           http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev


More information about the llvm-dev mailing list