mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-26 12:43:36 +01:00
misched: Generate IsBuffered flag for machine resources.
llvm-svn: 165602
This commit is contained in:
parent
7201b35843
commit
13b4f59560
@ -27,11 +27,18 @@ struct MCProcResourceDesc {
|
|||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
const char *Name;
|
const char *Name;
|
||||||
#endif
|
#endif
|
||||||
unsigned Count; // Number of resource of this kind
|
unsigned NumUnits; // Number of resource of this kind
|
||||||
unsigned SuperIdx; // Index of the resources kind that contains this kind.
|
unsigned SuperIdx; // Index of the resources kind that contains this kind.
|
||||||
|
|
||||||
|
// Buffered resources may be consumed at some indeterminate cycle after
|
||||||
|
// dispatch (e.g. for instructions that may issue out-of-order). Unbuffered
|
||||||
|
// resources always consume their resource some fixed number of cycles after
|
||||||
|
// dispatch (e.g. for instruction interlocking that may stall the pipeline).
|
||||||
|
bool IsBuffered;
|
||||||
|
|
||||||
bool operator==(const MCProcResourceDesc &Other) const {
|
bool operator==(const MCProcResourceDesc &Other) const {
|
||||||
return Count == Other.Count && SuperIdx == Other.SuperIdx;
|
return NumUnits == Other.NumUnits && SuperIdx == Other.SuperIdx
|
||||||
|
&& IsBuffered == Other.IsBuffered;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -623,10 +623,10 @@ void SubtargetEmitter::EmitProcessorResources(const CodeGenProcModel &ProcModel,
|
|||||||
raw_ostream &OS) {
|
raw_ostream &OS) {
|
||||||
char Sep = ProcModel.ProcResourceDefs.empty() ? ' ' : ',';
|
char Sep = ProcModel.ProcResourceDefs.empty() ? ' ' : ',';
|
||||||
|
|
||||||
OS << "\n// {Name, NumUnits, SuperIdx}\n";
|
OS << "\n// {Name, NumUnits, SuperIdx, IsBuffered}\n";
|
||||||
OS << "static const llvm::MCProcResourceDesc "
|
OS << "static const llvm::MCProcResourceDesc "
|
||||||
<< ProcModel.ModelName << "ProcResources" << "[] = {\n"
|
<< ProcModel.ModelName << "ProcResources" << "[] = {\n"
|
||||||
<< " {DBGFIELD(\"InvalidUnit\") 0, 0}" << Sep << "\n";
|
<< " {DBGFIELD(\"InvalidUnit\") 0, 0, 0}" << Sep << "\n";
|
||||||
|
|
||||||
for (unsigned i = 0, e = ProcModel.ProcResourceDefs.size(); i < e; ++i) {
|
for (unsigned i = 0, e = ProcModel.ProcResourceDefs.size(); i < e; ++i) {
|
||||||
Record *PRDef = ProcModel.ProcResourceDefs[i];
|
Record *PRDef = ProcModel.ProcResourceDefs[i];
|
||||||
@ -645,8 +645,8 @@ void SubtargetEmitter::EmitProcessorResources(const CodeGenProcModel &ProcModel,
|
|||||||
OS << " {DBGFIELD(\"" << PRDef->getName() << "\") ";
|
OS << " {DBGFIELD(\"" << PRDef->getName() << "\") ";
|
||||||
if (PRDef->getName().size() < 15)
|
if (PRDef->getName().size() < 15)
|
||||||
OS.indent(15 - PRDef->getName().size());
|
OS.indent(15 - PRDef->getName().size());
|
||||||
OS << PRDef->getValueAsInt("NumUnits") << ", " << SuperIdx
|
OS << PRDef->getValueAsInt("NumUnits") << ", " << SuperIdx << ", "
|
||||||
<< "}" << Sep << " // #" << i+1;
|
<< PRDef->getValueAsBit("Buffered") << "}" << Sep << " // #" << i+1;
|
||||||
if (SuperDef)
|
if (SuperDef)
|
||||||
OS << ", Super=" << SuperDef->getName();
|
OS << ", Super=" << SuperDef->getName();
|
||||||
OS << "\n";
|
OS << "\n";
|
||||||
|
Loading…
Reference in New Issue
Block a user