[llvm-commits] [llvm] r49276 - /llvm/trunk/utils/TableGen/SubtargetEmitter.cpp
Chris Lattner
sabre at nondot.org
Sun Apr 6 10:38:15 PDT 2008
Author: lattner
Date: Sun Apr 6 12:38:14 2008
New Revision: 49276
URL: http://llvm.org/viewvc/llvm-project?rev=49276&view=rev
Log:
Fix generation of multi-stage instruction itineraries. Patch by
giuma.cordes at gmail.com
Modified:
llvm/trunk/utils/TableGen/SubtargetEmitter.cpp
Modified: llvm/trunk/utils/TableGen/SubtargetEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/SubtargetEmitter.cpp?rev=49276&r1=49275&r2=49276&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/SubtargetEmitter.cpp (original)
+++ llvm/trunk/utils/TableGen/SubtargetEmitter.cpp Sun Apr 6 12:38:14 2008
@@ -272,6 +272,7 @@
OS << "static const llvm::InstrStage Stages[] = {\n"
" { 0, 0 }, // No itinerary\n";
+ unsigned StageCount = 1;
unsigned ItinEnum = 1;
std::map<std::string, unsigned> ItinMap;
for (unsigned i = 0, N = ProcItinList.size(); i < N; i++) {
@@ -308,8 +309,10 @@
if (Find == 0) {
// Emit as { cycles, u1 | u2 | ... | un }, // index
OS << ItinString << ", // " << ItinEnum << "\n";
- // Record Itin class number
- ItinMap[ItinString] = Find = ItinEnum++;
+ // Record Itin class number.
+ ItinMap[ItinString] = Find = StageCount;
+ StageCount += NStages;
+ ItinEnum++;
}
// Set up itinerary as location and location + stage count
More information about the llvm-commits
mailing list