llvm.org GIT mirror llvm / b54703c
[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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@326993 91177308-0d34-0410-b5e6-96231b3b80d8 Andrea Di Biagio 2 years ago
2 changed file(s) with 2 addition(s) and 4 deletion(s). Raw diff Collapse all Expand all
2323
2424 /// Define a kind of processor resource that will be modeled by the scheduler.
2525 struct MCProcResourceDesc {
26 #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
2726 const char *Name;
28 #endif
2927 unsigned NumUnits; // Number of resource of this kind
3028 unsigned SuperIdx; // Index of the resources kind that contains this kind.
3129
615615 OS << "static const llvm::MCProcResourceDesc " << ProcModel.ModelName
616616 << "ProcResources"
617617 << "[] = {\n"
618 << " {DBGFIELD(\"InvalidUnit\") 0, 0, 0, 0},\n";
618 << " {\"InvalidUnit\", 0, 0, 0, 0},\n";
619619
620620 unsigned SubUnitsOffset = 1;
621621 for (unsigned i = 0, e = ProcModel.ProcResourceDefs.size(); i < e; ++i) {
644644 NumUnits = PRDef->getValueAsInt("NumUnits");
645645 }
646646 // Emit the ProcResourceDesc
647 OS << " {DBGFIELD(\"" << PRDef->getName() << "\") ";
647 OS << " {\"" << PRDef->getName() << "\", ";
648648 if (PRDef->getName().size() < 15)
649649 OS.indent(15 - PRDef->getName().size());
650650 OS << NumUnits << ", " << SuperIdx << ", " << BufferSize << ", ";