mirror of
https://github.com/RPCSX/llvm.git
synced 2025-02-15 02:29:07 +00:00
LiveIntervalAnalysis: No need to deal with dead subregister defs anymore.
The DetectDeadLaneMask already ensures that we have no dead subregister definitions making the special handling in LiveIntervalAnalysis unnecessary. This reverts most of r248335. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267937 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
9f608022e3
commit
277501abff
@ -195,16 +195,9 @@ LiveInterval* LiveIntervals::createInterval(unsigned reg) {
|
||||
void LiveIntervals::computeVirtRegInterval(LiveInterval &LI) {
|
||||
assert(LRCalc && "LRCalc not initialized.");
|
||||
assert(LI.empty() && "Should only compute empty intervals.");
|
||||
bool ShouldTrackSubRegLiveness = MRI->shouldTrackSubRegLiveness(LI.reg);
|
||||
LRCalc->reset(MF, getSlotIndexes(), DomTree, &getVNInfoAllocator());
|
||||
LRCalc->calculate(LI, ShouldTrackSubRegLiveness);
|
||||
bool SeparatedComponents = computeDeadValues(LI, nullptr);
|
||||
if (SeparatedComponents) {
|
||||
assert(ShouldTrackSubRegLiveness
|
||||
&& "Separated components should only occur for unused subreg defs");
|
||||
SmallVector<LiveInterval*, 8> SplitLIs;
|
||||
splitSeparateComponents(LI, SplitLIs);
|
||||
}
|
||||
LRCalc->calculate(LI, MRI->shouldTrackSubRegLiveness(LI.reg));
|
||||
computeDeadValues(LI, nullptr);
|
||||
}
|
||||
|
||||
void LiveIntervals::computeVirtRegs() {
|
||||
@ -487,13 +480,11 @@ bool LiveIntervals::computeDeadValues(LiveInterval &LI,
|
||||
|
||||
// Is the register live before? Otherwise we may have to add a read-undef
|
||||
// flag for subregister defs.
|
||||
bool DeadBeforeDef = false;
|
||||
unsigned VReg = LI.reg;
|
||||
if (MRI->shouldTrackSubRegLiveness(VReg)) {
|
||||
if ((I == LI.begin() || std::prev(I)->end < Def) && !VNI->isPHIDef()) {
|
||||
MachineInstr *MI = getInstructionFromIndex(Def);
|
||||
MI->setRegisterDefReadUndef(VReg);
|
||||
DeadBeforeDef = true;
|
||||
}
|
||||
}
|
||||
|
||||
@ -509,15 +500,7 @@ bool LiveIntervals::computeDeadValues(LiveInterval &LI,
|
||||
// This is a dead def. Make sure the instruction knows.
|
||||
MachineInstr *MI = getInstructionFromIndex(Def);
|
||||
assert(MI && "No instruction defining live value");
|
||||
MI->addRegisterDead(VReg, TRI);
|
||||
|
||||
// If we have a dead def that is completely separate from the rest of
|
||||
// the liverange then we rewrite it to use a different VReg to not violate
|
||||
// the rule that the liveness of a virtual register forms a connected
|
||||
// component. This should only happen if subregister liveness is tracked.
|
||||
if (DeadBeforeDef)
|
||||
MayHaveSplitComponents = true;
|
||||
|
||||
MI->addRegisterDead(LI.reg, TRI);
|
||||
if (dead && MI->allDefsAreDead()) {
|
||||
DEBUG(dbgs() << "All defs dead: " << Def << '\t' << *MI);
|
||||
dead->push_back(MI);
|
||||
|
Loading…
x
Reference in New Issue
Block a user