mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-23 14:25:07 +00:00
Avoid scanning the long tail of physreg operands on calls
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103823 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -663,12 +663,18 @@ void RAFast::AllocateBasicBlock(MachineBasicBlock &MBB) {
|
|||||||
|
|
||||||
// First scan.
|
// First scan.
|
||||||
// Mark physreg uses and early clobbers as used.
|
// Mark physreg uses and early clobbers as used.
|
||||||
|
// Find the end of the virtreg operands
|
||||||
|
unsigned VirtOpEnd = 0;
|
||||||
for (unsigned i = 0, e = MI->getNumOperands(); i != e; ++i) {
|
for (unsigned i = 0, e = MI->getNumOperands(); i != e; ++i) {
|
||||||
MachineOperand &MO = MI->getOperand(i);
|
MachineOperand &MO = MI->getOperand(i);
|
||||||
if (!MO.isReg()) continue;
|
if (!MO.isReg()) continue;
|
||||||
unsigned Reg = MO.getReg();
|
unsigned Reg = MO.getReg();
|
||||||
if (!Reg || !TargetRegisterInfo::isPhysicalRegister(Reg) ||
|
if (!Reg) continue;
|
||||||
ReservedRegs.test(Reg)) continue;
|
if (TargetRegisterInfo::isVirtualRegister(Reg)) {
|
||||||
|
VirtOpEnd = i+1;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (ReservedRegs.test(Reg)) continue;
|
||||||
if (MO.isUse()) {
|
if (MO.isUse()) {
|
||||||
usePhysReg(MO);
|
usePhysReg(MO);
|
||||||
} else if (MO.isEarlyClobber()) {
|
} else if (MO.isEarlyClobber()) {
|
||||||
@@ -677,11 +683,10 @@ void RAFast::AllocateBasicBlock(MachineBasicBlock &MBB) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Second scan.
|
// Second scan.
|
||||||
// Allocate virtreg uses and early clobbers.
|
// Allocate virtreg uses and early clobbers.
|
||||||
// Collect VirtKills
|
// Collect VirtKills
|
||||||
for (unsigned i = 0, e = MI->getNumOperands(); i != e; ++i) {
|
for (unsigned i = 0; i != VirtOpEnd; ++i) {
|
||||||
MachineOperand &MO = MI->getOperand(i);
|
MachineOperand &MO = MI->getOperand(i);
|
||||||
if (!MO.isReg()) continue;
|
if (!MO.isReg()) continue;
|
||||||
unsigned Reg = MO.getReg();
|
unsigned Reg = MO.getReg();
|
||||||
|
Reference in New Issue
Block a user