mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-13 04:38:24 +00:00
Move stack slot assignments into LiveRangeEdit.
All registers created during splitting or spilling are assigned to the same stack slot as the parent register. When splitting or rematting, we may not spill at all. In that case the stack slot is still assigned, but it will be dead. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116546 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -18,12 +18,21 @@
|
||||
|
||||
using namespace llvm;
|
||||
|
||||
int LiveRangeEdit::assignStackSlot(VirtRegMap &vrm) {
|
||||
int ss = vrm.getStackSlot(getReg());
|
||||
if (ss != VirtRegMap::NO_STACK_SLOT)
|
||||
return ss;
|
||||
return vrm.assignVirt2StackSlot(getReg());
|
||||
}
|
||||
|
||||
LiveInterval &LiveRangeEdit::create(MachineRegisterInfo &mri,
|
||||
LiveIntervals &lis,
|
||||
VirtRegMap &vrm) {
|
||||
const TargetRegisterClass *RC = mri.getRegClass(parent_.reg);
|
||||
unsigned VReg = mri.createVirtualRegister(RC);
|
||||
vrm.grow();
|
||||
// Immediately assign to the same stack slot as parent.
|
||||
vrm.assignVirt2StackSlot(VReg, assignStackSlot(vrm));
|
||||
LiveInterval &li = lis.getOrCreateInterval(VReg);
|
||||
newRegs_.push_back(&li);
|
||||
return li;
|
||||
|
Reference in New Issue
Block a user