[llvm] r176868 - Don't reserve R2 on Darwin/PPC

Hal Finkel hfinkel at anl.gov
Thu Mar 14 08:58:15 PDT 2013


----- Original Message -----
> From: "Peter Bergner" <bergner at vnet.ibm.com>
> To: "Hal Finkel" <hfinkel at anl.gov>
> Cc: llvm-commits at cs.uiuc.edu
> Sent: Thursday, March 14, 2013 10:46:05 AM
> Subject: Re: [llvm] r176868 - Don't reserve R2 on Darwin/PPC
> 
> On Tue, 2013-03-12 at 15:18 +0000, Hal Finkel wrote:
> > Darwin can use R0 as a spare register in any case where the
> > System V ABI uses it (R0 is special architecturally, and so
> > is reserved under all common ABIs).
> 
> To be pedantic, r0 is special architecturally, but I know the
> Linux ABIs (ppc32 and ppc64) do not reserve it and it is used
> by the GCC register allocater like any other volatile register,
> with the caveat that it cannot be used as a base register in
> load/store insns, etc.  Does LLVM really disallow its use
> during RA?

Thanks for clarifying! Yes. LLVM currently excludes it from use during normal RA (under all ABIs). Fixing the RA part is probably not hard (we'd define a restricted register class that contained all GPRs except R0, and define the loads/stores, etc. in terms of that register class). More difficult would be that the spill code currently assumes that it is available, and the current register scavenger implementation can only guarantee one register (and sometimes we need two: r0 + another one). In short, this can also be fixed, but will require some infrastructure work.

 -Hal

> 
> Peter
> 
> 
> 



More information about the llvm-commits mailing list