[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.

llvm-svn: 326993
This commit is contained in:
Andrea Di Biagio 2018-03-08 10:38:45 +00:00
parent a406796f5f
commit 30e94029d8
2 changed files with 2 additions and 4 deletions

View File

@ -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.

View File

@ -616,7 +616,7 @@ void SubtargetEmitter::EmitProcessorResources(const CodeGenProcModel &ProcModel,
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::EmitProcessorResources(const CodeGenProcModel &ProcModel,
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 << ", ";