Skip to content

Commit 0762236

Browse files
committed
[NFC] Fix clang-tidy issues in CalcSpillWeights.cpp
1 parent 95acd92 commit 0762236

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

llvm/lib/CodeGen/CalcSpillWeights.cpp

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@
1515
#include "llvm/CodeGen/MachineLoopInfo.h"
1616
#include "llvm/CodeGen/MachineOperand.h"
1717
#include "llvm/CodeGen/MachineRegisterInfo.h"
18+
#include "llvm/CodeGen/StackMaps.h"
1819
#include "llvm/CodeGen/TargetInstrInfo.h"
1920
#include "llvm/CodeGen/TargetRegisterInfo.h"
2021
#include "llvm/CodeGen/TargetSubtargetInfo.h"
2122
#include "llvm/CodeGen/VirtRegMap.h"
2223
#include "llvm/Support/Debug.h"
2324
#include "llvm/Support/raw_ostream.h"
24-
#include "llvm/CodeGen/StackMaps.h"
2525
#include <cassert>
2626
#include <tuple>
2727

@@ -35,7 +35,7 @@ void VirtRegAuxInfo::calculateSpillWeightsAndHints() {
3535

3636
MachineRegisterInfo &MRI = MF.getRegInfo();
3737
for (unsigned I = 0, E = MRI.getNumVirtRegs(); I != E; ++I) {
38-
unsigned Reg = Register::index2VirtReg(I);
38+
Register Reg = Register::index2VirtReg(I);
3939
if (MRI.reg_nodbg_empty(Reg))
4040
continue;
4141
calculateSpillWeightAndHint(LIS.getInterval(Reg));
@@ -64,14 +64,14 @@ static Register copyHint(const MachineInstr *MI, unsigned Reg,
6464
if (Register::isVirtualRegister(HReg))
6565
return Sub == HSub ? HReg : Register();
6666

67-
const TargetRegisterClass *rc = MRI.getRegClass(Reg);
67+
const TargetRegisterClass *RC = MRI.getRegClass(Reg);
6868
MCRegister CopiedPReg = HSub ? TRI.getSubReg(HReg, HSub) : HReg.asMCReg();
69-
if (rc->contains(CopiedPReg))
69+
if (RC->contains(CopiedPReg))
7070
return CopiedPReg;
7171

7272
// Check if reg:sub matches so that a super register could be hinted.
7373
if (Sub)
74-
return TRI.getMatchingSuperReg(CopiedPReg, Sub, rc);
74+
return TRI.getMatchingSuperReg(CopiedPReg, Sub, RC);
7575

7676
return 0;
7777
}
@@ -80,8 +80,8 @@ static Register copyHint(const MachineInstr *MI, unsigned Reg,
8080
static bool isRematerializable(const LiveInterval &LI, const LiveIntervals &LIS,
8181
const VirtRegMap &VRM,
8282
const TargetInstrInfo &TII) {
83-
unsigned Reg = LI.reg();
84-
unsigned Original = VRM.getOriginal(Reg);
83+
Register Reg = LI.reg();
84+
Register Original = VRM.getOriginal(Reg);
8585
for (LiveInterval::const_vni_iterator I = LI.vni_begin(), E = LI.vni_end();
8686
I != E; ++I) {
8787
const VNInfo *VNI = *I;
@@ -183,17 +183,17 @@ float VirtRegAuxInfo::weightCalcHelper(LiveInterval &LI, SlotIndex *Start,
183183
bool ShouldUpdateLI = !IsLocalSplitArtifact;
184184

185185
if (IsLocalSplitArtifact) {
186-
MachineBasicBlock *localMBB = LIS.getMBBFromIndex(*End);
187-
assert(localMBB == LIS.getMBBFromIndex(*Start) &&
186+
MachineBasicBlock *LocalMBB = LIS.getMBBFromIndex(*End);
187+
assert(LocalMBB == LIS.getMBBFromIndex(*Start) &&
188188
"start and end are expected to be in the same basic block");
189189

190190
// Local split artifact will have 2 additional copy instructions and they
191191
// will be in the same BB.
192192
// localLI = COPY other
193193
// ...
194194
// other = COPY localLI
195-
TotalWeight += LiveIntervals::getSpillWeight(true, false, &MBFI, localMBB);
196-
TotalWeight += LiveIntervals::getSpillWeight(false, true, &MBFI, localMBB);
195+
TotalWeight += LiveIntervals::getSpillWeight(true, false, &MBFI, LocalMBB);
196+
TotalWeight += LiveIntervals::getSpillWeight(false, true, &MBFI, LocalMBB);
197197

198198
NumInstr += 2;
199199
}

0 commit comments

Comments
 (0)