diff options
author | Christudasan Devadasan <Christudasan.Devadasan@amd.com> | 2022-04-14 19:39:59 +0530 |
---|---|---|
committer | Christudasan Devadasan <Christudasan.Devadasan@amd.com> | 2022-12-17 11:56:32 +0530 |
commit | 40ba0942e2ab1107f83aa5a0ee5ae2980bf47b1a (patch) | |
tree | 4bc59be33131c3d3e9981e324480d7ce14264fd1 /clang/lib/Lex/ModuleMap.cpp | |
parent | b5efec4b27bf5451a4fae74973f7a7a28fbc6108 (diff) | |
download | llvm-40ba0942e2ab1107f83aa5a0ee5ae2980bf47b1a.zip llvm-40ba0942e2ab1107f83aa5a0ee5ae2980bf47b1a.tar.gz llvm-40ba0942e2ab1107f83aa5a0ee5ae2980bf47b1a.tar.bz2 |
[AMDGPU][SILowerSGPRSpills] Spill SGPRs to virtual VGPRs
Currently, the custom SGPR spill lowering pass spills
SGPRs into physical VGPR lanes and the remaining VGPRs
are used by regalloc for vector regclass allocation.
This imposes many restrictions that we ended up with
unsuccessful SGPR spilling when there won't be enough
VGPRs and we are forced to spill the leftover into
memory during PEI. The custom spill handling during PEI
has many edge cases and often breaks the compiler time
to time.
This patch implements spilling SGPRs into virtual VGPR
lanes. Since we now split the register allocation for
SGPRs and VGPRs, the virtual registers introduced for
the spill lanes would get allocated automatically in
the subsequent regalloc invocation for VGPRs.
Spill to virtual registers will always be successful,
even in the high-pressure situations, and hence it avoids
most of the edge cases during PEI. We are now left with
only the custom SGPR spills during PEI for special registers
like the frame pointer which isn an unproblematic case.
This patch also implements the whole wave spills which
might occur if RA spills any live range of virtual registers
involved in the whole wave operations. Earlier, we had
been hand-picking registers for such machine operands.
But now with SGPR spills into virtual VGPR lanes, we are
exposing them to the allocator.
Reviewed By: arsenm
Differential Revision: https://reviews.llvm.org/D124196
Diffstat (limited to 'clang/lib/Lex/ModuleMap.cpp')
0 files changed, 0 insertions, 0 deletions