mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-15 21:24:00 +00:00
Allow the allocation of empty live ranges that have uses.
Empty ranges may represent undef values. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128144 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -289,6 +289,8 @@ void RegAllocBase::allocatePhysRegs() {
|
|||||||
|
|
||||||
// Continue assigning vregs one at a time to available physical registers.
|
// Continue assigning vregs one at a time to available physical registers.
|
||||||
while (LiveInterval *VirtReg = dequeue()) {
|
while (LiveInterval *VirtReg = dequeue()) {
|
||||||
|
assert(!VRM->hasPhys(VirtReg->reg) && "Register already assigned");
|
||||||
|
|
||||||
// Unused registers can appear when the spiller coalesces snippets.
|
// Unused registers can appear when the spiller coalesces snippets.
|
||||||
if (MRI->reg_nodbg_empty(VirtReg->reg)) {
|
if (MRI->reg_nodbg_empty(VirtReg->reg)) {
|
||||||
DEBUG(dbgs() << "Dropping unused " << *VirtReg << '\n');
|
DEBUG(dbgs() << "Dropping unused " << *VirtReg << '\n');
|
||||||
@ -315,7 +317,12 @@ void RegAllocBase::allocatePhysRegs() {
|
|||||||
for (VirtRegVec::iterator I = SplitVRegs.begin(), E = SplitVRegs.end();
|
for (VirtRegVec::iterator I = SplitVRegs.begin(), E = SplitVRegs.end();
|
||||||
I != E; ++I) {
|
I != E; ++I) {
|
||||||
LiveInterval *SplitVirtReg = *I;
|
LiveInterval *SplitVirtReg = *I;
|
||||||
if (SplitVirtReg->empty()) continue;
|
assert(!VRM->hasPhys(SplitVirtReg->reg) && "Register already assigned");
|
||||||
|
if (MRI->reg_nodbg_empty(SplitVirtReg->reg)) {
|
||||||
|
DEBUG(dbgs() << "not queueing unused " << *SplitVirtReg << '\n');
|
||||||
|
LIS->removeInterval(SplitVirtReg->reg);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
DEBUG(dbgs() << "queuing new interval: " << *SplitVirtReg << "\n");
|
DEBUG(dbgs() << "queuing new interval: " << *SplitVirtReg << "\n");
|
||||||
assert(TargetRegisterInfo::isVirtualRegister(SplitVirtReg->reg) &&
|
assert(TargetRegisterInfo::isVirtualRegister(SplitVirtReg->reg) &&
|
||||||
"expect split value in virtual register");
|
"expect split value in virtual register");
|
||||||
|
Reference in New Issue
Block a user