[llvm-commits] [PATCH] Enable use of SPARC g2-g4 global registers

Chris Lattner clattner at apple.com
Mon Jul 18 12:07:36 PDT 2011


On Jul 18, 2011, at 11:22 AM, Martin Whitaker wrote:

> Ping.
> 
> Could someone familiar with SPARC comment?
> 
> Revised patch (following Jakob's comments and subsequent discussion) attached again.

I guess I'm the closest thing to a sparc maintainer that we have, but I haven't used a sparc for ~8 years now.  The patch is fine with me, would you like to be the new sparc maintainer? :)

-Chris

> 
> Martin
> 
> Jakob Stoklund Olesen wrote:
>> 
>> On Jul 11, 2011, at 12:24 PM, Martin Whitaker wrote:
>> 
>>> This patch adds a SPARC code generator feature that allows the code generator to optionally use the global registers that are reserved for application use by the SPARC ABI (g2,g3,g4).
>>> 
>>> It also changes the preferred register allocation order to give preference to the global and input registers, to increase the chances of being able to eliminate the frame save/restore in leaf functions (when that optimisation is added). I'm doing this now because it also makes the regression test for this patch simpler (and less likely to break in the future).
>>> 
>>> Please review.
>> 
>> There register stuff looks good to me, but someone who is familiar with SPARC should comment.
>> 
>> +define void @test(i32* %ptr) nounwind {
>> +entry:
>> +; CHECK_N: ld [%i0], %i3
>> +; CHECK_N: ld [%i0], %i2
>> +; CHECK_N: ld [%i0], %i1
>> +; CHECK_Y: ld [%i0], %g4
>> +; CHECK_Y: ld [%i0], %g3
>> +; CHECK_Y: ld [%i0], %g2
>> 
>> Please don't write tests that depend on the exact details of register allocation. There is no reason these registers would be allocated in exactly that order.
>> 
>> Check for the absence or presence of frame save/restore code instead.
>> 
>> /jakob
>> 
> 
> <0001-Enable-use-of-SPARC-g2-g4-global-registers.patch>_______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits




More information about the llvm-commits mailing list