Sort the #include lines for utils/...
[oota-llvm.git] / utils / TableGen / CodeGenRegisters.h
1 //===- CodeGenRegisters.h - Register and RegisterClass Info -----*- C++ -*-===//
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 file defines structures to encapsulate information gleaned from the
11 // target register and register class definitions.
12 //
13 //===----------------------------------------------------------------------===//
14
15 #ifndef CODEGEN_REGISTERS_H
16 #define CODEGEN_REGISTERS_H
17
18 #include "SetTheory.h"
19 #include "llvm/ADT/ArrayRef.h"
20 #include "llvm/ADT/BitVector.h"
21 #include "llvm/ADT/DenseMap.h"
22 #include "llvm/ADT/SetVector.h"
23 #include "llvm/CodeGen/ValueTypes.h"
24 #include "llvm/Support/ErrorHandling.h"
25 #include "llvm/TableGen/Record.h"
26 #include <cstdlib>
27 #include <map>
28 #include <set>
29 #include <string>
30 #include <vector>
31
32 namespace llvm {
33   class CodeGenRegBank;
34
35   /// CodeGenSubRegIndex - Represents a sub-register index.
36   class CodeGenSubRegIndex {
37     Record *const TheDef;
38     std::string Name;
39     std::string Namespace;
40
41   public:
42     const unsigned EnumValue;
43     unsigned LaneMask;
44
45     CodeGenSubRegIndex(Record *R, unsigned Enum);
46     CodeGenSubRegIndex(StringRef N, StringRef Nspace, unsigned Enum);
47
48     const std::string &getName() const { return Name; }
49     const std::string &getNamespace() const { return Namespace; }
50     std::string getQualifiedName() const;
51
52     // Order CodeGenSubRegIndex pointers by EnumValue.
53     struct Less {
54       bool operator()(const CodeGenSubRegIndex *A,
55                       const CodeGenSubRegIndex *B) const {
56         assert(A && B);
57         return A->EnumValue < B->EnumValue;
58       }
59     };
60
61     // Map of composite subreg indices.
62     typedef std::map<CodeGenSubRegIndex*, CodeGenSubRegIndex*, Less> CompMap;
63
64     // Returns the subreg index that results from composing this with Idx.
65     // Returns NULL if this and Idx don't compose.
66     CodeGenSubRegIndex *compose(CodeGenSubRegIndex *Idx) const {
67       CompMap::const_iterator I = Composed.find(Idx);
68       return I == Composed.end() ? 0 : I->second;
69     }
70
71     // Add a composite subreg index: this+A = B.
72     // Return a conflicting composite, or NULL
73     CodeGenSubRegIndex *addComposite(CodeGenSubRegIndex *A,
74                                      CodeGenSubRegIndex *B) {
75       assert(A && B);
76       std::pair<CompMap::iterator, bool> Ins =
77         Composed.insert(std::make_pair(A, B));
78       return (Ins.second || Ins.first->second == B) ? 0 : Ins.first->second;
79     }
80
81     // Update the composite maps of components specified in 'ComposedOf'.
82     void updateComponents(CodeGenRegBank&);
83
84     // Return the map of composites.
85     const CompMap &getComposites() const { return Composed; }
86
87     // Compute LaneMask from Composed. Return LaneMask.
88     unsigned computeLaneMask();
89
90   private:
91     CompMap Composed;
92   };
93
94   /// CodeGenRegister - Represents a register definition.
95   struct CodeGenRegister {
96     Record *TheDef;
97     unsigned EnumValue;
98     unsigned CostPerUse;
99     bool CoveredBySubRegs;
100
101     // Map SubRegIndex -> Register.
102     typedef std::map<CodeGenSubRegIndex*, CodeGenRegister*,
103                      CodeGenSubRegIndex::Less> SubRegMap;
104
105     CodeGenRegister(Record *R, unsigned Enum);
106
107     const std::string &getName() const;
108
109     // Extract more information from TheDef. This is used to build an object
110     // graph after all CodeGenRegister objects have been created.
111     void buildObjectGraph(CodeGenRegBank&);
112
113     // Lazily compute a map of all sub-registers.
114     // This includes unique entries for all sub-sub-registers.
115     const SubRegMap &computeSubRegs(CodeGenRegBank&);
116
117     // Compute extra sub-registers by combining the existing sub-registers.
118     void computeSecondarySubRegs(CodeGenRegBank&);
119
120     // Add this as a super-register to all sub-registers after the sub-register
121     // graph has been built.
122     void computeSuperRegs(CodeGenRegBank&);
123
124     const SubRegMap &getSubRegs() const {
125       assert(SubRegsComplete && "Must precompute sub-registers");
126       return SubRegs;
127     }
128
129     // Add sub-registers to OSet following a pre-order defined by the .td file.
130     void addSubRegsPreOrder(SetVector<const CodeGenRegister*> &OSet,
131                             CodeGenRegBank&) const;
132
133     // Return the sub-register index naming Reg as a sub-register of this
134     // register. Returns NULL if Reg is not a sub-register.
135     CodeGenSubRegIndex *getSubRegIndex(const CodeGenRegister *Reg) const {
136       return SubReg2Idx.lookup(Reg);
137     }
138
139     typedef std::vector<const CodeGenRegister*> SuperRegList;
140
141     // Get the list of super-registers in topological order, small to large.
142     // This is valid after computeSubRegs visits all registers during RegBank
143     // construction.
144     const SuperRegList &getSuperRegs() const {
145       assert(SubRegsComplete && "Must precompute sub-registers");
146       return SuperRegs;
147     }
148
149     // Get the list of ad hoc aliases. The graph is symmetric, so the list
150     // contains all registers in 'Aliases', and all registers that mention this
151     // register in 'Aliases'.
152     ArrayRef<CodeGenRegister*> getExplicitAliases() const {
153       return ExplicitAliases;
154     }
155
156     // Get the topological signature of this register. This is a small integer
157     // less than RegBank.getNumTopoSigs(). Registers with the same TopoSig have
158     // identical sub-register structure. That is, they support the same set of
159     // sub-register indices mapping to the same kind of sub-registers
160     // (TopoSig-wise).
161     unsigned getTopoSig() const {
162       assert(SuperRegsComplete && "TopoSigs haven't been computed yet.");
163       return TopoSig;
164     }
165
166     // List of register units in ascending order.
167     typedef SmallVector<unsigned, 16> RegUnitList;
168
169     // How many entries in RegUnitList are native?
170     unsigned NumNativeRegUnits;
171
172     // Get the list of register units.
173     // This is only valid after computeSubRegs() completes.
174     const RegUnitList &getRegUnits() const { return RegUnits; }
175
176     // Get the native register units. This is a prefix of getRegUnits().
177     ArrayRef<unsigned> getNativeRegUnits() const {
178       return makeArrayRef(RegUnits).slice(0, NumNativeRegUnits);
179     }
180
181     // Inherit register units from subregisters.
182     // Return true if the RegUnits changed.
183     bool inheritRegUnits(CodeGenRegBank &RegBank);
184
185     // Adopt a register unit for pressure tracking.
186     // A unit is adopted iff its unit number is >= NumNativeRegUnits.
187     void adoptRegUnit(unsigned RUID) { RegUnits.push_back(RUID); }
188
189     // Get the sum of this register's register unit weights.
190     unsigned getWeight(const CodeGenRegBank &RegBank) const;
191
192     // Order CodeGenRegister pointers by EnumValue.
193     struct Less {
194       bool operator()(const CodeGenRegister *A,
195                       const CodeGenRegister *B) const {
196         assert(A && B);
197         return A->EnumValue < B->EnumValue;
198       }
199     };
200
201     // Canonically ordered set.
202     typedef std::set<const CodeGenRegister*, Less> Set;
203
204     // Compute the set of registers overlapping this.
205     void computeOverlaps(Set &Overlaps, const CodeGenRegBank&) const;
206
207   private:
208     bool SubRegsComplete;
209     bool SuperRegsComplete;
210     unsigned TopoSig;
211
212     // The sub-registers explicit in the .td file form a tree.
213     SmallVector<CodeGenSubRegIndex*, 8> ExplicitSubRegIndices;
214     SmallVector<CodeGenRegister*, 8> ExplicitSubRegs;
215
216     // Explicit ad hoc aliases, symmetrized to form an undirected graph.
217     SmallVector<CodeGenRegister*, 8> ExplicitAliases;
218
219     // Super-registers where this is the first explicit sub-register.
220     SuperRegList LeadingSuperRegs;
221
222     SubRegMap SubRegs;
223     SuperRegList SuperRegs;
224     DenseMap<const CodeGenRegister*, CodeGenSubRegIndex*> SubReg2Idx;
225     RegUnitList RegUnits;
226   };
227
228
229   class CodeGenRegisterClass {
230     CodeGenRegister::Set Members;
231     // Allocation orders. Order[0] always contains all registers in Members.
232     std::vector<SmallVector<Record*, 16> > Orders;
233     // Bit mask of sub-classes including this, indexed by their EnumValue.
234     BitVector SubClasses;
235     // List of super-classes, topologocally ordered to have the larger classes
236     // first.  This is the same as sorting by EnumValue.
237     SmallVector<CodeGenRegisterClass*, 4> SuperClasses;
238     Record *TheDef;
239     std::string Name;
240
241     // For a synthesized class, inherit missing properties from the nearest
242     // super-class.
243     void inheritProperties(CodeGenRegBank&);
244
245     // Map SubRegIndex -> sub-class.  This is the largest sub-class where all
246     // registers have a SubRegIndex sub-register.
247     DenseMap<CodeGenSubRegIndex*, CodeGenRegisterClass*> SubClassWithSubReg;
248
249     // Map SubRegIndex -> set of super-reg classes.  This is all register
250     // classes SuperRC such that:
251     //
252     //   R:SubRegIndex in this RC for all R in SuperRC.
253     //
254     DenseMap<CodeGenSubRegIndex*,
255              SmallPtrSet<CodeGenRegisterClass*, 8> > SuperRegClasses;
256
257     // Bit vector of TopoSigs for the registers in this class. This will be
258     // very sparse on regular architectures.
259     BitVector TopoSigs;
260
261   public:
262     unsigned EnumValue;
263     std::string Namespace;
264     std::vector<MVT::SimpleValueType> VTs;
265     unsigned SpillSize;
266     unsigned SpillAlignment;
267     int CopyCost;
268     bool Allocatable;
269     std::string AltOrderSelect;
270
271     // Return the Record that defined this class, or NULL if the class was
272     // created by TableGen.
273     Record *getDef() const { return TheDef; }
274
275     const std::string &getName() const { return Name; }
276     std::string getQualifiedName() const;
277     const std::vector<MVT::SimpleValueType> &getValueTypes() const {return VTs;}
278     unsigned getNumValueTypes() const { return VTs.size(); }
279
280     MVT::SimpleValueType getValueTypeNum(unsigned VTNum) const {
281       if (VTNum < VTs.size())
282         return VTs[VTNum];
283       llvm_unreachable("VTNum greater than number of ValueTypes in RegClass!");
284     }
285
286     // Return true if this this class contains the register.
287     bool contains(const CodeGenRegister*) const;
288
289     // Returns true if RC is a subclass.
290     // RC is a sub-class of this class if it is a valid replacement for any
291     // instruction operand where a register of this classis required. It must
292     // satisfy these conditions:
293     //
294     // 1. All RC registers are also in this.
295     // 2. The RC spill size must not be smaller than our spill size.
296     // 3. RC spill alignment must be compatible with ours.
297     //
298     bool hasSubClass(const CodeGenRegisterClass *RC) const {
299       return SubClasses.test(RC->EnumValue);
300     }
301
302     // getSubClassWithSubReg - Returns the largest sub-class where all
303     // registers have a SubIdx sub-register.
304     CodeGenRegisterClass*
305     getSubClassWithSubReg(CodeGenSubRegIndex *SubIdx) const {
306       return SubClassWithSubReg.lookup(SubIdx);
307     }
308
309     void setSubClassWithSubReg(CodeGenSubRegIndex *SubIdx,
310                                CodeGenRegisterClass *SubRC) {
311       SubClassWithSubReg[SubIdx] = SubRC;
312     }
313
314     // getSuperRegClasses - Returns a bit vector of all register classes
315     // containing only SubIdx super-registers of this class.
316     void getSuperRegClasses(CodeGenSubRegIndex *SubIdx, BitVector &Out) const;
317
318     // addSuperRegClass - Add a class containing only SudIdx super-registers.
319     void addSuperRegClass(CodeGenSubRegIndex *SubIdx,
320                           CodeGenRegisterClass *SuperRC) {
321       SuperRegClasses[SubIdx].insert(SuperRC);
322     }
323
324     // getSubClasses - Returns a constant BitVector of subclasses indexed by
325     // EnumValue.
326     // The SubClasses vector includs an entry for this class.
327     const BitVector &getSubClasses() const { return SubClasses; }
328
329     // getSuperClasses - Returns a list of super classes ordered by EnumValue.
330     // The array does not include an entry for this class.
331     ArrayRef<CodeGenRegisterClass*> getSuperClasses() const {
332       return SuperClasses;
333     }
334
335     // Returns an ordered list of class members.
336     // The order of registers is the same as in the .td file.
337     // No = 0 is the default allocation order, No = 1 is the first alternative.
338     ArrayRef<Record*> getOrder(unsigned No = 0) const {
339         return Orders[No];
340     }
341
342     // Return the total number of allocation orders available.
343     unsigned getNumOrders() const { return Orders.size(); }
344
345     // Get the set of registers.  This set contains the same registers as
346     // getOrder(0).
347     const CodeGenRegister::Set &getMembers() const { return Members; }
348
349     // Get a bit vector of TopoSigs present in this register class.
350     const BitVector &getTopoSigs() const { return TopoSigs; }
351
352     // Populate a unique sorted list of units from a register set.
353     void buildRegUnitSet(std::vector<unsigned> &RegUnits) const;
354
355     CodeGenRegisterClass(CodeGenRegBank&, Record *R);
356
357     // A key representing the parts of a register class used for forming
358     // sub-classes.  Note the ordering provided by this key is not the same as
359     // the topological order used for the EnumValues.
360     struct Key {
361       const CodeGenRegister::Set *Members;
362       unsigned SpillSize;
363       unsigned SpillAlignment;
364
365       Key(const Key &O)
366         : Members(O.Members),
367           SpillSize(O.SpillSize),
368           SpillAlignment(O.SpillAlignment) {}
369
370       Key(const CodeGenRegister::Set *M, unsigned S = 0, unsigned A = 0)
371         : Members(M), SpillSize(S), SpillAlignment(A) {}
372
373       Key(const CodeGenRegisterClass &RC)
374         : Members(&RC.getMembers()),
375           SpillSize(RC.SpillSize),
376           SpillAlignment(RC.SpillAlignment) {}
377
378       // Lexicographical order of (Members, SpillSize, SpillAlignment).
379       bool operator<(const Key&) const;
380     };
381
382     // Create a non-user defined register class.
383     CodeGenRegisterClass(CodeGenRegBank&, StringRef Name, Key Props);
384
385     // Called by CodeGenRegBank::CodeGenRegBank().
386     static void computeSubClasses(CodeGenRegBank&);
387   };
388
389   // Register units are used to model interference and register pressure.
390   // Every register is assigned one or more register units such that two
391   // registers overlap if and only if they have a register unit in common.
392   //
393   // Normally, one register unit is created per leaf register. Non-leaf
394   // registers inherit the units of their sub-registers.
395   struct RegUnit {
396     // Weight assigned to this RegUnit for estimating register pressure.
397     // This is useful when equalizing weights in register classes with mixed
398     // register topologies.
399     unsigned Weight;
400
401     // Each native RegUnit corresponds to one or two root registers. The full
402     // set of registers containing this unit can be computed as the union of
403     // these two registers and their super-registers.
404     const CodeGenRegister *Roots[2];
405
406     RegUnit() : Weight(0) { Roots[0] = Roots[1] = 0; }
407
408     ArrayRef<const CodeGenRegister*> getRoots() const {
409       assert(!(Roots[1] && !Roots[0]) && "Invalid roots array");
410       return makeArrayRef(Roots, !!Roots[0] + !!Roots[1]);
411     }
412   };
413
414   // Each RegUnitSet is a sorted vector with a name.
415   struct RegUnitSet {
416     typedef std::vector<unsigned>::const_iterator iterator;
417
418     std::string Name;
419     std::vector<unsigned> Units;
420   };
421
422   // Base vector for identifying TopoSigs. The contents uniquely identify a
423   // TopoSig, only computeSuperRegs needs to know how.
424   typedef SmallVector<unsigned, 16> TopoSigId;
425
426   // CodeGenRegBank - Represent a target's registers and the relations between
427   // them.
428   class CodeGenRegBank {
429     SetTheory Sets;
430
431     // SubRegIndices.
432     std::vector<CodeGenSubRegIndex*> SubRegIndices;
433     DenseMap<Record*, CodeGenSubRegIndex*> Def2SubRegIdx;
434
435     CodeGenSubRegIndex *createSubRegIndex(StringRef Name, StringRef NameSpace);
436
437     typedef std::map<SmallVector<CodeGenSubRegIndex*, 8>,
438                      CodeGenSubRegIndex*> ConcatIdxMap;
439     ConcatIdxMap ConcatIdx;
440
441     // Registers.
442     std::vector<CodeGenRegister*> Registers;
443     StringMap<CodeGenRegister*> RegistersByName;
444     DenseMap<Record*, CodeGenRegister*> Def2Reg;
445     unsigned NumNativeRegUnits;
446
447     std::map<TopoSigId, unsigned> TopoSigs;
448
449     // Includes native (0..NumNativeRegUnits-1) and adopted register units.
450     SmallVector<RegUnit, 8> RegUnits;
451
452     // Register classes.
453     std::vector<CodeGenRegisterClass*> RegClasses;
454     DenseMap<Record*, CodeGenRegisterClass*> Def2RC;
455     typedef std::map<CodeGenRegisterClass::Key, CodeGenRegisterClass*> RCKeyMap;
456     RCKeyMap Key2RC;
457
458     // Remember each unique set of register units. Initially, this contains a
459     // unique set for each register class. Simliar sets are coalesced with
460     // pruneUnitSets and new supersets are inferred during computeRegUnitSets.
461     std::vector<RegUnitSet> RegUnitSets;
462
463     // Map RegisterClass index to the index of the RegUnitSet that contains the
464     // class's units and any inferred RegUnit supersets.
465     std::vector<std::vector<unsigned> > RegClassUnitSets;
466
467     // Add RC to *2RC maps.
468     void addToMaps(CodeGenRegisterClass*);
469
470     // Create a synthetic sub-class if it is missing.
471     CodeGenRegisterClass *getOrCreateSubClass(const CodeGenRegisterClass *RC,
472                                               const CodeGenRegister::Set *Membs,
473                                               StringRef Name);
474
475     // Infer missing register classes.
476     void computeInferredRegisterClasses();
477     void inferCommonSubClass(CodeGenRegisterClass *RC);
478     void inferSubClassWithSubReg(CodeGenRegisterClass *RC);
479     void inferMatchingSuperRegClass(CodeGenRegisterClass *RC,
480                                     unsigned FirstSubRegRC = 0);
481
482     // Iteratively prune unit sets.
483     void pruneUnitSets();
484
485     // Compute a weight for each register unit created during getSubRegs.
486     void computeRegUnitWeights();
487
488     // Create a RegUnitSet for each RegClass and infer superclasses.
489     void computeRegUnitSets();
490
491     // Populate the Composite map from sub-register relationships.
492     void computeComposites();
493
494     // Compute a lane mask for each sub-register index.
495     void computeSubRegIndexLaneMasks();
496
497   public:
498     CodeGenRegBank(RecordKeeper&);
499
500     SetTheory &getSets() { return Sets; }
501
502     // Sub-register indices. The first NumNamedIndices are defined by the user
503     // in the .td files. The rest are synthesized such that all sub-registers
504     // have a unique name.
505     ArrayRef<CodeGenSubRegIndex*> getSubRegIndices() { return SubRegIndices; }
506
507     // Find a SubRegIndex form its Record def.
508     CodeGenSubRegIndex *getSubRegIdx(Record*);
509
510     // Find or create a sub-register index representing the A+B composition.
511     CodeGenSubRegIndex *getCompositeSubRegIndex(CodeGenSubRegIndex *A,
512                                                 CodeGenSubRegIndex *B);
513
514     // Find or create a sub-register index representing the concatenation of
515     // non-overlapping sibling indices.
516     CodeGenSubRegIndex *
517       getConcatSubRegIndex(const SmallVector<CodeGenSubRegIndex*, 8>&);
518
519     void
520     addConcatSubRegIndex(const SmallVector<CodeGenSubRegIndex*, 8> &Parts,
521                          CodeGenSubRegIndex *Idx) {
522       ConcatIdx.insert(std::make_pair(Parts, Idx));
523     }
524
525     const std::vector<CodeGenRegister*> &getRegisters() { return Registers; }
526     const StringMap<CodeGenRegister*> &getRegistersByName() {
527       return RegistersByName;
528     }
529
530     // Find a register from its Record def.
531     CodeGenRegister *getReg(Record*);
532
533     // Get a Register's index into the Registers array.
534     unsigned getRegIndex(const CodeGenRegister *Reg) const {
535       return Reg->EnumValue - 1;
536     }
537
538     // Return the number of allocated TopoSigs. The first TopoSig representing
539     // leaf registers is allocated number 0.
540     unsigned getNumTopoSigs() const {
541       return TopoSigs.size();
542     }
543
544     // Find or create a TopoSig for the given TopoSigId.
545     // This function is only for use by CodeGenRegister::computeSuperRegs().
546     // Others should simply use Reg->getTopoSig().
547     unsigned getTopoSig(const TopoSigId &Id) {
548       return TopoSigs.insert(std::make_pair(Id, TopoSigs.size())).first->second;
549     }
550
551     // Create a native register unit that is associated with one or two root
552     // registers.
553     unsigned newRegUnit(CodeGenRegister *R0, CodeGenRegister *R1 = 0) {
554       RegUnits.resize(RegUnits.size() + 1);
555       RegUnits.back().Roots[0] = R0;
556       RegUnits.back().Roots[1] = R1;
557       return RegUnits.size() - 1;
558     }
559
560     // Create a new non-native register unit that can be adopted by a register
561     // to increase its pressure. Note that NumNativeRegUnits is not increased.
562     unsigned newRegUnit(unsigned Weight) {
563       RegUnits.resize(RegUnits.size() + 1);
564       RegUnits.back().Weight = Weight;
565       return RegUnits.size() - 1;
566     }
567
568     // Native units are the singular unit of a leaf register. Register aliasing
569     // is completely characterized by native units. Adopted units exist to give
570     // register additional weight but don't affect aliasing.
571     bool isNativeUnit(unsigned RUID) {
572       return RUID < NumNativeRegUnits;
573     }
574
575     unsigned getNumNativeRegUnits() const {
576       return NumNativeRegUnits;
577     }
578
579     RegUnit &getRegUnit(unsigned RUID) { return RegUnits[RUID]; }
580     const RegUnit &getRegUnit(unsigned RUID) const { return RegUnits[RUID]; }
581
582     ArrayRef<CodeGenRegisterClass*> getRegClasses() const {
583       return RegClasses;
584     }
585
586     // Find a register class from its def.
587     CodeGenRegisterClass *getRegClass(Record*);
588
589     /// getRegisterClassForRegister - Find the register class that contains the
590     /// specified physical register.  If the register is not in a register
591     /// class, return null. If the register is in multiple classes, and the
592     /// classes have a superset-subset relationship and the same set of types,
593     /// return the superclass.  Otherwise return null.
594     const CodeGenRegisterClass* getRegClassForRegister(Record *R);
595
596     // Get the sum of unit weights.
597     unsigned getRegUnitSetWeight(const std::vector<unsigned> &Units) const {
598       unsigned Weight = 0;
599       for (std::vector<unsigned>::const_iterator
600              I = Units.begin(), E = Units.end(); I != E; ++I)
601         Weight += getRegUnit(*I).Weight;
602       return Weight;
603     }
604
605     // Increase a RegUnitWeight.
606     void increaseRegUnitWeight(unsigned RUID, unsigned Inc) {
607       getRegUnit(RUID).Weight += Inc;
608     }
609
610     // Get the number of register pressure dimensions.
611     unsigned getNumRegPressureSets() const { return RegUnitSets.size(); }
612
613     // Get a set of register unit IDs for a given dimension of pressure.
614     RegUnitSet getRegPressureSet(unsigned Idx) const {
615       return RegUnitSets[Idx];
616     }
617
618     // Get a list of pressure set IDs for a register class. Liveness of a
619     // register in this class impacts each pressure set in this list by the
620     // weight of the register. An exact solution requires all registers in a
621     // class to have the same class, but it is not strictly guaranteed.
622     ArrayRef<unsigned> getRCPressureSetIDs(unsigned RCIdx) const {
623       return RegClassUnitSets[RCIdx];
624     }
625
626     // Computed derived records such as missing sub-register indices.
627     void computeDerivedInfo();
628
629     // Compute the set of registers completely covered by the registers in Regs.
630     // The returned BitVector will have a bit set for each register in Regs,
631     // all sub-registers, and all super-registers that are covered by the
632     // registers in Regs.
633     //
634     // This is used to compute the mask of call-preserved registers from a list
635     // of callee-saves.
636     BitVector computeCoveredRegisters(ArrayRef<Record*> Regs);
637   };
638 }
639
640 #endif