[MCSchedule] Simplify and remove a C++20-deprecated is_pod call. NFC

This commit is contained in:
Fangrui Song 2023-12-08 15:09:22 -08:00
parent 44dc1e0baa
commit 9810fe1a91
5 changed files with 8 additions and 9 deletions

View File

@ -46,7 +46,7 @@ class TargetSchedModel {
unsigned computeInstrLatency(const MCSchedClassDesc &SCDesc) const;
public:
TargetSchedModel() : SchedModel(MCSchedModel::GetDefaultSchedModel()) {}
TargetSchedModel() : SchedModel(MCSchedModel::Default) {}
/// Initialize the machine model for instruction scheduling.
///

View File

@ -110,8 +110,8 @@ struct InstrItinerary {
class InstrItineraryData {
public:
MCSchedModel SchedModel =
MCSchedModel::GetDefaultSchedModel(); ///< Basic machine properties.
const InstrStage *Stages = nullptr; ///< Array of stages selected
MCSchedModel::Default; ///< Basic machine properties.
const InstrStage *Stages = nullptr; ///< Array of stages selected
const unsigned *OperandCycles = nullptr; ///< Array of operand cycles selected
const unsigned *Forwardings = nullptr; ///< Array of pipeline forwarding paths
const InstrItinerary *Itineraries =

View File

@ -390,7 +390,6 @@ struct MCSchedModel {
unsigned WriteResourceIdx = 0);
/// Returns the default initialized model.
static const MCSchedModel &GetDefaultSchedModel() { return Default; }
static const MCSchedModel Default;
};

View File

@ -20,8 +20,8 @@
using namespace llvm;
static_assert(std::is_pod<MCSchedModel>::value,
"We shouldn't have a static constructor here");
static_assert(std::is_trivial_v<MCSchedModel>,
"MCSchedModel is required to be a trivial type");
const MCSchedModel MCSchedModel::Default = {DefaultIssueWidth,
DefaultMicroOpBufferSize,
DefaultLoopMicroOpBufferSize,
@ -30,7 +30,7 @@ const MCSchedModel MCSchedModel::Default = {DefaultIssueWidth,
DefaultMispredictPenalty,
false,
true,
false /*EnableIntervals*/,
/*EnableIntervals=*/false,
0,
nullptr,
nullptr,

View File

@ -214,7 +214,7 @@ void MCSubtargetInfo::InitMCProcessorInfo(StringRef CPU, StringRef TuneCPU,
if (!TuneCPU.empty())
CPUSchedModel = &getSchedModelForCPU(TuneCPU);
else
CPUSchedModel = &MCSchedModel::GetDefaultSchedModel();
CPUSchedModel = &MCSchedModel::Default;
}
void MCSubtargetInfo::setDefaultFeatures(StringRef CPU, StringRef TuneCPU,
@ -319,7 +319,7 @@ const MCSchedModel &MCSubtargetInfo::getSchedModelForCPU(StringRef CPU) const {
errs() << "'" << CPU
<< "' is not a recognized processor for this target"
<< " (ignoring processor)\n";
return MCSchedModel::GetDefaultSchedModel();
return MCSchedModel::Default;
}
assert(CPUEntry->SchedModel && "Missing processor SchedModel value");
return *CPUEntry->SchedModel;