[AMDGPU] Make temp vgpr selection stable in indirectCopyToAGPR
authorStanislav Mekhanoshin <Stanislav.Mekhanoshin@amd.com>
Fri, 10 Jun 2022 18:55:10 +0000 (11:55 -0700)
committerStanislav Mekhanoshin <Stanislav.Mekhanoshin@amd.com>
Mon, 13 Jun 2022 16:39:46 +0000 (09:39 -0700)
commit0f81830632c1496bd580aaf671c39c328a4dfca1
tree1ff3a9a54e6e33f9713560989f9f6912b24bbc6d
parent1c84800c42d2183a29392c175c8d5f20a4be65d2
[AMDGPU] Make temp vgpr selection stable in indirectCopyToAGPR

This uses rotating reminder of division by 3 to select another
temp vgpr each next time in a sequence of several agpr copies.
Therefore, temp vgpr selection depends on the generated agpr
number. This number could change with any unrelated change to
the register definitions.

Stabilize the selection by using a real agpr number.

Differential Revision: https://reviews.llvm.org/D127524
llvm/lib/Target/AMDGPU/SIInstrInfo.cpp
llvm/test/CodeGen/AMDGPU/accvgpr-copy.mir
llvm/test/CodeGen/AMDGPU/agpr-copy-no-free-registers.ll