From: Simon Tatham Date: Mon, 15 Apr 2019 10:06:26 +0000 (+0000) Subject: [TableGen] Include schedule model name in diagnostic. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a2f0069dea7e66d268af1133ed533c1e06399439;p=llvm [TableGen] Include schedule model name in diagnostic. If you have more than one schedule model in your TableGen target definitions, then the diagnostic "No schedule information for instruction 'foo'" is rather unhelpful, because it doesn't tell you _which_ schedule model is missing the necessary information (or, as it might be, missing the UnsupportedFeatures definition that would stop it thinking it needed it). Extended the message to include the name of the schedule model that it's complaining about. Reviewers: nhaehnle, hfinkel, javedabsar, efriedma, javed.absar Reviewed By: javed.absar Subscribers: javed.absar, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D60559 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@358389 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/TableGen/SchedModelError.td b/test/TableGen/SchedModelError.td new file mode 100644 index 00000000000..237bc459c45 --- /dev/null +++ b/test/TableGen/SchedModelError.td @@ -0,0 +1,18 @@ +// RUN: not llvm-tblgen -gen-subtarget -I %p/../../include %s 2>&1 | FileCheck %s -DFILE=%s + +include "llvm/Target/Target.td" + +def TestTarget : Target; + +// CHECK: [[FILE]]:[[@LINE+1]]:1: error: No schedule information for instruction 'TestInst' in SchedMachineModel 'TestSchedModel' +def TestInst : Instruction { + let OutOperandList = (outs); + let InOperandList = (ins); + bits<8> Inst = 0b00101010; +} + +def TestSchedModel : SchedMachineModel { + let CompleteModel = 1; +} + +def TestProcessor : ProcessorModel<"testprocessor", TestSchedModel, []>; diff --git a/utils/TableGen/CodeGenSchedule.cpp b/utils/TableGen/CodeGenSchedule.cpp index 943e7efa760..fd007044a16 100644 --- a/utils/TableGen/CodeGenSchedule.cpp +++ b/utils/TableGen/CodeGenSchedule.cpp @@ -1935,7 +1935,8 @@ void CodeGenSchedModels::checkCompleteness() { if (Inst->TheDef->isValueUnset("SchedRW") && !HadCompleteModel) { PrintError(Inst->TheDef->getLoc(), "No schedule information for instruction '" + - Inst->TheDef->getName() + "'"); + Inst->TheDef->getName() + "' in SchedMachineModel '" + + ProcModel.ModelDef->getName() + "'"); Complete = false; } continue;