Skip to content

Commit bdf50f0

Browse files
committed
[CodeGen] Use Register or MCRegister. NFC
1 parent d0b8f5d commit bdf50f0

19 files changed

+36
-38
lines changed

llvm/include/llvm/CodeGen/DetectDeadLanes.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ namespace llvm {
3737
class MachineInstr;
3838
class MachineOperand;
3939
class MachineRegisterInfo;
40+
class Register;
4041
class TargetRegisterInfo;
4142

4243
class DeadLaneDetector {
@@ -92,8 +93,8 @@ class DeadLaneDetector {
9293
const MachineOperand &MO) const;
9394

9495
private:
95-
LaneBitmask determineInitialDefinedLanes(unsigned Reg);
96-
LaneBitmask determineInitialUsedLanes(unsigned Reg);
96+
LaneBitmask determineInitialDefinedLanes(Register Reg);
97+
LaneBitmask determineInitialUsedLanes(Register Reg);
9798

9899
const MachineRegisterInfo *MRI;
99100
const TargetRegisterInfo *TRI;

llvm/include/llvm/CodeGen/ExecutionDomainFix.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ class ExecutionDomainFix : public MachineFunctionPass {
156156
/// Translate TRI register number to a list of indices into our smaller tables
157157
/// of interesting registers.
158158
iterator_range<SmallVectorImpl<int>::const_iterator>
159-
regIndices(unsigned Reg) const;
159+
regIndices(MCRegister Reg) const;
160160

161161
/// DomainValue allocation.
162162
DomainValue *alloc(int domain = -1);

llvm/include/llvm/CodeGen/LiveRangeCalc.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ class LiveRangeCalc {
147147
///
148148
/// PhysReg, when set, is used to verify live-in lists on basic blocks.
149149
bool findReachingDefs(LiveRange &LR, MachineBasicBlock &UseMBB, SlotIndex Use,
150-
unsigned PhysReg, ArrayRef<SlotIndex> Undefs);
150+
Register PhysReg, ArrayRef<SlotIndex> Undefs);
151151

152152
/// updateSSA - Compute the values that will be live in to all requested
153153
/// blocks in LiveIn. Create PHI-def values as required to preserve SSA form.
@@ -204,7 +204,7 @@ class LiveRangeCalc {
204204
/// inserted as required to preserve SSA form.
205205
///
206206
/// PhysReg, when set, is used to verify live-in lists on basic blocks.
207-
void extend(LiveRange &LR, SlotIndex Use, unsigned PhysReg,
207+
void extend(LiveRange &LR, SlotIndex Use, Register PhysReg,
208208
ArrayRef<SlotIndex> Undefs);
209209

210210
//===--------------------------------------------------------------------===//

llvm/include/llvm/CodeGen/LiveRegMatrix.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ class LiveRegMatrix {
5656

5757
// Cached register mask interference info.
5858
unsigned RegMaskTag = 0;
59-
unsigned RegMaskVirtReg = 0;
59+
Register RegMaskVirtReg;
6060
BitVector RegMaskUsable;
6161

6262
LiveRegMatrix()

llvm/include/llvm/CodeGen/LiveVariables.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ class LiveVariables {
135135
// register references are presumed dead across basic blocks.
136136
std::vector<MachineInstr *> PhysRegUse;
137137

138-
std::vector<SmallVector<unsigned, 4>> PHIVarInfo;
138+
std::vector<SmallVector<Register, 4>> PHIVarInfo;
139139

140140
// DistanceMap - Keep track the distance of a MI from the start of the
141141
// current basic block.

llvm/lib/CodeGen/AllocationOrder.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ using namespace llvm;
2626
#define DEBUG_TYPE "regalloc"
2727

2828
// Compare VirtRegMap::getRegAllocPref().
29-
AllocationOrder AllocationOrder::create(unsigned VirtReg, const VirtRegMap &VRM,
29+
AllocationOrder AllocationOrder::create(Register VirtReg, const VirtRegMap &VRM,
3030
const RegisterClassInfo &RegClassInfo,
3131
const LiveRegMatrix *Matrix) {
3232
const MachineFunction &MF = VRM.getMachineFunction();

llvm/lib/CodeGen/AllocationOrder.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ class LLVM_LIBRARY_VISIBILITY AllocationOrder {
8181
/// @param VirtReg Virtual register to allocate for.
8282
/// @param VRM Virtual register map for function.
8383
/// @param RegClassInfo Information about reserved and allocatable registers.
84-
static AllocationOrder create(unsigned VirtReg, const VirtRegMap &VRM,
84+
static AllocationOrder create(Register VirtReg, const VirtRegMap &VRM,
8585
const RegisterClassInfo &RegClassInfo,
8686
const LiveRegMatrix *Matrix);
8787

llvm/lib/CodeGen/DetectDeadLanes.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ LaneBitmask DeadLaneDetector::transferDefinedLanes(
265265
return DefinedLanes;
266266
}
267267

268-
LaneBitmask DeadLaneDetector::determineInitialDefinedLanes(unsigned Reg) {
268+
LaneBitmask DeadLaneDetector::determineInitialDefinedLanes(Register Reg) {
269269
// Live-In or unused registers have no definition but are considered fully
270270
// defined.
271271
if (!MRI->hasOneDef(Reg))
@@ -330,7 +330,7 @@ LaneBitmask DeadLaneDetector::determineInitialDefinedLanes(unsigned Reg) {
330330
return MRI->getMaxLaneMaskForVReg(Reg);
331331
}
332332

333-
LaneBitmask DeadLaneDetector::determineInitialUsedLanes(unsigned Reg) {
333+
LaneBitmask DeadLaneDetector::determineInitialUsedLanes(Register Reg) {
334334
LaneBitmask UsedLanes = LaneBitmask::getNone();
335335
for (const MachineOperand &MO : MRI->use_nodbg_operands(Reg)) {
336336
if (!MO.readsReg())

llvm/lib/CodeGen/ExecutionDomainFix.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ using namespace llvm;
1616
#define DEBUG_TYPE "execution-deps-fix"
1717

1818
iterator_range<SmallVectorImpl<int>::const_iterator>
19-
ExecutionDomainFix::regIndices(unsigned Reg) const {
19+
ExecutionDomainFix::regIndices(MCRegister Reg) const {
2020
assert(Reg < AliasMap.size() && "Invalid register");
2121
const auto &Entry = AliasMap[Reg];
2222
return make_range(Entry.begin(), Entry.end());

llvm/lib/CodeGen/FixupStatepointCallerSaved.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,7 @@ class StatepointState {
425425
}
426426
}
427427

428-
void insertReloadBefore(unsigned Reg, MachineBasicBlock::iterator It,
428+
void insertReloadBefore(Register Reg, MachineBasicBlock::iterator It,
429429
MachineBasicBlock *MBB) {
430430
const TargetRegisterClass *RC = TRI.getMinimalPhysRegClass(Reg);
431431
int FI = RegToSlotIdx[Reg];

0 commit comments

Comments
 (0)