Skip to content

Commit b049f4a

Browse files
committed
Greedy: Merge VirtRegMap queries into one use (NFC)
1 parent 5e1d9bb commit b049f4a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

llvm/lib/CodeGen/RegAllocGreedy.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2502,8 +2502,10 @@ void RAGreedy::tryHintRecoloring(const LiveInterval &VirtReg) {
25022502
do {
25032503
Reg = RecoloringCandidates.pop_back_val();
25042504

2505+
MCRegister CurrPhys = VRM->getPhys(Reg);
2506+
25052507
// This may be a skipped register.
2506-
if (!VRM->hasPhys(Reg)) {
2508+
if (!CurrPhys) {
25072509
assert(!shouldAllocateRegister(Reg) &&
25082510
"We have an unallocated variable which should have been handled");
25092511
continue;
@@ -2512,7 +2514,6 @@ void RAGreedy::tryHintRecoloring(const LiveInterval &VirtReg) {
25122514
// Get the live interval mapped with this virtual register to be able
25132515
// to check for the interference with the new color.
25142516
LiveInterval &LI = LIS->getInterval(Reg);
2515-
MCRegister CurrPhys = VRM->getPhys(Reg);
25162517
// Check that the new color matches the register class constraints and
25172518
// that it is free for this live range.
25182519
if (CurrPhys != PhysReg && (!MRI->getRegClass(Reg)->contains(PhysReg) ||

0 commit comments

Comments
 (0)