[PATCH] D43235: [SchedModel] Complete models shouldn't match against itineraries when they don't use them (PR35639) (WIP)

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 13 06:22:05 PST 2018


RKSimon created this revision.
RKSimon added reviewers: atrick, javed.absar, evgeny777, stefanp, amehsan, uweigand, sdardis, andreadb.
Herald added subscribers: kbarton, nhaehnle, nemanjai, arsenm.

For schedule models that don't use itineraries, checkCompleteness still checks that an instruction has a matching itinerary instead of skipping and going straight to matching the InstRWs. That doesn't seem to match what happens in TargetSchedule.cpp

This patch causes problems for a number of models flagged as complete that I've included for reference/discussion - they mostly seem to be missing psuedos or unsupported features.


Repository:
  rL LLVM

https://reviews.llvm.org/D43235

Files:
  lib/Target/AMDGPU/SISchedule.td
  lib/Target/ARM/ARMScheduleA57.td
  lib/Target/Mips/MipsScheduleGeneric.td
  lib/Target/Mips/MipsScheduleP5600.td
  lib/Target/PowerPC/PPCScheduleP9.td
  utils/TableGen/CodeGenSchedule.cpp


Index: utils/TableGen/CodeGenSchedule.cpp
===================================================================
--- utils/TableGen/CodeGenSchedule.cpp
+++ utils/TableGen/CodeGenSchedule.cpp
@@ -1615,6 +1615,7 @@
   bool Complete = true;
   bool HadCompleteModel = false;
   for (const CodeGenProcModel &ProcModel : procModels()) {
+    const bool HasItineraries = ProcModel.hasItineraries();
     if (!ProcModel.ModelDef->getValueAsBit("CompleteModel"))
       continue;
     for (const CodeGenInstruction *Inst : Target.getInstructionsByEnumValue()) {
@@ -1635,7 +1636,7 @@
       const CodeGenSchedClass &SC = getSchedClass(SCIdx);
       if (!SC.Writes.empty())
         continue;
-      if (SC.ItinClassDef != nullptr &&
+      if (HasItineraries && SC.ItinClassDef != nullptr &&
           SC.ItinClassDef->getName() != "NoItinerary")
         continue;
 
Index: lib/Target/PowerPC/PPCScheduleP9.td
===================================================================
--- lib/Target/PowerPC/PPCScheduleP9.td
+++ lib/Target/PowerPC/PPCScheduleP9.td
@@ -22,7 +22,7 @@
   // Try to make sure we have at least 10 dispatch groups in a loop.
   let LoopMicroOpBufferSize = 60;
 
-  let CompleteModel = 1;
+  let CompleteModel = 0;
 
   let UnsupportedFeatures = [HasQPX];
 
Index: lib/Target/Mips/MipsScheduleP5600.td
===================================================================
--- lib/Target/Mips/MipsScheduleP5600.td
+++ lib/Target/Mips/MipsScheduleP5600.td
@@ -13,7 +13,7 @@
   int LoadLatency = 4;
   int MispredictPenalty = 8; // TODO: Estimated
 
-  let CompleteModel = 1;
+  let CompleteModel = 0;
 
   list<Predicate> UnsupportedFeatures = [HasMips32r6, HasMips64r6,
                                          HasMips64, HasMips64r2, HasCnMips,
Index: lib/Target/Mips/MipsScheduleGeneric.td
===================================================================
--- lib/Target/Mips/MipsScheduleGeneric.td
+++ lib/Target/Mips/MipsScheduleGeneric.td
@@ -25,7 +25,7 @@
   int HighLatency = 37;
   list<Predicate> UnsupportedFeatures = [];
 
-  let CompleteModel = 1;
+  let CompleteModel = 0;
   let PostRAScheduler = 1;
 }
 
Index: lib/Target/ARM/ARMScheduleA57.td
===================================================================
--- lib/Target/ARM/ARMScheduleA57.td
+++ lib/Target/ARM/ARMScheduleA57.td
@@ -91,7 +91,7 @@
 
   // Enable partial & runtime unrolling.
   let LoopMicroOpBufferSize = 16;
-  let CompleteModel = 1;
+  let CompleteModel = 0;
 }
 
 //===----------------------------------------------------------------------===//
Index: lib/Target/AMDGPU/SISchedule.td
===================================================================
--- lib/Target/AMDGPU/SISchedule.td
+++ lib/Target/AMDGPU/SISchedule.td
@@ -46,7 +46,7 @@
 // instructions)
 
 class SISchedMachineModel : SchedMachineModel {
-  let CompleteModel = 1;
+  let CompleteModel = 0;
   // MicroOpBufferSize = 1 means that instructions will always be added
   // the ready queue when they become available.  This exposes them
   // to the register pressure analysis.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D43235.134028.patch
Type: text/x-patch
Size: 3105 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180213/7ce7b6fa/attachment.bin>


More information about the llvm-commits mailing list