AMDGPU/GlobalISel: Fall back on weird G_EXTRACT offsets

llvm-svn: 373842
This commit is contained in:
Matt Arsenault 2019-10-06 01:41:22 +00:00
parent 786a3953ba
commit e59296a051
1 changed files with 5 additions and 2 deletions

View File

@ -434,8 +434,11 @@ bool AMDGPUInstructionSelector::selectG_UADDO_USUBO(MachineInstr &I) const {
bool AMDGPUInstructionSelector::selectG_EXTRACT(MachineInstr &I) const {
MachineBasicBlock *BB = I.getParent();
assert(I.getOperand(2).getImm() % 32 == 0);
unsigned SubReg = TRI.getSubRegFromChannel(I.getOperand(2).getImm() / 32);
unsigned Offset = I.getOperand(2).getImm();
if (Offset % 32 != 0)
return false;
unsigned SubReg = TRI.getSubRegFromChannel(Offset / 32);
const DebugLoc &DL = I.getDebugLoc();
MachineInstr *Copy = BuildMI(*BB, &I, DL, TII.get(TargetOpcode::COPY),
I.getOperand(0).getReg())