[PATCH] D52736: [AMDGPU] Fixed SIInstrInfo::getOpSize to handle subregs

Stanislav Mekhanoshin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 1 11:01:57 PDT 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rL343508: [AMDGPU] Fixed SIInstrInfo::getOpSize to handle subregs (authored by rampitec, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D52736?vs=167771&id=167780#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D52736

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
@@ -730,6 +730,11 @@
   /// This form should usually be preferred since it handles operands
   /// with unknown register classes.
   unsigned getOpSize(const MachineInstr &MI, unsigned OpNo) const {
+    const MachineOperand &MO = MI.getOperand(OpNo);
+    if (MO.isReg()) {
+      if (unsigned SubReg = MO.getSubReg())
+        return RI.getSubRegIndexLaneMask(SubReg).getNumLanes() * 4;
+    }
     return RI.getRegSizeInBits(*getOpRegClass(MI, OpNo)) / 8;
   }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D52736.167780.patch
Type: text/x-patch
Size: 678 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181001/1ccf5158/attachment.bin>


More information about the llvm-commits mailing list