[llvm-dev] XMMs unused

Stephen Canon via llvm-dev llvm-dev at lists.llvm.org
Fri Nov 2 10:50:07 PDT 2018


> On Nov 2, 2018, at 1:29 PM, Matthias Braun via llvm-dev <llvm-dev at lists.llvm.org> wrote:
> 
>> On Nov 2, 2018, at 5:44 AM, Dangeti Tharun kumar <cs15mtech11002 at iith.ac.in <mailto:cs15mtech11002 at iith.ac.in>> wrote:
>> 
>> 
>> 
>> On Fri, Nov 2, 2018 at 3:31 PM Anton Korobeynikov <anton at korobeynikov.info <mailto:anton at korobeynikov.info>> wrote:
>> > Yes, I am compiling for linux system.
>> > So the RA will not consider assigning a scratch register to a live range crossing function call, though it may reduce spills?
>> Well, it has to spill the register – otherwise it could be clobbered by a call. 
>> May be, I haven't conveyed it properly. What I mean was, does the RA make an analysis of spills incurred by using a scratch register and spilled/restored across the call site and by not using the scratch register at all ?
> 
> As far as I read the calling conventions for linux/mac there isn't a single callee saved XMM register, so there is not XMM register for which this would work:
> 
> %XMMx = ...
> callq ...  # <= this may change the value of XMMx
> use %XMMx


Right, this is definitely the case with the system calling conventions. LLVM *can* do this if you declare the called function as using a different calling convention, like __attribute__((preserve_all)).

– Steve
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20181102/a0192a7a/attachment.html>


More information about the llvm-dev mailing list