[PATCH] D52769: [AMDGPU] Assert in getOpSize() there are no sub-dword subregs
Stanislav Mekhanoshin via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Oct 1 22:41:39 PDT 2018
rampitec created this revision.
rampitec added a reviewer: arsenm.
Herald added subscribers: t-tye, tpr, dstuttard, yaxunl, nhaehnle, wdng, jvesely, kzhuravl.
https://reviews.llvm.org/D52769
Files:
lib/Target/AMDGPU/SIInstrInfo.h
Index: lib/Target/AMDGPU/SIInstrInfo.h
===================================================================
--- lib/Target/AMDGPU/SIInstrInfo.h
+++ 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;
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D52769.167883.patch
Type: text/x-patch
Size: 870 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181002/66f8870b/attachment.bin>
More information about the llvm-commits
mailing list