[AMDGPU] Always reserve flat scratch SGPR for architected flat scratch
authorStanislav Mekhanoshin <Stanislav.Mekhanoshin@amd.com>
Fri, 24 Sep 2021 00:34:13 +0000 (17:34 -0700)
committerStanislav Mekhanoshin <Stanislav.Mekhanoshin@amd.com>
Fri, 24 Sep 2021 16:46:31 +0000 (09:46 -0700)
commit082e22f3d72bd63f9b388d5566064cf3736da511
treec6d6a6ca1ec604ed00a898f064bc5f29a2dbc658
parent5988a3b7a09126aff982944ecb36f533c450388e
[AMDGPU] Always reserve flat scratch SGPR for architected flat scratch

With architected flat scratch it becomes readonly. We must always
reserve SGPR pair for it even if we do not use scratch at all since
an attempt to write to SGPRs mapped to FLAT_SCRATCH results in
memory violation.

This is not needed since GFX10 with architected flat scratch though
since special SGPRs are not carving space from normal SGPRs.

Differential Revision: https://reviews.llvm.org/D110376
llvm/lib/Target/AMDGPU/AMDGPUSubtarget.cpp
llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp
llvm/test/CodeGen/AMDGPU/flat-scratch-reg.ll