From 4897e263906aa3c88e0a135f18ea9bd2af2676e5 Mon Sep 17 00:00:00 2001 From: Quentin Colombet Date: Wed, 2 Oct 2013 23:11:47 +0000 Subject: [PATCH] [llvm-c][Disassembler] When printing latency information, skip scheduling classes that are marked as Variant as those require an MI to pass to SubTargetInfo::resolveSchedClass. This is part of . git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191864 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/MC/MCDisassembler/Disassembler.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/MC/MCDisassembler/Disassembler.cpp b/lib/MC/MCDisassembler/Disassembler.cpp index 406ee5b7db9..115af8d45b7 100644 --- a/lib/MC/MCDisassembler/Disassembler.cpp +++ b/lib/MC/MCDisassembler/Disassembler.cpp @@ -191,7 +191,9 @@ static int getLatency(LLVMDisasmContext *DC, const MCInst &Inst) { const MCInstrDesc& Desc = DC->getInstrInfo()->get(Inst.getOpcode()); unsigned SCClass = Desc.getSchedClass(); const MCSchedClassDesc *SCDesc = SCModel->getSchedClassDesc(SCClass); - if (!SCDesc || !SCDesc->isValid()) + // Resolving the variant SchedClass requires an MI to pass to + // SubTargetInfo::resolveSchedClass. + if (!SCDesc || !SCDesc->isValid() || SCDesc->isVariant()) return NoInformationAvailable; // Compute output latency. -- 2.34.1