AMDGPU/GlobalISel: Manually RegBankSelect copies
authorMatt Arsenault <Matthew.Arsenault@amd.com>
Thu, 20 Feb 2020 19:00:56 +0000 (14:00 -0500)
committerMatt Arsenault <arsenm2@gmail.com>
Wed, 11 Mar 2020 15:12:12 +0000 (11:12 -0400)
commita2202f6a3f1c596d805755c2221a5b5527a1416b
tree22ccc1ed1d61389b081a63c683514f63b04d029a
parentfc421d7ca3ecc4864c547e587eac4dacd98c33da
AMDGPU/GlobalISel: Manually RegBankSelect copies

This was failng on any pre-assigned copy to the VCC bank.

This is something of a workaround for the default implementation in
getInstrMappingImpl, and how it treats copy-like operations in
general.

Copy-like operations are considered to only have one result register
bank, rather than separate banks for each source like a normal
instruction. To avoid potentially mishandling reg_sequence with
impossible operand combinations, the generic implementation errors on
impossible costs. If the bank was already assigned, is treated it
as-if it were an unsatisfiable REG_SEQUENCE mapping. We really don't
get any value from any of what getInstrMappingImpl tries to do for
copies, so just directly emit the simple mapping we really want.
llvm/lib/Target/AMDGPU/AMDGPURegisterBankInfo.cpp
llvm/test/CodeGen/AMDGPU/GlobalISel/regbankselect-copy.mir [new file with mode: 0644]