From afd895709db96f86fe80c4c0980e449f67bdbe9e Mon Sep 17 00:00:00 2001 From: Sebastian Neubauer Date: Thu, 15 Jul 2021 10:21:33 +0200 Subject: [PATCH] [AMDGPU] Use isMetaInstruction for instruction size 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 | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/llvm/lib/Target/AMDGPU/SIInstrInfo.cpp b/llvm/lib/Target/AMDGPU/SIInstrInfo.cpp index af276c6..d24b6d8 100644 --- a/llvm/lib/Target/AMDGPU/SIInstrInfo.cpp +++ b/llvm/lib/Target/AMDGPU/SIInstrInfo.cpp @@ -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; } } -- 2.7.4