Skip to content

Commit 68b1fe8

Browse files
committed
[LivePhysRegs] Use MCRegister instead of MCPhysReg in interface. NFC
1 parent 6d89c04 commit 68b1fe8

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

llvm/include/llvm/CodeGen/LivePhysRegs.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ class LivePhysRegs {
8080
bool empty() const { return LiveRegs.empty(); }
8181

8282
/// Adds a physical register and all its sub-registers to the set.
83-
void addReg(MCPhysReg Reg) {
83+
void addReg(MCRegister Reg) {
8484
assert(TRI && "LivePhysRegs is not initialized.");
8585
assert(Reg < TRI->getNumRegs() && "Expected a physical register.");
8686
for (MCPhysReg SubReg : TRI->subregs_inclusive(Reg))
@@ -89,7 +89,7 @@ class LivePhysRegs {
8989

9090
/// Removes a physical register, all its sub-registers, and all its
9191
/// super-registers from the set.
92-
void removeReg(MCPhysReg Reg) {
92+
void removeReg(MCRegister Reg) {
9393
assert(TRI && "LivePhysRegs is not initialized.");
9494
assert(Reg < TRI->getNumRegs() && "Expected a physical register.");
9595
for (MCRegAliasIterator R(Reg, TRI, true); R.isValid(); ++R)
@@ -106,10 +106,10 @@ class LivePhysRegs {
106106
/// addReg() always adds all sub-registers to the set as well.
107107
/// Note: Returns false if just some sub registers are live, use available()
108108
/// when searching a free register.
109-
bool contains(MCPhysReg Reg) const { return LiveRegs.count(Reg); }
109+
bool contains(MCRegister Reg) const { return LiveRegs.count(Reg.id()); }
110110

111111
/// Returns true if register \p Reg and no aliasing register is in the set.
112-
bool available(const MachineRegisterInfo &MRI, MCPhysReg Reg) const;
112+
bool available(const MachineRegisterInfo &MRI, MCRegister Reg) const;
113113

114114
/// Remove defined registers and regmask kills from the set.
115115
void removeDefs(const MachineInstr &MI);

llvm/lib/CodeGen/AggressiveAntiDepBreaker.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ void AggressiveAntiDepBreaker::GetPassthruRegs(
254254
/// AntiDepEdges - Return in Edges the anti- and output- dependencies
255255
/// in SU that we want to consider for breaking.
256256
static void AntiDepEdges(const SUnit *SU, std::vector<const SDep *> &Edges) {
257-
SmallSet<unsigned, 4> RegSet;
257+
SmallSet<Register, 4> RegSet;
258258
for (const SDep &Pred : SU->Preds) {
259259
if ((Pred.getKind() == SDep::Anti) || (Pred.getKind() == SDep::Output)) {
260260
if (RegSet.insert(Pred.getReg()).second)

llvm/lib/CodeGen/LivePhysRegs.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,8 @@ LLVM_DUMP_METHOD void LivePhysRegs::dump() const {
139139
#endif
140140

141141
bool LivePhysRegs::available(const MachineRegisterInfo &MRI,
142-
MCPhysReg Reg) const {
143-
if (LiveRegs.count(Reg))
142+
MCRegister Reg) const {
143+
if (LiveRegs.count(Reg.id()))
144144
return false;
145145
if (MRI.isReserved(Reg))
146146
return false;

0 commit comments

Comments
 (0)