mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-21 02:24:22 +00:00
Change MCSchedModel to be a struct of statically initialized data.
This removes static initializers from the backends which generate this data, and also makes this struct match the other Tablegen generated structs in behaviour Reviewed by Andy Trick and Chandler C git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216919 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -202,19 +202,19 @@ static int getItineraryLatency(LLVMDisasmContext *DC, const MCInst &Inst) {
|
||||
static int getLatency(LLVMDisasmContext *DC, const MCInst &Inst) {
|
||||
// Try to compute scheduling information.
|
||||
const MCSubtargetInfo *STI = DC->getSubtargetInfo();
|
||||
const MCSchedModel *SCModel = STI->getSchedModel();
|
||||
const MCSchedModel SCModel = STI->getSchedModel();
|
||||
const int NoInformationAvailable = -1;
|
||||
|
||||
// Check if we have a scheduling model for instructions.
|
||||
if (!SCModel || !SCModel->hasInstrSchedModel())
|
||||
// Try to fall back to the itinerary model if we do not have a
|
||||
// scheduling model.
|
||||
if (!SCModel.hasInstrSchedModel())
|
||||
// Try to fall back to the itinerary model if the scheduling model doesn't
|
||||
// have a scheduling table. Note the default does not have a table.
|
||||
return getItineraryLatency(DC, Inst);
|
||||
|
||||
// Get the scheduling class of the requested instruction.
|
||||
const MCInstrDesc& Desc = DC->getInstrInfo()->get(Inst.getOpcode());
|
||||
unsigned SCClass = Desc.getSchedClass();
|
||||
const MCSchedClassDesc *SCDesc = SCModel->getSchedClassDesc(SCClass);
|
||||
const MCSchedClassDesc *SCDesc = SCModel.getSchedClassDesc(SCClass);
|
||||
// Resolving the variant SchedClass requires an MI to pass to
|
||||
// SubTargetInfo::resolveSchedClass.
|
||||
if (!SCDesc || !SCDesc->isValid() || SCDesc->isVariant())
|
||||
|
Reference in New Issue
Block a user