mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-13 22:24:07 +00:00
Replace a big gob of old coalescer logic with the new CoalescerPair class.
CoalescerPair can determine if a copy can be coalesced, and which register gets merged away. The old logic in SimpleRegisterCoalescing had evolved into something a bit too convoluted. This second attempt fixes some crashes that only occurred Linux. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106769 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -218,10 +218,7 @@ bool LiveIntervals::conflictsWithPhysReg(const LiveInterval &li,
|
||||
return false;
|
||||
}
|
||||
|
||||
/// conflictsWithSubPhysRegRef - Similar to conflictsWithPhysRegRef except
|
||||
/// it checks for sub-register reference and it can check use as well.
|
||||
bool LiveIntervals::conflictsWithSubPhysRegRef(LiveInterval &li,
|
||||
unsigned Reg, bool CheckUse,
|
||||
bool LiveIntervals::conflictsWithAliasRef(LiveInterval &li, unsigned Reg,
|
||||
SmallPtrSet<MachineInstr*,32> &JoinedCopies) {
|
||||
for (LiveInterval::Ranges::const_iterator
|
||||
I = li.ranges.begin(), E = li.ranges.end(); I != E; ++I) {
|
||||
@ -239,12 +236,11 @@ bool LiveIntervals::conflictsWithSubPhysRegRef(LiveInterval &li,
|
||||
MachineOperand& MO = MI->getOperand(i);
|
||||
if (!MO.isReg())
|
||||
continue;
|
||||
if (MO.isUse() && !CheckUse)
|
||||
continue;
|
||||
unsigned PhysReg = MO.getReg();
|
||||
if (PhysReg == 0 || TargetRegisterInfo::isVirtualRegister(PhysReg))
|
||||
if (PhysReg == 0 || PhysReg == Reg ||
|
||||
TargetRegisterInfo::isVirtualRegister(PhysReg))
|
||||
continue;
|
||||
if (tri_->isSubRegister(Reg, PhysReg))
|
||||
if (tri_->regsOverlap(Reg, PhysReg))
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user