[llvm] r326993 - [MCSchedule] Always generate processor resource names.

Andrea Di Biagio via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 8 02:38:46 PST 2018


Author: adibiagio
Date: Thu Mar  8 02:38:45 2018
New Revision: 326993

URL: http://llvm.org/viewvc/llvm-project?rev=326993&view=rev
Log:
[MCSchedule] Always generate processor resource names.

With this patch, the tablegen 'SubtargetEmitter' always generates processor
resource names. 
The impact of this patch on the code size of other llvm tools is small.  I have
observed an average increase of 0.03% in code size when doing a release build of
LLVM (on windows, using MSVC) with all the default backends.

This change is done in preparation for the upcoming llvm-mca patch.

Modified:
    llvm/trunk/include/llvm/MC/MCSchedule.h
    llvm/trunk/utils/TableGen/SubtargetEmitter.cpp

Modified: llvm/trunk/include/llvm/MC/MCSchedule.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCSchedule.h?rev=326993&r1=326992&r2=326993&view=diff
==============================================================================
--- llvm/trunk/include/llvm/MC/MCSchedule.h (original)
+++ llvm/trunk/include/llvm/MC/MCSchedule.h Thu Mar  8 02:38:45 2018
@@ -24,9 +24,7 @@ struct InstrItinerary;
 
 /// Define a kind of processor resource that will be modeled by the scheduler.
 struct MCProcResourceDesc {
-#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
   const char *Name;
-#endif
   unsigned NumUnits; // Number of resource of this kind
   unsigned SuperIdx; // Index of the resources kind that contains this kind.
 

Modified: llvm/trunk/utils/TableGen/SubtargetEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/SubtargetEmitter.cpp?rev=326993&r1=326992&r2=326993&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/SubtargetEmitter.cpp (original)
+++ llvm/trunk/utils/TableGen/SubtargetEmitter.cpp Thu Mar  8 02:38:45 2018
@@ -616,7 +616,7 @@ void SubtargetEmitter::EmitProcessorReso
   OS << "static const llvm::MCProcResourceDesc " << ProcModel.ModelName
      << "ProcResources"
      << "[] = {\n"
-     << "  {DBGFIELD(\"InvalidUnit\")     0, 0, 0, 0},\n";
+     << "  {\"InvalidUnit\", 0, 0, 0, 0},\n";
 
   unsigned SubUnitsOffset = 1;
   for (unsigned i = 0, e = ProcModel.ProcResourceDefs.size(); i < e; ++i) {
@@ -645,7 +645,7 @@ void SubtargetEmitter::EmitProcessorReso
       NumUnits = PRDef->getValueAsInt("NumUnits");
     }
     // Emit the ProcResourceDesc
-    OS << "  {DBGFIELD(\"" << PRDef->getName() << "\") ";
+    OS << "  {\"" << PRDef->getName() << "\", ";
     if (PRDef->getName().size() < 15)
       OS.indent(15 - PRDef->getName().size());
     OS << NumUnits << ", " << SuperIdx << ", " << BufferSize << ", ";




More information about the llvm-commits mailing list