[AMDGPU] Use isMetaInstruction for instruction size
authorSebastian Neubauer <sebastian.neubauer@amd.com>
Thu, 15 Jul 2021 08:21:33 +0000 (10:21 +0200)
committerSebastian Neubauer <sebastian.neubauer@amd.com>
Thu, 15 Jul 2021 10:23:11 +0000 (12:23 +0200)
Meta instructions have a size of 0. Use isMetaInstruction instead of
listing them explicitly.

Differential Revision: https://reviews.llvm.org/D106043

llvm/lib/Target/AMDGPU/SIInstrInfo.cpp

index af276c6..d24b6d8 100644 (file)
@@ -7196,11 +7196,6 @@ unsigned SIInstrInfo::getInstSizeInBytes(const MachineInstr &MI) const {
   }
 
   switch (Opc) {
-  case TargetOpcode::IMPLICIT_DEF:
-  case TargetOpcode::KILL:
-  case TargetOpcode::DBG_VALUE:
-  case TargetOpcode::EH_LABEL:
-    return 0;
   case TargetOpcode::BUNDLE:
     return getInstBundleSize(MI);
   case TargetOpcode::INLINEASM:
@@ -7210,6 +7205,8 @@ unsigned SIInstrInfo::getInstSizeInBytes(const MachineInstr &MI) const {
     return getInlineAsmLength(AsmStr, *MF->getTarget().getMCAsmInfo(), &ST);
   }
   default:
+    if (MI.isMetaInstruction())
+      return 0;
     return DescSize;
   }
 }