Skip to content

Commit 3ed3c8f

Browse files
committed
fixup! Use VRegMaskOrUnitPair
1 parent 420a2cb commit 3ed3c8f

File tree

7 files changed

+89
-89
lines changed

7 files changed

+89
-89
lines changed

llvm/include/llvm/CodeGen/MachineScheduler.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -525,7 +525,7 @@ class ScheduleDAGMILive : public ScheduleDAGMI {
525525

526526
void initRegPressure();
527527

528-
void updatePressureDiffs(ArrayRef<VRegOrUnitMaskPair> LiveUses);
528+
void updatePressureDiffs(ArrayRef<VRegMaskOrUnitPair> LiveUses);
529529

530530
void updateScheduledPressure(const SUnit *SU,
531531
const std::vector<unsigned> &NewMaxPressure);

llvm/include/llvm/CodeGen/RegisterPressure.h

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@ class MachineInstr;
3535
class MachineRegisterInfo;
3636
class RegisterClassInfo;
3737

38-
struct VRegOrUnitMaskPair {
38+
struct VRegMaskOrUnitPair {
3939
Register RegUnit; ///< Virtual register or register unit.
4040
LaneBitmask LaneMask;
4141

42-
VRegOrUnitMaskPair(Register RegUnit, LaneBitmask LaneMask)
42+
VRegMaskOrUnitPair(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<VRegOrUnitMaskPair, 8> LiveInRegs;
53-
SmallVector<VRegOrUnitMaskPair, 8> LiveOutRegs;
52+
SmallVector<VRegMaskOrUnitPair, 8> LiveInRegs;
53+
SmallVector<VRegMaskOrUnitPair, 8> LiveOutRegs;
5454

5555
void dump(const TargetRegisterInfo *TRI) const;
5656
};
@@ -166,13 +166,13 @@ class PressureDiff {
166166
class RegisterOperands {
167167
public:
168168
/// List of virtual registers and register units read by the instruction.
169-
SmallVector<VRegOrUnitMaskPair, 8> Uses;
169+
SmallVector<VRegMaskOrUnitPair, 8> Uses;
170170
/// List of virtual registers and register units defined by the
171171
/// instruction which are not dead.
172-
SmallVector<VRegOrUnitMaskPair, 8> Defs;
172+
SmallVector<VRegMaskOrUnitPair, 8> Defs;
173173
/// List of virtual registers and register units defined by the
174174
/// instruction but dead.
175-
SmallVector<VRegOrUnitMaskPair, 8> DeadDefs;
175+
SmallVector<VRegMaskOrUnitPair, 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 VRegOrUnitMaskPairs accordingly.
188+
/// undefined/dead and adjust the VRegMaskOrUnitPairs 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(VRegOrUnitMaskPair Pair) {
306+
LaneBitmask insert(VRegMaskOrUnitPair 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(VRegOrUnitMaskPair Pair) {
319+
LaneBitmask erase(VRegMaskOrUnitPair Pair) {
320320
unsigned SparseIndex = getSparseIndexFromReg(Pair.RegUnit);
321321
RegSet::iterator I = Regs.find(SparseIndex);
322322
if (I == Regs.end())
@@ -330,7 +330,7 @@ class LiveRegSet {
330330
return Regs.size();
331331
}
332332

333-
void appendTo(SmallVectorImpl<VRegOrUnitMaskPair> &To) const {
333+
void appendTo(SmallVectorImpl<VRegMaskOrUnitPair> &To) const {
334334
for (const IndexMaskPair &P : Regs) {
335335
Register Reg = getRegFromSparseIndex(P.Index);
336336
if (P.LaneMask.any())
@@ -408,7 +408,7 @@ class RegPressureTracker {
408408
/// Force liveness of virtual registers or physical register
409409
/// units. Particularly useful to initialize the livein/out state of the
410410
/// tracker before the first call to advance/recede.
411-
void addLiveRegs(ArrayRef<VRegOrUnitMaskPair> Regs);
411+
void addLiveRegs(ArrayRef<VRegMaskOrUnitPair> Regs);
412412

413413
/// Get the MI position corresponding to this register pressure.
414414
MachineBasicBlock::const_iterator getPos() const { return CurrPos; }
@@ -420,14 +420,14 @@ class RegPressureTracker {
420420
void setPos(MachineBasicBlock::const_iterator Pos) { CurrPos = Pos; }
421421

422422
/// Recede across the previous instruction.
423-
void recede(SmallVectorImpl<VRegOrUnitMaskPair> *LiveUses = nullptr);
423+
void recede(SmallVectorImpl<VRegMaskOrUnitPair> *LiveUses = nullptr);
424424

425425
/// Recede across the previous instruction.
426426
/// This "low-level" variant assumes that recedeSkipDebugValues() was
427427
/// called previously and takes precomputed RegisterOperands for the
428428
/// instruction.
429429
void recede(const RegisterOperands &RegOpers,
430-
SmallVectorImpl<VRegOrUnitMaskPair> *LiveUses = nullptr);
430+
SmallVectorImpl<VRegMaskOrUnitPair> *LiveUses = nullptr);
431431

432432
/// Recede until we find an instruction which is not a DebugValue.
433433
void recedeSkipDebugValues();
@@ -545,21 +545,21 @@ class RegPressureTracker {
545545

546546
protected:
547547
/// Add Reg to the live out set and increase max pressure.
548-
void discoverLiveOut(VRegOrUnitMaskPair Pair);
548+
void discoverLiveOut(VRegMaskOrUnitPair Pair);
549549
/// Add Reg to the live in set and increase max pressure.
550-
void discoverLiveIn(VRegOrUnitMaskPair Pair);
550+
void discoverLiveIn(VRegMaskOrUnitPair Pair);
551551

552552
/// Get the SlotIndex for the first nondebug instruction including or
553553
/// after the current position.
554554
SlotIndex getCurrSlot() const;
555555

556-
void bumpDeadDefs(ArrayRef<VRegOrUnitMaskPair> DeadDefs);
556+
void bumpDeadDefs(ArrayRef<VRegMaskOrUnitPair> DeadDefs);
557557

558558
void bumpUpwardPressure(const MachineInstr *MI);
559559
void bumpDownwardPressure(const MachineInstr *MI);
560560

561-
void discoverLiveInOrOut(VRegOrUnitMaskPair Pair,
562-
SmallVectorImpl<VRegOrUnitMaskPair> &LiveInOrOut);
561+
void discoverLiveInOrOut(VRegMaskOrUnitPair Pair,
562+
SmallVectorImpl<VRegMaskOrUnitPair> &LiveInOrOut);
563563

564564
LaneBitmask getLastUsedLanes(Register RegUnit, SlotIndex Pos) const;
565565
LaneBitmask getLiveLanesAt(Register RegUnit, SlotIndex Pos) const;

llvm/lib/CodeGen/MachinePipeliner.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1981,7 +1981,7 @@ static void computeLiveOuts(MachineFunction &MF, RegPressureTracker &RPTracker,
19811981
NodeSet &NS) {
19821982
const TargetRegisterInfo *TRI = MF.getSubtarget().getRegisterInfo();
19831983
MachineRegisterInfo &MRI = MF.getRegInfo();
1984-
SmallVector<VRegOrUnitMaskPair, 8> LiveOutRegs;
1984+
SmallVector<VRegMaskOrUnitPair, 8> LiveOutRegs;
19851985
SmallSet<unsigned, 4> Uses;
19861986
for (SUnit *SU : NS) {
19871987
const MachineInstr *MI = SU->getInstr();

llvm/lib/CodeGen/MachineScheduler.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1288,7 +1288,7 @@ void ScheduleDAGMILive::initRegPressure() {
12881288

12891289
// Account for liveness generated by the region boundary.
12901290
if (LiveRegionEnd != RegionEnd) {
1291-
SmallVector<VRegOrUnitMaskPair, 8> LiveUses;
1291+
SmallVector<VRegMaskOrUnitPair, 8> LiveUses;
12921292
BotRPTracker.recede(&LiveUses);
12931293
updatePressureDiffs(LiveUses);
12941294
}
@@ -1353,8 +1353,8 @@ updateScheduledPressure(const SUnit *SU,
13531353
/// Update the PressureDiff array for liveness after scheduling this
13541354
/// instruction.
13551355
void ScheduleDAGMILive::updatePressureDiffs(
1356-
ArrayRef<VRegOrUnitMaskPair> LiveUses) {
1357-
for (const VRegOrUnitMaskPair &P : LiveUses) {
1356+
ArrayRef<VRegMaskOrUnitPair> LiveUses) {
1357+
for (const VRegMaskOrUnitPair &P : LiveUses) {
13581358
Register Reg = P.RegUnit;
13591359
/// FIXME: Currently assuming single-use physregs.
13601360
if (!Reg.isVirtual())
@@ -1579,7 +1579,7 @@ unsigned ScheduleDAGMILive::computeCyclicCriticalPath() {
15791579

15801580
unsigned MaxCyclicLatency = 0;
15811581
// Visit each live out vreg def to find def/use pairs that cross iterations.
1582-
for (const VRegOrUnitMaskPair &P : RPTracker.getPressure().LiveOutRegs) {
1582+
for (const VRegMaskOrUnitPair &P : RPTracker.getPressure().LiveOutRegs) {
15831583
Register Reg = P.RegUnit;
15841584
if (!Reg.isVirtual())
15851585
continue;
@@ -1707,7 +1707,7 @@ void ScheduleDAGMILive::scheduleMI(SUnit *SU, bool IsTopNode) {
17071707

17081708
if (BotRPTracker.getPos() != CurrentBottom)
17091709
BotRPTracker.recedeSkipDebugValues();
1710-
SmallVector<VRegOrUnitMaskPair, 8> LiveUses;
1710+
SmallVector<VRegMaskOrUnitPair, 8> LiveUses;
17111711
BotRPTracker.recede(RegOpers, &LiveUses);
17121712
assert(BotRPTracker.getPos() == CurrentBottom && "out of sync");
17131713
LLVM_DEBUG(dbgs() << "Bottom Pressure:\n"; dumpRegSetPressure(

0 commit comments

Comments
 (0)