[llvm] r189839 - TableGen: Enumerate Schedule Model too.
Vincent Lejeune
vljn at ovi.com
Tue Sep 3 12:43:29 PDT 2013
Author: vljn
Date: Tue Sep 3 14:43:28 2013
New Revision: 189839
URL: http://llvm.org/viewvc/llvm-project?rev=189839&view=rev
Log:
TableGen: Enumerate Schedule Model too.
Modified:
llvm/trunk/docs/WritingAnLLVMBackend.rst
llvm/trunk/utils/TableGen/InstrInfoEmitter.cpp
Modified: llvm/trunk/docs/WritingAnLLVMBackend.rst
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/WritingAnLLVMBackend.rst?rev=189839&r1=189838&r2=189839&view=diff
==============================================================================
--- llvm/trunk/docs/WritingAnLLVMBackend.rst (original)
+++ llvm/trunk/docs/WritingAnLLVMBackend.rst Tue Sep 3 14:43:28 2013
@@ -952,6 +952,11 @@ XXXInstrInfo.h:
int16_t getNamedOperandIdx(uint16_t Opcode, uint16_t NamedIndex);
} // End namespace XXX
+Instruction itineraries can be queried using MCDesc::getSchedClass(). The
+value can be named by an enumemation in llvm::XXX::Sched namespace generated
+by TableGen in XXXGenInstrInfo.inc. The name of the schedule classes are
+the same as provided in XXXSchedule.td plus a default NoIntinerary class.
+
Instruction Relation Mapping
----------------------------
Modified: llvm/trunk/utils/TableGen/InstrInfoEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/InstrInfoEmitter.cpp?rev=189839&r1=189838&r2=189839&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/InstrInfoEmitter.cpp (original)
+++ llvm/trunk/utils/TableGen/InstrInfoEmitter.cpp Tue Sep 3 14:43:28 2013
@@ -545,7 +545,15 @@ void InstrInfoEmitter::emitEnums(raw_ost
<< "\t= " << i << ",\n";
}
OS << " INSTRUCTION_LIST_END = " << NumberedInstructions.size() << "\n";
- OS << " };\n}\n";
+ OS << " };\n";
+ OS << "namespace Sched {\n";
+ OS << " enum {\n";
+ for (unsigned i = 0, e = SchedModels.numInstrSchedClasses(); i != e; ++i) {
+ OS << " " << SchedModels.getSchedClass(i).Name
+ << "\t= " << i << ",\n";
+ }
+ OS << " SCHED_LIST_END = " << SchedModels.numInstrSchedClasses() << "\n";
+ OS << " };\n}\n}\n";
OS << "} // End llvm namespace \n";
OS << "#endif // GET_INSTRINFO_ENUM\n\n";
More information about the llvm-commits
mailing list