MC: Remove the copy of MCSchedModel in MCSubtargetInfo

`MCSchedModel` is large.  Make `MCSchedModel::GetDefaultSchedModel()`
return by-reference instead of by-value, so we can store a pointer in
`MCSubtargetInfo::CPUSchedModel` instead of a copy.

Note: since `MCSchedModel` is POD, this doesn't create a static
constructor.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241947 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Duncan P. N. Exon Smith
2015-07-10 22:13:43 +00:00
parent 722aa9573b
commit d819fac294
5 changed files with 46 additions and 30 deletions

View File

@@ -224,25 +224,9 @@ struct MCSchedModel {
return &SchedClassTable[SchedClassIdx];
}
// /\brief Returns a default initialized model. Used for unknown processors.
static MCSchedModel GetDefaultSchedModel() {
MCSchedModel Ret = { DefaultIssueWidth,
DefaultMicroOpBufferSize,
DefaultLoopMicroOpBufferSize,
DefaultLoadLatency,
DefaultHighLatency,
DefaultMispredictPenalty,
false,
true,
0,
nullptr,
nullptr,
0,
0,
nullptr
};
return Ret;
}
/// Returns the default initialized model.
static const MCSchedModel &GetDefaultSchedModel() { return Default; }
static const MCSchedModel Default;
};
} // End llvm namespace