[llvm-commits] CVS: llvm/utils/TableGen/SubtargetEmitter.cpp

Jim Laskey jlaskey at apple.com
Thu Nov 3 14:47:54 PST 2005



Changes in directory llvm/utils/TableGen:

SubtargetEmitter.cpp updated: 1.13 -> 1.14
---
Log message:

1. Remove ranges from itinerary data.

2. Tidy up the subtarget emittined code.



---
Diffs of the changes:  (+11 -9)

 SubtargetEmitter.cpp |   20 +++++++++++---------
 1 files changed, 11 insertions(+), 9 deletions(-)


Index: llvm/utils/TableGen/SubtargetEmitter.cpp
diff -u llvm/utils/TableGen/SubtargetEmitter.cpp:1.13 llvm/utils/TableGen/SubtargetEmitter.cpp:1.14
--- llvm/utils/TableGen/SubtargetEmitter.cpp:1.13	Tue Nov  1 14:07:00 2005
+++ llvm/utils/TableGen/SubtargetEmitter.cpp	Thu Nov  3 16:47:42 2005
@@ -223,7 +223,7 @@
   
     // Form string as ,{ cycles, u1 | u2 | ... | un }
     int Cycles = Stage->getValueAsInt("Cycles");
-    ItinString += "  ,{ " + itostr(Cycles) + ", ";
+    ItinString += "  { " + itostr(Cycles) + ", ";
     
     // Get unit list
     std::vector<Record*> UnitList = Stage->getValueAsListOfDefs("Units");
@@ -260,7 +260,7 @@
 
   // Begin stages table
   OS << "static llvm::InstrStage Stages[] = {\n"
-        "  { 0, 0 } // No itinerary\n";
+        "  { 0, 0 }, // No itinerary\n";
         
   unsigned ItinEnum = 1;
   std::map<std::string, unsigned> ItinMap;
@@ -296,8 +296,9 @@
       
       // If new itinerary
       if (Find == 0) {
-        // Emit as ,{ cycles, u1 | u2 | ... | un } // index
-        OS << ItinString << " // " << ItinEnum << "\n";
+        // Emit as { cycles, u1 | u2 | ... | un }, // index
+        OS << ItinString << ", // " << ItinEnum << "\n";
+        // Record Itin class number
         ItinMap[ItinString] = Find = ItinEnum++;
       }
       
@@ -316,6 +317,8 @@
     ProcList.push_back(ItinList);
   }
   
+  // Closing stage
+  OS << "  { 0, 0 } // End itinerary\n";
   // End stages table
   OS << "};\n";
   
@@ -390,7 +393,7 @@
   // Begin processor table
   OS << "\n";
   OS << "// Sorted (by key) array of itineraries for CPU subtype.\n"
-     << "static const llvm::SubtargetInfoKV SubTypeInfoKV[] = {\n";
+     << "static const llvm::SubtargetInfoKV ProcItinKV[] = {\n";
      
   // For each processor
   for (unsigned i = 0, N = ProcessorList.size(); i < N;) {
@@ -418,7 +421,7 @@
 
   // Emit size of table
   OS<<"\nenum {\n";
-  OS<<"  SubTypeInfoKVSize = sizeof(SubTypeInfoKV)/"
+  OS<<"  ProcItinKVSize = sizeof(ProcItinKV)/"
                             "sizeof(llvm::SubtargetInfoKV)\n";
   OS<<"};\n";
 }
@@ -479,9 +482,8 @@
   if (HasItineraries) {
     OS << "\n"
        << "  InstrItinerary *Itinerary = (InstrItinerary *)"
-                        "Features.getInfo(SubTypeInfoKV, SubTypeInfoKVSize);\n"
-          "  InstrItins = InstrItineraryData(Stages, StagesSize, "
-                                             "Itinerary, ItinClassesSize);\n";
+                        "Features.getInfo(ProcItinKV, ProcItinKVSize);\n"
+          "  InstrItins = InstrItineraryData(Stages, Itinerary);\n";
   }
   
   OS << "}\n";






More information about the llvm-commits mailing list