forked from OSchip/llvm-project
AMDGPU/GlobalISel: Work around a selector crash
Ideally types without a corresponding register class wouldn't reach here, but we're currently missing some (in particular a 192-bit class is missing).
This commit is contained in:
parent
2bcbf1319e
commit
588bd7be36
|
@ -1627,6 +1627,8 @@ bool AMDGPUInstructionSelector::selectG_TRUNC(MachineInstr &I) const {
|
|||
= TRI.getRegClassForSizeOnBank(SrcSize, *SrcRB, *MRI);
|
||||
const TargetRegisterClass *DstRC
|
||||
= TRI.getRegClassForSizeOnBank(DstSize, *DstRB, *MRI);
|
||||
if (!SrcRC || !DstRC)
|
||||
return false;
|
||||
|
||||
if (!RBI.constrainGenericRegister(SrcReg, *SrcRC, *MRI) ||
|
||||
!RBI.constrainGenericRegister(DstReg, *DstRC, *MRI)) {
|
||||
|
|
Loading…
Reference in New Issue