[PATCH] D96517: [AMDGPU] Optimize SGPR to scratch spilling

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 25 05:30:17 PST 2021


arsenm added a comment.

In D96517#2587420 <https://reviews.llvm.org/D96517#2587420>, @sebastian-ne wrote:

>> The question is that do we have 30 SGPR spills or we have a spill of SGPR register sequence up to 30 SGPR.
>
> It is 30 separate SGPR spill that happen directly after each other. They are not coalesced currently, but they could be.
>
> The function looks roughly like this:
>
>   100 instructions of saving VGPRs and SGPRs
>   30 real instructions
>   100 instructions of restoring VGPRs and SGPRs
>
> Performance is – as one would expect – not exactly thrilling. There are probably several issues there.

We see the same problem when we have large frame offsets - we end up separately scavenging a register and doing an add for every spill in the sequence to handle the offset. We would probably benefit from adding some kind of spill coalescing before these are lowered


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D96517/new/

https://reviews.llvm.org/D96517



More information about the llvm-commits mailing list