GlobalISel: Use a callback to compute constrained reg class for unallocatble registers
commit57342fb583a2305d16b1ede55ba9c29fe7a820af
authorTom Stellard <tstellar@redhat.com>
Thu, 3 May 2018 21:44:16 +0000 (3 21:44 +0000)
committerTom Stellard <tstellar@redhat.com>
Thu, 3 May 2018 21:44:16 +0000 (3 21:44 +0000)
treeb696ab47cf0f42bd751aa349e27d801cde36f524
parent3a0c2765857ad8e04935d4469e05927c02bea7a1
GlobalISel: Use a callback to compute constrained reg class for unallocatble registers

Summary:
constrainOperandRegClass() currently fails if it tries to constrain the
register class of an operand that is defeined with an unallocatable register
class.  This patch resolves this by adding a target callback to compute
register constriants in this case.

This is required by the AMDGPU because many of its instructions have source opreands
defined with the unallocatable register classe VS_32 which is a union of two allocatable
register classes VGPR_32 and SReg_32.

Reviewers: dsanders, aditya_nandakumar

Reviewed By: aditya_nandakumar

Subscribers: rovka, kristof.beyls, tpr, llvm-commits

Differential Revision: https://reviews.llvm.org/D45991

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@331485 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/CodeGen/TargetRegisterInfo.h
lib/CodeGen/GlobalISel/Utils.cpp