llvm.org GIT mirror llvm / 6312cb0
misched: Generate IsBuffered flag for machine resources. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165602 91177308-0d34-0410-b5e6-96231b3b80d8 Andrew Trick 8 years ago
2 changed file(s) with 13 addition(s) and 6 deletion(s). Raw diff Collapse all Expand all
2626 #ifndef NDEBUG
2727 const char *Name;
2828 #endif
29 unsigned Count; // Number of resource of this kind
29 unsigned NumUnits; // Number of resource of this kind
3030 unsigned SuperIdx; // Index of the resources kind that contains this kind.
3131
32 // Buffered resources may be consumed at some indeterminate cycle after
33 // dispatch (e.g. for instructions that may issue out-of-order). Unbuffered
34 // resources always consume their resource some fixed number of cycles after
35 // dispatch (e.g. for instruction interlocking that may stall the pipeline).
36 bool IsBuffered;
37
3238 bool operator==(const MCProcResourceDesc &Other) const {
33 return Count == Other.Count && SuperIdx == Other.SuperIdx;
39 return NumUnits == Other.NumUnits && SuperIdx == Other.SuperIdx
40 && IsBuffered == Other.IsBuffered;
3441 }
3542 };
3643
622622 raw_ostream &OS) {
623623 char Sep = ProcModel.ProcResourceDefs.empty() ? ' ' : ',';
624624
625 OS << "\n// {Name, NumUnits, SuperIdx}\n";
625 OS << "\n// {Name, NumUnits, SuperIdx, IsBuffered}\n";
626626 OS << "static const llvm::MCProcResourceDesc "
627627 << ProcModel.ModelName << "ProcResources" << "[] = {\n"
628 << " {DBGFIELD(\"InvalidUnit\") 0, 0}" << Sep << "\n";
628 << " {DBGFIELD(\"InvalidUnit\") 0, 0, 0}" << Sep << "\n";
629629
630630 for (unsigned i = 0, e = ProcModel.ProcResourceDefs.size(); i < e; ++i) {
631631 Record *PRDef = ProcModel.ProcResourceDefs[i];
644644 OS << " {DBGFIELD(\"" << PRDef->getName() << "\") ";
645645 if (PRDef->getName().size() < 15)
646646 OS.indent(15 - PRDef->getName().size());
647 OS << PRDef->getValueAsInt("NumUnits") << ", " << SuperIdx
648 << "}" << Sep << " // #" << i+1;
647 OS << PRDef->getValueAsInt("NumUnits") << ", " << SuperIdx << ", "
648 << PRDef->getValueAsBit("Buffered") << "}" << Sep << " // #" << i+1;
649649 if (SuperDef)
650650 OS << ", Super=" << SuperDef->getName();
651651 OS << "\n";