Skip to content

Commit c5c7e28

Browse files
author
Kai Luo
committed
Minor
1 parent 13c0eff commit c5c7e28

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -655,11 +655,9 @@ bool PPCRegisterInfo::getRegAllocationHints(Register VirtReg,
655655
continue;
656656
for (MachineOperand &MO : MI.operands()) {
657657
if (!MO.isReg() || !MO.getReg() || !MO.getReg().isVirtual() ||
658-
!MO.isDef())
658+
!MO.isDef() || !VRM->hasPhys(MO.getReg()))
659659
continue;
660660
MCPhysReg PhysReg = VRM->getPhys(MO.getReg());
661-
if (PhysReg == VirtRegMap::NO_PHYS_REG)
662-
continue;
663661
llvm::copy_if(
664662
TRI->superregs_inclusive(PhysReg),
665663
std::inserter(ModifiedRegisters, ModifiedRegisters.begin()),
@@ -668,6 +666,10 @@ bool PPCRegisterInfo::getRegAllocationHints(Register VirtReg,
668666
}
669667
llvm::copy_if(llvm::make_range(Order.begin(), Order.end()),
670668
std::back_inserter(Hints), [&](MCPhysReg Reg) {
669+
// if (TRI->regsOverlap(Reg, PPC::CR2) ||
670+
// TRI->regsOverlap(Reg, PPC::CR3) ||
671+
// TRI->regsOverlap(Reg, PPC::CR4))
672+
// return false;
671673
return llvm::all_of(TRI->superregs_inclusive(Reg),
672674
[&](MCPhysReg SR) {
673675
return !ModifiedRegisters.count(SR);

0 commit comments

Comments
 (0)