mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-28 03:25:23 +00:00
Fix bugs handling ESP in alloca references
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7591 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -232,7 +232,8 @@ void RA::removePhysReg(unsigned PhysReg) {
|
|||||||
///
|
///
|
||||||
void RA::spillVirtReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator &I,
|
void RA::spillVirtReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator &I,
|
||||||
unsigned VirtReg, unsigned PhysReg) {
|
unsigned VirtReg, unsigned PhysReg) {
|
||||||
assert((VirtReg || DisableKill) && "Spilling a physical register is illegal!"
|
if (!VirtReg && DisableKill) return;
|
||||||
|
assert(VirtReg && "Spilling a physical register is illegal!"
|
||||||
" Must not have appropriate kill for the register or use exists beyond"
|
" Must not have appropriate kill for the register or use exists beyond"
|
||||||
" the intended one.");
|
" the intended one.");
|
||||||
DEBUG(std::cerr << " Spilling register " << RegInfo->getName(PhysReg);
|
DEBUG(std::cerr << " Spilling register " << RegInfo->getName(PhysReg);
|
||||||
@@ -606,8 +607,10 @@ void RA::AllocateBasicBlock(MachineBasicBlock &MBB) {
|
|||||||
|
|
||||||
// Spill all physical registers holding virtual registers now.
|
// Spill all physical registers holding virtual registers now.
|
||||||
while (!PhysRegsUsed.empty())
|
while (!PhysRegsUsed.empty())
|
||||||
spillVirtReg(MBB, I, PhysRegsUsed.begin()->second,
|
if (unsigned VirtReg = PhysRegsUsed.begin()->second)
|
||||||
PhysRegsUsed.begin()->first);
|
spillVirtReg(MBB, I, VirtReg, PhysRegsUsed.begin()->first);
|
||||||
|
else
|
||||||
|
removePhysReg(PhysRegsUsed.begin()->first);
|
||||||
|
|
||||||
for (std::map<unsigned, unsigned>::iterator I = Virt2PhysRegMap.begin(),
|
for (std::map<unsigned, unsigned>::iterator I = Virt2PhysRegMap.begin(),
|
||||||
E = Virt2PhysRegMap.end(); I != E; ++I)
|
E = Virt2PhysRegMap.end(); I != E; ++I)
|
||||||
|
Reference in New Issue
Block a user