mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-19 04:32:19 +00:00
Make sure to notice that explicit physregs are used in the function
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21084 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
c3e2db407e
commit
886dd9136f
@ -157,8 +157,8 @@ bool SimpleSpiller::runOnMachineFunction(MachineFunction &MF,
|
|||||||
MachineInstr &MI = *MII;
|
MachineInstr &MI = *MII;
|
||||||
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.isRegister() && MO.getReg() &&
|
if (MO.isRegister() && MO.getReg())
|
||||||
MRegisterInfo::isVirtualRegister(MO.getReg())) {
|
if (MRegisterInfo::isVirtualRegister(MO.getReg())) {
|
||||||
unsigned VirtReg = MO.getReg();
|
unsigned VirtReg = MO.getReg();
|
||||||
unsigned PhysReg = VRM.getPhys(VirtReg);
|
unsigned PhysReg = VRM.getPhys(VirtReg);
|
||||||
if (VRM.hasStackSlot(VirtReg)) {
|
if (VRM.hasStackSlot(VirtReg)) {
|
||||||
@ -180,8 +180,11 @@ bool SimpleSpiller::runOnMachineFunction(MachineFunction &MF,
|
|||||||
}
|
}
|
||||||
PhysRegsUsed[PhysReg] = true;
|
PhysRegsUsed[PhysReg] = true;
|
||||||
MI.SetMachineOperandReg(i, PhysReg);
|
MI.SetMachineOperandReg(i, PhysReg);
|
||||||
|
} else {
|
||||||
|
PhysRegsUsed[MO.getReg()] = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
DEBUG(std::cerr << '\t' << MI);
|
DEBUG(std::cerr << '\t' << MI);
|
||||||
LoadedRegs.clear();
|
LoadedRegs.clear();
|
||||||
}
|
}
|
||||||
@ -312,6 +315,9 @@ void LocalSpiller::RewriteMBB(MachineBasicBlock &MBB, const VirtRegMap &VRM) {
|
|||||||
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.isRegister() && MO.getReg() &&
|
if (MO.isRegister() && MO.getReg() &&
|
||||||
|
MRegisterInfo::isPhysicalRegister(MO.getReg()))
|
||||||
|
PhysRegsUsed[MO.getReg()] = true;
|
||||||
|
else if (MO.isRegister() && MO.getReg() &&
|
||||||
MRegisterInfo::isVirtualRegister(MO.getReg())) {
|
MRegisterInfo::isVirtualRegister(MO.getReg())) {
|
||||||
unsigned VirtReg = MO.getReg();
|
unsigned VirtReg = MO.getReg();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user