[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
Tue Oct 2 17:02:24 PDT 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rL343648: [AMDGPU] Assert in getOpSize() there are no sub-dword subregs (authored by rampitec, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D52769?vs=167883&id=168056#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D52769

Files:
  llvm/trunk/lib/Target/AMDGPU/SIInstrInfo.h


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;
   }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D52769.168056.patch
Type: text/x-patch
Size: 903 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181003/bf33dca9/attachment.bin>


More information about the llvm-commits mailing list