mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-01 00:33:09 +00:00
Don't bother calculating info unless its needed. May reduce number of stack slots created.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7584 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
b8822ad224
commit
27615d7f21
@ -238,10 +238,6 @@ void RA::spillVirtReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator &I,
|
||||
DEBUG(std::cerr << " which corresponds to no vreg, "
|
||||
<< "must be spurious physreg: ignoring (WARNING)\n");
|
||||
} else {
|
||||
// FIXME: move this into the conditional??
|
||||
const TargetRegisterClass *RC = MF->getSSARegMap()->getRegClass(VirtReg);
|
||||
int FrameIndex = getStackSpaceFor(VirtReg, RC);
|
||||
|
||||
DEBUG(std::cerr << " containing %reg" << VirtReg;
|
||||
if (!isVirtRegModified(VirtReg))
|
||||
std::cerr << " which has not been modified, so no store necessary!");
|
||||
@ -250,6 +246,8 @@ void RA::spillVirtReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator &I,
|
||||
// register. We only need to spill it into its stack slot if it has been
|
||||
// modified.
|
||||
if (isVirtRegModified(VirtReg)) {
|
||||
const TargetRegisterClass *RC = MF->getSSARegMap()->getRegClass(VirtReg);
|
||||
int FrameIndex = getStackSpaceFor(VirtReg, RC);
|
||||
DEBUG(std::cerr << " to stack slot #" << FrameIndex);
|
||||
RegInfo->storeRegToStackSlot(MBB, I, PhysReg, FrameIndex, RC);
|
||||
++NumSpilled; // Update statistics
|
||||
|
Loading…
Reference in New Issue
Block a user