@@ -35,11 +35,11 @@ class MachineInstr;
3535class MachineRegisterInfo ;
3636class RegisterClassInfo ;
3737
38- struct RegisterMaskPair {
38+ struct VRegMaskOrUnit {
3939 Register RegUnit; // /< Virtual register or register unit.
4040 LaneBitmask LaneMask;
4141
42- RegisterMaskPair (Register RegUnit, LaneBitmask LaneMask)
42+ VRegMaskOrUnit (Register RegUnit, LaneBitmask LaneMask)
4343 : RegUnit(RegUnit), LaneMask(LaneMask) {}
4444};
4545
@@ -49,8 +49,8 @@ struct RegisterPressure {
4949 std::vector<unsigned > MaxSetPressure;
5050
5151 // / List of live in virtual registers or physical register units.
52- SmallVector<RegisterMaskPair, 8 > LiveInRegs;
53- SmallVector<RegisterMaskPair, 8 > LiveOutRegs;
52+ SmallVector<VRegMaskOrUnit, 8 > LiveInRegs;
53+ SmallVector<VRegMaskOrUnit, 8 > LiveOutRegs;
5454
5555 void dump (const TargetRegisterInfo *TRI) const ;
5656};
@@ -166,13 +166,13 @@ class PressureDiff {
166166class RegisterOperands {
167167public:
168168 // / List of virtual registers and register units read by the instruction.
169- SmallVector<RegisterMaskPair , 8 > Uses;
169+ SmallVector<VRegMaskOrUnit , 8 > Uses;
170170 // / List of virtual registers and register units defined by the
171171 // / instruction which are not dead.
172- SmallVector<RegisterMaskPair , 8 > Defs;
172+ SmallVector<VRegMaskOrUnit , 8 > Defs;
173173 // / List of virtual registers and register units defined by the
174174 // / instruction but dead.
175- SmallVector<RegisterMaskPair , 8 > DeadDefs;
175+ SmallVector<VRegMaskOrUnit , 8 > DeadDefs;
176176
177177 // / Analyze the given instruction \p MI and fill in the Uses, Defs and
178178 // / DeadDefs list based on the MachineOperand flags.
@@ -185,7 +185,7 @@ class RegisterOperands {
185185 void detectDeadDefs (const MachineInstr &MI, const LiveIntervals &LIS);
186186
187187 // / Use liveness information to find out which uses/defs are partially
188- // / undefined/dead and adjust the RegisterMaskPairs accordingly.
188+ // / undefined/dead and adjust the VRegMaskOrUnits accordingly.
189189 // / If \p AddFlagsMI is given then missing read-undef and dead flags will be
190190 // / added to the instruction.
191191 void adjustLaneLiveness (const LiveIntervals &LIS,
@@ -303,7 +303,7 @@ class LiveRegSet {
303303
304304 // / Mark the \p Pair.LaneMask lanes of \p Pair.Reg as live.
305305 // / Returns the previously live lanes of \p Pair.Reg.
306- LaneBitmask insert (RegisterMaskPair Pair) {
306+ LaneBitmask insert (VRegMaskOrUnit Pair) {
307307 unsigned SparseIndex = getSparseIndexFromReg (Pair.RegUnit );
308308 auto InsertRes = Regs.insert (IndexMaskPair (SparseIndex, Pair.LaneMask ));
309309 if (!InsertRes.second ) {
@@ -316,7 +316,7 @@ class LiveRegSet {
316316
317317 // / Clears the \p Pair.LaneMask lanes of \p Pair.Reg (mark them as dead).
318318 // / Returns the previously live lanes of \p Pair.Reg.
319- LaneBitmask erase (RegisterMaskPair Pair) {
319+ LaneBitmask erase (VRegMaskOrUnit Pair) {
320320 unsigned SparseIndex = getSparseIndexFromReg (Pair.RegUnit );
321321 RegSet::iterator I = Regs.find (SparseIndex);
322322 if (I == Regs.end ())
@@ -330,12 +330,11 @@ class LiveRegSet {
330330 return Regs.size ();
331331 }
332332
333- template <typename ContainerT>
334- void appendTo (ContainerT &To) const {
333+ void appendTo (SmallVectorImpl<VRegMaskOrUnit> &To) const {
335334 for (const IndexMaskPair &P : Regs) {
336335 Register Reg = getRegFromSparseIndex (P.Index );
337336 if (P.LaneMask .any ())
338- To.push_back ( RegisterMaskPair ( Reg, P.LaneMask ) );
337+ To.emplace_back ( Reg, P.LaneMask );
339338 }
340339 }
341340};
@@ -409,7 +408,7 @@ class RegPressureTracker {
409408 // / Force liveness of virtual registers or physical register
410409 // / units. Particularly useful to initialize the livein/out state of the
411410 // / tracker before the first call to advance/recede.
412- void addLiveRegs (ArrayRef<RegisterMaskPair > Regs);
411+ void addLiveRegs (ArrayRef<VRegMaskOrUnit > Regs);
413412
414413 // / Get the MI position corresponding to this register pressure.
415414 MachineBasicBlock::const_iterator getPos () const { return CurrPos; }
@@ -421,14 +420,14 @@ class RegPressureTracker {
421420 void setPos (MachineBasicBlock::const_iterator Pos) { CurrPos = Pos; }
422421
423422 // / Recede across the previous instruction.
424- void recede (SmallVectorImpl<RegisterMaskPair > *LiveUses = nullptr );
423+ void recede (SmallVectorImpl<VRegMaskOrUnit > *LiveUses = nullptr );
425424
426425 // / Recede across the previous instruction.
427426 // / This "low-level" variant assumes that recedeSkipDebugValues() was
428427 // / called previously and takes precomputed RegisterOperands for the
429428 // / instruction.
430429 void recede (const RegisterOperands &RegOpers,
431- SmallVectorImpl<RegisterMaskPair > *LiveUses = nullptr );
430+ SmallVectorImpl<VRegMaskOrUnit > *LiveUses = nullptr );
432431
433432 // / Recede until we find an instruction which is not a DebugValue.
434433 void recedeSkipDebugValues ();
@@ -546,21 +545,21 @@ class RegPressureTracker {
546545
547546protected:
548547 // / Add Reg to the live out set and increase max pressure.
549- void discoverLiveOut (RegisterMaskPair Pair);
548+ void discoverLiveOut (VRegMaskOrUnit Pair);
550549 // / Add Reg to the live in set and increase max pressure.
551- void discoverLiveIn (RegisterMaskPair Pair);
550+ void discoverLiveIn (VRegMaskOrUnit Pair);
552551
553552 // / Get the SlotIndex for the first nondebug instruction including or
554553 // / after the current position.
555554 SlotIndex getCurrSlot () const ;
556555
557- void bumpDeadDefs (ArrayRef<RegisterMaskPair > DeadDefs);
556+ void bumpDeadDefs (ArrayRef<VRegMaskOrUnit > DeadDefs);
558557
559558 void bumpUpwardPressure (const MachineInstr *MI);
560559 void bumpDownwardPressure (const MachineInstr *MI);
561560
562- void discoverLiveInOrOut (RegisterMaskPair Pair,
563- SmallVectorImpl<RegisterMaskPair > &LiveInOrOut);
561+ void discoverLiveInOrOut (VRegMaskOrUnit Pair,
562+ SmallVectorImpl<VRegMaskOrUnit > &LiveInOrOut);
564563
565564 LaneBitmask getLastUsedLanes (Register RegUnit, SlotIndex Pos) const ;
566565 LaneBitmask getLiveLanesAt (Register RegUnit, SlotIndex Pos) const ;
0 commit comments