TableGen subtarget emitter. Use getSchedClassIdx.

llvm-svn: 164096
This commit is contained in:
Andrew Trick 2012-09-18 03:55:55 +00:00
parent c6c88151bb
commit a88f1bddc6
2 changed files with 1 additions and 11 deletions

View File

@ -304,15 +304,6 @@ public:
return SchedClasses[Idx]; return SchedClasses[Idx];
} }
// Get an itinerary class's index. Value indices are '0' for NoItinerary up to
// and including numItineraryClasses().
unsigned getItinClassIdx(Record *ItinDef) const {
assert(SchedClassIdxMap.count(ItinDef->getName()) && "missing ItinClass");
unsigned Idx = SchedClassIdxMap.lookup(ItinDef->getName());
assert(Idx <= NumItineraryClasses && "bad ItinClass index");
return Idx;
}
// Get the SchedClass index for an instruction. Instructions with no // Get the SchedClass index for an instruction. Instructions with no
// itinerary, no SchedReadWrites, and no InstrReadWrites references return 0 // itinerary, no SchedReadWrites, and no InstrReadWrites references return 0
// for NoItinerary. // for NoItinerary.

View File

@ -304,11 +304,10 @@ void InstrInfoEmitter::emitRecord(const CodeGenInstruction &Inst, unsigned Num,
MinOperands = Inst.Operands.back().MIOperandNo + MinOperands = Inst.Operands.back().MIOperandNo +
Inst.Operands.back().MINumOperands; Inst.Operands.back().MINumOperands;
Record *ItinDef = Inst.TheDef->getValueAsDef("Itinerary");
OS << " { "; OS << " { ";
OS << Num << ",\t" << MinOperands << ",\t" OS << Num << ",\t" << MinOperands << ",\t"
<< Inst.Operands.NumDefs << ",\t" << Inst.Operands.NumDefs << ",\t"
<< SchedModels.getItinClassIdx(ItinDef) << ",\t" << SchedModels.getSchedClassIdx(Inst) << ",\t"
<< Inst.TheDef->getValueAsInt("Size") << ",\t0"; << Inst.TheDef->getValueAsInt("Size") << ",\t0";
// Emit all of the target indepedent flags... // Emit all of the target indepedent flags...