Skip to content

Commit 20362c5

Browse files
committed
[TwoAddressInstructionPass] Use Register. NFC
1 parent 527af30 commit 20362c5

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

llvm/lib/CodeGen/TwoAddressInstructionPass.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ class TwoAddressInstructionImpl {
181181
void processCopy(MachineInstr *MI);
182182

183183
using TiedPairList = SmallVector<std::pair<unsigned, unsigned>, 4>;
184-
using TiedOperandMap = SmallDenseMap<unsigned, TiedPairList>;
184+
using TiedOperandMap = SmallDenseMap<Register, TiedPairList>;
185185

186186
bool collectTiedOperands(MachineInstr *MI, TiedOperandMap&);
187187
void processTiedPairs(MachineInstr *MI, TiedPairList&, unsigned &Dist);
@@ -624,7 +624,7 @@ void TwoAddressInstructionImpl::removeClobberedSrcRegMap(MachineInstr *MI) {
624624
// Returns true if Reg is equal or aliased to at least one register in Set.
625625
bool TwoAddressInstructionImpl::regOverlapsSet(
626626
const SmallVectorImpl<Register> &Set, Register Reg) const {
627-
for (unsigned R : Set)
627+
for (Register R : Set)
628628
if (TRI->regsOverlap(R, Reg))
629629
return true;
630630

@@ -854,10 +854,10 @@ void TwoAddressInstructionImpl::scanUses(Register DstReg) {
854854
}
855855

856856
if (!VirtRegPairs.empty()) {
857-
unsigned ToReg = VirtRegPairs.back();
857+
Register ToReg = VirtRegPairs.back();
858858
VirtRegPairs.pop_back();
859859
while (!VirtRegPairs.empty()) {
860-
unsigned FromReg = VirtRegPairs.pop_back_val();
860+
Register FromReg = VirtRegPairs.pop_back_val();
861861
bool isNew = DstRegMap.insert(std::make_pair(FromReg, ToReg)).second;
862862
if (!isNew)
863863
assert(DstRegMap[FromReg] == ToReg &&"Can't map to two dst registers!");
@@ -1562,7 +1562,7 @@ void TwoAddressInstructionImpl::processTiedPairs(MachineInstr *MI,
15621562

15631563
bool RemovedKillFlag = false;
15641564
bool AllUsesCopied = true;
1565-
unsigned LastCopiedReg = 0;
1565+
Register LastCopiedReg;
15661566
SlotIndex LastCopyIdx;
15671567
Register RegB = 0;
15681568
unsigned SubRegB = 0;

0 commit comments

Comments
 (0)