[llvm-dev] [RFC] Spill2Reg: Selectively replace spills to stack with spills to vector registers

Vasileios Porpodas via llvm-dev llvm-dev at lists.llvm.org
Thu Jan 27 13:25:37 PST 2022


Thank you for your comments Craig,
Great point, I will add a check for NoImplicitFloat.
Regarding `-mno-sse`, the pass is currently enabled only if
`X86STI->hasSSE41()` so I guess this is covered.

Vasileios

On Thu, Jan 27, 2022 at 12:12 PM Craig Topper <craig.topper at gmail.com>
wrote:

> On Thu, Jan 27, 2022 at 11:25 AM Vasileios Porpodas via llvm-dev <
> llvm-dev at lists.llvm.org> wrote:
>
>> Hi Momchil,
>> Spill2Reg definitely adds to the FP context, but I am not sure how it
>> would interact with lazy save/restore.
>> Vasileios
>>
>
> The XSAVE instructions allow the OS to skip restoring the XMM registers on
> context switches if they are in their initial state or haven't changed.
> Spilling to XMM registers will make the registers dirty in more cases than
> they might have been otherwise.
>
> That reminds me that this needs to be disabled when the NoImplicitFloat
> attribute is present. One use for NoImplicitFloat is to prevent uses of FP
> and vector registers when compiling OS kernels. If the kernel code doesn't
> change the FP or vector registers, they don't need to be
> saved/restored during system calls. I hope you already took into account
> -mno-sse/-no-sse2.
>
> ~Craig
>
>
>>
>> On Thu, Jan 27, 2022 at 9:34 AM Momchil Velikov <
>> momchil.velikov at gmail.com> wrote:
>>
>>> It's interesting how this interacts with lazy save/restore of the FP
>>> context across context switches.
>>>
>>> ~chill
>>> --
>>> Compiler scrub, Arm
>>>
>> _______________________________________________
>> LLVM Developers mailing list
>> llvm-dev at lists.llvm.org
>> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20220127/1862c7fe/attachment.html>


More information about the llvm-dev mailing list