Add support to model pipeline bypass / forwarding.
[oota-llvm.git] / utils / TableGen / SubtargetEmitter.cpp
1 //===- SubtargetEmitter.cpp - Generate subtarget enumerations -------------===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This tablegen backend emits subtarget enumerations.
11 //
12 //===----------------------------------------------------------------------===//
13
14 #include "SubtargetEmitter.h"
15 #include "CodeGenTarget.h"
16 #include "Record.h"
17 #include "llvm/ADT/StringExtras.h"
18 #include "llvm/Support/Debug.h"
19 #include <algorithm>
20 using namespace llvm;
21
22 //
23 // Enumeration - Emit the specified class as an enumeration.
24 //
25 void SubtargetEmitter::Enumeration(raw_ostream &OS,
26                                    const char *ClassName,
27                                    bool isBits) {
28   // Get all records of class and sort
29   std::vector<Record*> DefList = Records.getAllDerivedDefinitions(ClassName);
30   std::sort(DefList.begin(), DefList.end(), LessRecord());
31
32   // Open enumeration
33   OS << "enum {\n";
34   
35   // For each record
36   for (unsigned i = 0, N = DefList.size(); i < N;) {
37     // Next record
38     Record *Def = DefList[i];
39     
40     // Get and emit name
41     OS << "  " << Def->getName();
42     
43     // If bit flags then emit expression (1 << i)
44     if (isBits)  OS << " = " << " 1 << " << i;
45
46     // Depending on 'if more in the list' emit comma
47     if (++i < N) OS << ",";
48     
49     OS << "\n";
50   }
51   
52   // Close enumeration
53   OS << "};\n";
54 }
55
56 //
57 // FeatureKeyValues - Emit data of all the subtarget features.  Used by the
58 // command line.
59 //
60 void SubtargetEmitter::FeatureKeyValues(raw_ostream &OS) {
61   // Gather and sort all the features
62   std::vector<Record*> FeatureList =
63                            Records.getAllDerivedDefinitions("SubtargetFeature");
64   std::sort(FeatureList.begin(), FeatureList.end(), LessRecordFieldName());
65
66   // Begin feature table
67   OS << "// Sorted (by key) array of values for CPU features.\n"
68      << "static const llvm::SubtargetFeatureKV FeatureKV[] = {\n";
69   
70   // For each feature
71   for (unsigned i = 0, N = FeatureList.size(); i < N; ++i) {
72     // Next feature
73     Record *Feature = FeatureList[i];
74
75     const std::string &Name = Feature->getName();
76     const std::string &CommandLineName = Feature->getValueAsString("Name");
77     const std::string &Desc = Feature->getValueAsString("Desc");
78     
79     if (CommandLineName.empty()) continue;
80     
81     // Emit as { "feature", "description", featureEnum, i1 | i2 | ... | in }
82     OS << "  { "
83        << "\"" << CommandLineName << "\", "
84        << "\"" << Desc << "\", "
85        << Name << ", ";
86
87     const std::vector<Record*> &ImpliesList = 
88       Feature->getValueAsListOfDefs("Implies");
89     
90     if (ImpliesList.empty()) {
91       OS << "0";
92     } else {
93       for (unsigned j = 0, M = ImpliesList.size(); j < M;) {
94         OS << ImpliesList[j]->getName();
95         if (++j < M) OS << " | ";
96       }
97     }
98
99     OS << " }";
100     
101     // Depending on 'if more in the list' emit comma
102     if ((i + 1) < N) OS << ",";
103     
104     OS << "\n";
105   }
106   
107   // End feature table
108   OS << "};\n";
109
110   // Emit size of table
111   OS<<"\nenum {\n";
112   OS<<"  FeatureKVSize = sizeof(FeatureKV)/sizeof(llvm::SubtargetFeatureKV)\n";
113   OS<<"};\n";
114 }
115
116 //
117 // CPUKeyValues - Emit data of all the subtarget processors.  Used by command
118 // line.
119 //
120 void SubtargetEmitter::CPUKeyValues(raw_ostream &OS) {
121   // Gather and sort processor information
122   std::vector<Record*> ProcessorList =
123                           Records.getAllDerivedDefinitions("Processor");
124   std::sort(ProcessorList.begin(), ProcessorList.end(), LessRecordFieldName());
125
126   // Begin processor table
127   OS << "// Sorted (by key) array of values for CPU subtype.\n"
128      << "static const llvm::SubtargetFeatureKV SubTypeKV[] = {\n";
129      
130   // For each processor
131   for (unsigned i = 0, N = ProcessorList.size(); i < N;) {
132     // Next processor
133     Record *Processor = ProcessorList[i];
134
135     const std::string &Name = Processor->getValueAsString("Name");
136     const std::vector<Record*> &FeatureList = 
137       Processor->getValueAsListOfDefs("Features");
138     
139     // Emit as { "cpu", "description", f1 | f2 | ... fn },
140     OS << "  { "
141        << "\"" << Name << "\", "
142        << "\"Select the " << Name << " processor\", ";
143     
144     if (FeatureList.empty()) {
145       OS << "0";
146     } else {
147       for (unsigned j = 0, M = FeatureList.size(); j < M;) {
148         OS << FeatureList[j]->getName();
149         if (++j < M) OS << " | ";
150       }
151     }
152     
153     // The "0" is for the "implies" section of this data structure.
154     OS << ", 0 }";
155     
156     // Depending on 'if more in the list' emit comma
157     if (++i < N) OS << ",";
158     
159     OS << "\n";
160   }
161   
162   // End processor table
163   OS << "};\n";
164
165   // Emit size of table
166   OS<<"\nenum {\n";
167   OS<<"  SubTypeKVSize = sizeof(SubTypeKV)/sizeof(llvm::SubtargetFeatureKV)\n";
168   OS<<"};\n";
169 }
170
171 //
172 // CollectAllItinClasses - Gathers and enumerates all the itinerary classes.
173 // Returns itinerary class count.
174 //
175 unsigned SubtargetEmitter::
176 CollectAllItinClasses(raw_ostream &OS,
177                       std::map<std::string, unsigned> &ItinClassesMap,
178                       std::vector<Record*> &ItinClassList) {
179   // For each itinerary class
180   unsigned N = ItinClassList.size();
181   for (unsigned i = 0; i < N; i++) {
182     // Next itinerary class
183     const Record *ItinClass = ItinClassList[i];
184     // Get name of itinerary class
185     // Assign itinerary class a unique number
186     ItinClassesMap[ItinClass->getName()] = i;
187   }
188   
189   // Emit size of table
190   OS<<"\nenum {\n";
191   OS<<"  ItinClassesSize = " << N << "\n";
192   OS<<"};\n";
193
194   // Return itinerary class count
195   return N;
196 }
197
198 //
199 // FormItineraryStageString - Compose a string containing the stage
200 // data initialization for the specified itinerary.  N is the number
201 // of stages.
202 //
203 void SubtargetEmitter::FormItineraryStageString(const std::string &Name,
204                                                 Record *ItinData,
205                                                 std::string &ItinString,
206                                                 unsigned &NStages) {
207   // Get states list
208   const std::vector<Record*> &StageList =
209     ItinData->getValueAsListOfDefs("Stages");
210
211   // For each stage
212   unsigned N = NStages = StageList.size();
213   for (unsigned i = 0; i < N;) {
214     // Next stage
215     const Record *Stage = StageList[i];
216   
217     // Form string as ,{ cycles, u1 | u2 | ... | un, timeinc, kind }
218     int Cycles = Stage->getValueAsInt("Cycles");
219     ItinString += "  { " + itostr(Cycles) + ", ";
220     
221     // Get unit list
222     const std::vector<Record*> &UnitList = Stage->getValueAsListOfDefs("Units");
223     
224     // For each unit
225     for (unsigned j = 0, M = UnitList.size(); j < M;) {
226       // Add name and bitwise or
227       ItinString += Name + "FU::" + UnitList[j]->getName();
228       if (++j < M) ItinString += " | ";
229     }
230     
231     int TimeInc = Stage->getValueAsInt("TimeInc");
232     ItinString += ", " + itostr(TimeInc);
233
234     int Kind = Stage->getValueAsInt("Kind");
235     ItinString += ", (llvm::InstrStage::ReservationKinds)" + itostr(Kind);
236
237     // Close off stage
238     ItinString += " }";
239     if (++i < N) ItinString += ", ";
240   }
241 }
242
243 //
244 // FormItineraryOperandCycleString - Compose a string containing the
245 // operand cycle initialization for the specified itinerary.  N is the
246 // number of operands that has cycles specified.
247 //
248 void SubtargetEmitter::FormItineraryOperandCycleString(Record *ItinData,
249                          std::string &ItinString, unsigned &NOperandCycles) {
250   // Get operand cycle list
251   const std::vector<int64_t> &OperandCycleList =
252     ItinData->getValueAsListOfInts("OperandCycles");
253
254   // For each operand cycle
255   unsigned N = NOperandCycles = OperandCycleList.size();
256   for (unsigned i = 0; i < N;) {
257     // Next operand cycle
258     const int OCycle = OperandCycleList[i];
259   
260     ItinString += "  " + itostr(OCycle);
261     if (++i < N) ItinString += ", ";
262   }
263 }
264
265 void SubtargetEmitter::FormItineraryBypassString(const std::string &Name,
266                                                  Record *ItinData,
267                                                  std::string &ItinString,
268                                                  unsigned NOperandCycles) {
269   const std::vector<Record*> &BypassList =
270     ItinData->getValueAsListOfDefs("Bypasses");
271   unsigned N = BypassList.size();
272   for (unsigned i = 0; i < N;) {
273     ItinString += Name + "Bypass::" + BypassList[i]->getName();
274     if (++i < N) ItinString += ", ";
275   }
276
277   for (; N < NOperandCycles;) {
278     ItinString += " 0";
279     if (++N < NOperandCycles) ItinString += ", ";
280   }
281 }
282
283 //
284 // EmitStageAndOperandCycleData - Generate unique itinerary stages and
285 // operand cycle tables.  Record itineraries for processors.
286 //
287 void SubtargetEmitter::EmitStageAndOperandCycleData(raw_ostream &OS,
288        unsigned NItinClasses,
289        std::map<std::string, unsigned> &ItinClassesMap,
290        std::vector<Record*> &ItinClassList,
291        std::vector<std::vector<InstrItinerary> > &ProcList) {
292   // Gather processor iteraries
293   std::vector<Record*> ProcItinList =
294                        Records.getAllDerivedDefinitions("ProcessorItineraries");
295   
296   // If just no itinerary then don't bother
297   if (ProcItinList.size() < 2) return;
298
299   // Emit functional units for all the itineraries.
300   for (unsigned i = 0, N = ProcItinList.size(); i < N; ++i) {
301     // Next record
302     Record *Proc = ProcItinList[i];
303
304     std::vector<Record*> FUs = Proc->getValueAsListOfDefs("FU");
305     if (FUs.empty())
306       continue;
307
308     const std::string &Name = Proc->getName();
309     OS << "\n// Functional units for itineraries \"" << Name << "\"\n"
310        << "namespace " << Name << "FU {\n";
311
312     for (unsigned j = 0, FUN = FUs.size(); j < FUN; ++j)
313       OS << "  const unsigned " << FUs[j]->getName()
314          << " = 1 << " << j << ";\n";
315
316     OS << "}\n";
317
318     std::vector<Record*> BPs = Proc->getValueAsListOfDefs("BP");
319     OS << "\n// Pipeline bypasses for itineraries \"" << Name << "\"\n"
320        << "namespace " << Name << "Bypass {\n";
321
322     for (unsigned j = 0, BPN = BPs.size(); j < BPN; ++j)
323       OS << "  const unsigned " << BPs[j]->getName()
324          << " = 1 << " << j << ";\n";
325
326     OS << "}\n";
327   }
328
329   // Begin stages table
330   std::string StageTable = "\nstatic const llvm::InstrStage Stages[] = {\n";
331   StageTable += "  { 0, 0, 0, llvm::InstrStage::Required }, // No itinerary\n";
332         
333   // Begin operand cycle table
334   std::string OperandCycleTable = "static const unsigned OperandCycles[] = {\n";
335   OperandCycleTable += "  0, // No itinerary\n";
336
337   // Begin pipeline bypass table
338   std::string BypassTable = "static const unsigned Bypasses[] = {\n";
339   BypassTable += "  0, // No itinerary\n";
340         
341   unsigned StageCount = 1, OperandCycleCount = 1;
342   unsigned ItinStageEnum = 1, ItinOperandCycleEnum = 1;
343   std::map<std::string, unsigned> ItinStageMap, ItinOperandCycleMap;
344   for (unsigned i = 0, N = ProcItinList.size(); i < N; i++) {
345     // Next record
346     Record *Proc = ProcItinList[i];
347     
348     // Get processor itinerary name
349     const std::string &Name = Proc->getName();
350     
351     // Skip default
352     if (Name == "NoItineraries") continue;
353     
354     // Create and expand processor itinerary to cover all itinerary classes
355     std::vector<InstrItinerary> ItinList;
356     ItinList.resize(NItinClasses);
357     
358     // Get itinerary data list
359     std::vector<Record*> ItinDataList = Proc->getValueAsListOfDefs("IID");
360     
361     // For each itinerary data
362     for (unsigned j = 0, M = ItinDataList.size(); j < M; j++) {
363       // Next itinerary data
364       Record *ItinData = ItinDataList[j];
365       
366       // Get string and stage count
367       std::string ItinStageString;
368       unsigned NStages;
369       FormItineraryStageString(Name, ItinData, ItinStageString, NStages);
370
371       // Get string and operand cycle count
372       std::string ItinOperandCycleString;
373       unsigned NOperandCycles;
374       FormItineraryOperandCycleString(ItinData, ItinOperandCycleString,
375                                       NOperandCycles);
376
377       std::string ItinBypassString;
378       FormItineraryBypassString(Name, ItinData, ItinBypassString,
379                                 NOperandCycles);
380
381       // Check to see if stage already exists and create if it doesn't
382       unsigned FindStage = 0;
383       if (NStages > 0) {
384         FindStage = ItinStageMap[ItinStageString];
385         if (FindStage == 0) {
386           // Emit as { cycles, u1 | u2 | ... | un, timeinc }, // index
387           StageTable += ItinStageString + ", // " + itostr(ItinStageEnum) + "\n";
388           // Record Itin class number.
389           ItinStageMap[ItinStageString] = FindStage = StageCount;
390           StageCount += NStages;
391           ItinStageEnum++;
392         }
393       }
394       
395       // Check to see if operand cycle already exists and create if it doesn't
396       unsigned FindOperandCycle = 0;
397       if (NOperandCycles > 0) {
398         FindOperandCycle = ItinOperandCycleMap[ItinOperandCycleString];
399         if (FindOperandCycle == 0) {
400           // Emit as  cycle, // index
401           OperandCycleTable += ItinOperandCycleString + ", // " + 
402             itostr(ItinOperandCycleEnum) + "\n";
403           // Record Itin class number.
404           ItinOperandCycleMap[ItinOperandCycleString] = 
405             FindOperandCycle = OperandCycleCount;
406
407           // Emit as bypass, // index
408           BypassTable += ItinBypassString + ", // " + 
409             itostr(ItinOperandCycleEnum) + "\n";
410
411           OperandCycleCount += NOperandCycles;
412           ItinOperandCycleEnum++;
413         }
414       }
415       
416       // Locate where to inject into processor itinerary table
417       const std::string &Name = ItinData->getValueAsDef("TheClass")->getName();
418       unsigned Find = ItinClassesMap[Name];
419       
420       // Set up itinerary as location and location + stage count
421       unsigned NumUOps = ItinClassList[Find]->getValueAsInt("NumMicroOps");
422       InstrItinerary Intinerary = { NumUOps, FindStage, FindStage + NStages,
423                                     FindOperandCycle,
424                                     FindOperandCycle + NOperandCycles};
425
426       // Inject - empty slots will be 0, 0
427       ItinList[Find] = Intinerary;
428     }
429     
430     // Add process itinerary to list
431     ProcList.push_back(ItinList);
432   }
433
434   // Closing stage
435   StageTable += "  { 0, 0, 0, llvm::InstrStage::Required } // End itinerary\n";
436   StageTable += "};\n";
437
438   // Closing operand cycles
439   OperandCycleTable += "  0 // End itinerary\n";
440   OperandCycleTable += "};\n";
441
442   BypassTable += "  0 // End itinerary\n";
443   BypassTable += "};\n";
444
445   // Emit tables.
446   OS << StageTable;
447   OS << OperandCycleTable;
448   OS << BypassTable;
449   
450   // Emit size of tables
451   OS<<"\nenum {\n";
452   OS<<"  StagesSize = sizeof(Stages)/sizeof(llvm::InstrStage),\n";
453   OS<<"  OperandCyclesSize = sizeof(OperandCycles)/sizeof(unsigned)\n";
454   OS<<"};\n";
455 }
456
457 //
458 // EmitProcessorData - Generate data for processor itineraries.
459 //
460 void SubtargetEmitter::EmitProcessorData(raw_ostream &OS,
461       std::vector<std::vector<InstrItinerary> > &ProcList) {
462   // Get an iterator for processor itinerary stages
463   std::vector<std::vector<InstrItinerary> >::iterator
464       ProcListIter = ProcList.begin();
465   
466   // For each processor itinerary
467   std::vector<Record*> Itins =
468                        Records.getAllDerivedDefinitions("ProcessorItineraries");
469   for (unsigned i = 0, N = Itins.size(); i < N; i++) {
470     // Next record
471     Record *Itin = Itins[i];
472
473     // Get processor itinerary name
474     const std::string &Name = Itin->getName();
475     
476     // Skip default
477     if (Name == "NoItineraries") continue;
478
479     // Begin processor itinerary table
480     OS << "\n";
481     OS << "static const llvm::InstrItinerary " << Name << "[] = {\n";
482     
483     // For each itinerary class
484     std::vector<InstrItinerary> &ItinList = *ProcListIter++;
485     for (unsigned j = 0, M = ItinList.size(); j < M; ++j) {
486       InstrItinerary &Intinerary = ItinList[j];
487       
488       // Emit in the form of 
489       // { firstStage, lastStage, firstCycle, lastCycle } // index
490       if (Intinerary.FirstStage == 0) {
491         OS << "  { 1, 0, 0, 0, 0 }";
492       } else {
493         OS << "  { " <<
494           Intinerary.NumMicroOps << ", " <<
495           Intinerary.FirstStage << ", " << 
496           Intinerary.LastStage << ", " << 
497           Intinerary.FirstOperandCycle << ", " << 
498           Intinerary.LastOperandCycle << " }";
499       }
500       
501       OS << ", // " << j << "\n";
502     }
503     
504     // End processor itinerary table
505     OS << "  { 1, ~0U, ~0U, ~0U, ~0U } // end marker\n";
506     OS << "};\n";
507   }
508 }
509
510 //
511 // EmitProcessorLookup - generate cpu name to itinerary lookup table.
512 //
513 void SubtargetEmitter::EmitProcessorLookup(raw_ostream &OS) {
514   // Gather and sort processor information
515   std::vector<Record*> ProcessorList =
516                           Records.getAllDerivedDefinitions("Processor");
517   std::sort(ProcessorList.begin(), ProcessorList.end(), LessRecordFieldName());
518
519   // Begin processor table
520   OS << "\n";
521   OS << "// Sorted (by key) array of itineraries for CPU subtype.\n"
522      << "static const llvm::SubtargetInfoKV ProcItinKV[] = {\n";
523      
524   // For each processor
525   for (unsigned i = 0, N = ProcessorList.size(); i < N;) {
526     // Next processor
527     Record *Processor = ProcessorList[i];
528
529     const std::string &Name = Processor->getValueAsString("Name");
530     const std::string &ProcItin =
531       Processor->getValueAsDef("ProcItin")->getName();
532     
533     // Emit as { "cpu", procinit },
534     OS << "  { "
535        << "\"" << Name << "\", "
536        << "(void *)&" << ProcItin;
537         
538     OS << " }";
539     
540     // Depending on ''if more in the list'' emit comma
541     if (++i < N) OS << ",";
542     
543     OS << "\n";
544   }
545   
546   // End processor table
547   OS << "};\n";
548
549   // Emit size of table
550   OS<<"\nenum {\n";
551   OS<<"  ProcItinKVSize = sizeof(ProcItinKV)/"
552                             "sizeof(llvm::SubtargetInfoKV)\n";
553   OS<<"};\n";
554 }
555
556 //
557 // EmitData - Emits all stages and itineries, folding common patterns.
558 //
559 void SubtargetEmitter::EmitData(raw_ostream &OS) {
560   std::map<std::string, unsigned> ItinClassesMap;
561   // Gather and sort all itinerary classes
562   std::vector<Record*> ItinClassList =
563     Records.getAllDerivedDefinitions("InstrItinClass");
564   std::sort(ItinClassList.begin(), ItinClassList.end(), LessRecord());
565   
566   // Enumerate all the itinerary classes
567   unsigned NItinClasses = CollectAllItinClasses(OS, ItinClassesMap,
568                                                 ItinClassList);
569   // Make sure the rest is worth the effort
570   HasItineraries = NItinClasses != 1;   // Ignore NoItinerary.
571   
572   if (HasItineraries) {
573     std::vector<std::vector<InstrItinerary> > ProcList;
574     // Emit the stage data
575     EmitStageAndOperandCycleData(OS, NItinClasses, ItinClassesMap,
576                                  ItinClassList, ProcList);
577     // Emit the processor itinerary data
578     EmitProcessorData(OS, ProcList);
579     // Emit the processor lookup data
580     EmitProcessorLookup(OS);
581   }
582 }
583
584 //
585 // ParseFeaturesFunction - Produces a subtarget specific function for parsing
586 // the subtarget features string.
587 //
588 void SubtargetEmitter::ParseFeaturesFunction(raw_ostream &OS) {
589   std::vector<Record*> Features =
590                        Records.getAllDerivedDefinitions("SubtargetFeature");
591   std::sort(Features.begin(), Features.end(), LessRecord());
592
593   OS << "// ParseSubtargetFeatures - Parses features string setting specified\n" 
594      << "// subtarget options.\n" 
595      << "std::string llvm::";
596   OS << Target;
597   OS << "Subtarget::ParseSubtargetFeatures(const std::string &FS,\n"
598      << "                                  const std::string &CPU) {\n"
599      << "  DEBUG(dbgs() << \"\\nFeatures:\" << FS);\n"
600      << "  DEBUG(dbgs() << \"\\nCPU:\" << CPU);\n"
601      << "  SubtargetFeatures Features(FS);\n"
602      << "  Features.setCPUIfNone(CPU);\n"
603      << "  uint32_t Bits =  Features.getBits(SubTypeKV, SubTypeKVSize,\n"
604      << "                                    FeatureKV, FeatureKVSize);\n";
605
606   for (unsigned i = 0; i < Features.size(); i++) {
607     // Next record
608     Record *R = Features[i];
609     const std::string &Instance = R->getName();
610     const std::string &Value = R->getValueAsString("Value");
611     const std::string &Attribute = R->getValueAsString("Attribute");
612
613     if (Value=="true" || Value=="false")
614       OS << "  if ((Bits & " << Instance << ") != 0) "
615          << Attribute << " = " << Value << ";\n";
616     else
617       OS << "  if ((Bits & " << Instance << ") != 0 && " << Attribute << 
618             " < " << Value << ") " << Attribute << " = " << Value << ";\n";
619   }
620
621   if (HasItineraries) {
622     OS << "\n"
623        << "  InstrItinerary *Itinerary = (InstrItinerary *)"
624        <<              "Features.getInfo(ProcItinKV, ProcItinKVSize);\n"
625        << "  InstrItins = InstrItineraryData(Stages, OperandCycles, Itinerary);\n";
626   }
627
628   OS << "  return Features.getCPU();\n"
629      << "}\n";
630 }
631
632 //
633 // SubtargetEmitter::run - Main subtarget enumeration emitter.
634 //
635 void SubtargetEmitter::run(raw_ostream &OS) {
636   Target = CodeGenTarget().getName();
637
638   EmitSourceFileHeader("Subtarget Enumeration Source Fragment", OS);
639
640   OS << "#include \"llvm/Support/Debug.h\"\n";
641   OS << "#include \"llvm/Support/raw_ostream.h\"\n";
642   OS << "#include \"llvm/Target/SubtargetFeature.h\"\n";
643   OS << "#include \"llvm/Target/TargetInstrItineraries.h\"\n\n";
644
645 //  Enumeration(OS, "FuncUnit", true);
646 //  OS<<"\n";
647 //  Enumeration(OS, "InstrItinClass", false);
648 //  OS<<"\n";
649   Enumeration(OS, "SubtargetFeature", true);
650   OS<<"\n";
651   FeatureKeyValues(OS);
652   OS<<"\n";
653   CPUKeyValues(OS);
654   OS<<"\n";
655   EmitData(OS);
656   OS<<"\n";
657   ParseFeaturesFunction(OS);
658 }