[amdgpu] Lower SGPR-to-VGPR copy in the final phase of ISel.
authorMichael Liao <michael.hliao@gmail.com>
Wed, 9 Sep 2020 20:48:03 +0000 (16:48 -0400)
committerMichael Liao <michael.hliao@gmail.com>
Thu, 17 Sep 2020 15:04:17 +0000 (11:04 -0400)
commitc3492a1aa1b98c8d81b0969d52cea7681f0624c2
tree7020da70f62be8bdf685204f82ae477cd9cb789b
parent34b27b9441d27ef886ea22b3bb75b357a5ec707b
[amdgpu] Lower SGPR-to-VGPR copy in the final phase of ISel.

- Need to lower COPY from SGPR to VGPR to a real instruction as the
  standard COPY is used where the source and destination are from the
  same register bank so that we potentially coalesc them together and
  save one COPY. Considering that, backend optimizations, such as CSE,
  won't handle them. However, the copy from SGPR to VGPR always needs
  materializing to a native instruction, it should be lowered into a
  real one before other backend optimizations.

Differential Revision: https://reviews.llvm.org/D87556
llvm/lib/Target/AMDGPU/SIFoldOperands.cpp
llvm/lib/Target/AMDGPU/SIISelLowering.cpp
llvm/test/CodeGen/AMDGPU/fabs.ll
llvm/test/CodeGen/AMDGPU/fneg-fabs.ll
llvm/test/CodeGen/AMDGPU/sgpr-copy-cse.ll [new file with mode: 0644]
llvm/test/CodeGen/AMDGPU/waitcnt-vscnt.ll
llvm/test/CodeGen/AMDGPU/wqm.ll