[PATCH] D15340: Separate CSRs into a subset handled via explicit copies and a subset handled by prologue/epilogue

Quentin Colombet via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 10 09:40:26 PST 2015


> On Dec 10, 2015, at 9:32 AM, Manman Ren <manman.ren at gmail.com> wrote:
> 
> manmanren added a comment.
> 
> In http://reviews.llvm.org/D15340#307215, @qcolombet wrote:
> 
>> Hi Manman,
>> 
>> Thanks for doing this!
>> 
>> A quick comment, would it be possible to have a command line option to force the use of this special handling as a follow-up patch?
> 
> 
> It depends on what the command line option will do :]

What I had in mind was something that handles all the CSRs via copies. I.e., it basically gets rid of the CSR concept from the reg alloc point of view and you just happen to spill/copy them if the related live ranges need to go through a call.
That may not be a straight forward follow-up patch now that I think about it.

> 
> The implementation currently only works for CXX_FAST_TLS and we can probably generalize it to other calling conventions.
> Also as pointed out by Hal in AArch64 patch (http://reviews.llvm.org/D15341), we may need to update that patch to handle unwinding by inserting cfi directives.

For testing purposes, I am fine with incorrect unwinding information :).

> 
>> It’s been a while I’d like to make some measurements to check how interesting this approach would be compared to our current handling of CSRs in reg alloc.
> 
> 
> Is there any special handling of CSRs in reg alloc? I remember from a while back that we only add a penalty for first usage of a CSR.

That is correct, but I still don’t like it and the sense that only CSRs get this processing.

Cheers,
Q.

> 
> Thank you for reviewing!
> Manman
> 
>> Thanks again!
> 
>> Q.
> 
> 
> 
> http://reviews.llvm.org/D15340
> 
> 
> 



More information about the llvm-commits mailing list