mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-15 22:28:18 +00:00
A register def can be partially dead when the whole register has use(s) but a subreg does not.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31760 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -575,7 +575,6 @@ void LiveIntervals::handlePhysicalRegisterDef(MachineBasicBlock *MBB,
|
|||||||
// A physical register cannot be live across basic block, so its
|
// A physical register cannot be live across basic block, so its
|
||||||
// lifetime must end somewhere in its defining basic block.
|
// lifetime must end somewhere in its defining basic block.
|
||||||
DEBUG(std::cerr << "\t\tregister: "; printRegName(interval.reg));
|
DEBUG(std::cerr << "\t\tregister: "; printRegName(interval.reg));
|
||||||
typedef LiveVariables::killed_iterator KillIter;
|
|
||||||
|
|
||||||
unsigned baseIndex = MIIdx;
|
unsigned baseIndex = MIIdx;
|
||||||
unsigned start = getDefIndex(baseIndex);
|
unsigned start = getDefIndex(baseIndex);
|
||||||
@@ -599,6 +598,14 @@ void LiveIntervals::handlePhysicalRegisterDef(MachineBasicBlock *MBB,
|
|||||||
DEBUG(std::cerr << " killed");
|
DEBUG(std::cerr << " killed");
|
||||||
end = getUseIndex(baseIndex) + 1;
|
end = getUseIndex(baseIndex) + 1;
|
||||||
goto exit;
|
goto exit;
|
||||||
|
} else if (lv_->ModifiesRegister(mi, interval.reg)) {
|
||||||
|
// Another instruction redefines the register before it is ever read.
|
||||||
|
// Then the register is essentially dead at the instruction that defines
|
||||||
|
// it. Hence its interval is:
|
||||||
|
// [defSlot(def), defSlot(def)+1)
|
||||||
|
DEBUG(std::cerr << " dead");
|
||||||
|
end = getDefIndex(start) + 1;
|
||||||
|
goto exit;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user