Skip to content

Commit

Permalink
AMDGPU/GlobalISel: Fall back on weird G_EXTRACT offsets
Browse files Browse the repository at this point in the history
llvm-svn: 373842
  • Loading branch information
arsenm committed Oct 6, 2019
1 parent 786a395 commit e59296a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions llvm/lib/Target/AMDGPU/AMDGPUInstructionSelector.cpp
Expand Up @@ -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())
Expand Down

0 comments on commit e59296a

Please sign in to comment.