[llvm] r358389 - [TableGen] Include schedule model name in diagnostic.

Simon Tatham via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 15 03:06:26 PDT 2019


Author: statham
Date: Mon Apr 15 03:06:26 2019
New Revision: 358389

URL: http://llvm.org/viewvc/llvm-project?rev=358389&view=rev
Log:
[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

Added:
    llvm/trunk/test/TableGen/SchedModelError.td
Modified:
    llvm/trunk/utils/TableGen/CodeGenSchedule.cpp

Added: llvm/trunk/test/TableGen/SchedModelError.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/TableGen/SchedModelError.td?rev=358389&view=auto
==============================================================================
--- llvm/trunk/test/TableGen/SchedModelError.td (added)
+++ llvm/trunk/test/TableGen/SchedModelError.td Mon Apr 15 03:06:26 2019
@@ -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, []>;

Modified: llvm/trunk/utils/TableGen/CodeGenSchedule.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/CodeGenSchedule.cpp?rev=358389&r1=358388&r2=358389&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/CodeGenSchedule.cpp (original)
+++ llvm/trunk/utils/TableGen/CodeGenSchedule.cpp Mon Apr 15 03:06:26 2019
@@ -1935,7 +1935,8 @@ void CodeGenSchedModels::checkCompletene
         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;




More information about the llvm-commits mailing list