Index: llvm/trunk/lib/Target/AMDGPU/SIInstrInfo.h =================================================================== --- llvm/trunk/lib/Target/AMDGPU/SIInstrInfo.h +++ llvm/trunk/lib/Target/AMDGPU/SIInstrInfo.h @@ -732,8 +732,13 @@ unsigned getOpSize(const MachineInstr &MI, unsigned OpNo) const { const MachineOperand &MO = MI.getOperand(OpNo); if (MO.isReg()) { - if (unsigned SubReg = MO.getSubReg()) + if (unsigned SubReg = MO.getSubReg()) { + assert(RI.getRegSizeInBits(*RI.getSubClassWithSubReg( + MI.getParent()->getParent()->getRegInfo(). + getRegClass(MO.getReg()), SubReg)) >= 32 && + "Sub-dword subregs are not supported"); return RI.getSubRegIndexLaneMask(SubReg).getNumLanes() * 4; + } } return RI.getRegSizeInBits(*getOpRegClass(MI, OpNo)) / 8; }