Skip to content
This repository was archived by the owner on Mar 28, 2020. It is now read-only.

Commit 277501a

Browse files
committed
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
1 parent 9f60802 commit 277501a

File tree

1 file changed

+3
-20
lines changed

1 file changed

+3
-20
lines changed

lib/CodeGen/LiveIntervalAnalysis.cpp

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -195,16 +195,9 @@ LiveInterval* LiveIntervals::createInterval(unsigned reg) {
195195
void LiveIntervals::computeVirtRegInterval(LiveInterval &LI) {
196196
assert(LRCalc && "LRCalc not initialized.");
197197
assert(LI.empty() && "Should only compute empty intervals.");
198-
bool ShouldTrackSubRegLiveness = MRI->shouldTrackSubRegLiveness(LI.reg);
199198
LRCalc->reset(MF, getSlotIndexes(), DomTree, &getVNInfoAllocator());
200-
LRCalc->calculate(LI, ShouldTrackSubRegLiveness);
201-
bool SeparatedComponents = computeDeadValues(LI, nullptr);
202-
if (SeparatedComponents) {
203-
assert(ShouldTrackSubRegLiveness
204-
&& "Separated components should only occur for unused subreg defs");
205-
SmallVector<LiveInterval*, 8> SplitLIs;
206-
splitSeparateComponents(LI, SplitLIs);
207-
}
199+
LRCalc->calculate(LI, MRI->shouldTrackSubRegLiveness(LI.reg));
200+
computeDeadValues(LI, nullptr);
208201
}
209202

210203
void LiveIntervals::computeVirtRegs() {
@@ -487,13 +480,11 @@ bool LiveIntervals::computeDeadValues(LiveInterval &LI,
487480

488481
// Is the register live before? Otherwise we may have to add a read-undef
489482
// flag for subregister defs.
490-
bool DeadBeforeDef = false;
491483
unsigned VReg = LI.reg;
492484
if (MRI->shouldTrackSubRegLiveness(VReg)) {
493485
if ((I == LI.begin() || std::prev(I)->end < Def) && !VNI->isPHIDef()) {
494486
MachineInstr *MI = getInstructionFromIndex(Def);
495487
MI->setRegisterDefReadUndef(VReg);
496-
DeadBeforeDef = true;
497488
}
498489
}
499490

@@ -509,15 +500,7 @@ bool LiveIntervals::computeDeadValues(LiveInterval &LI,
509500
// This is a dead def. Make sure the instruction knows.
510501
MachineInstr *MI = getInstructionFromIndex(Def);
511502
assert(MI && "No instruction defining live value");
512-
MI->addRegisterDead(VReg, TRI);
513-
514-
// If we have a dead def that is completely separate from the rest of
515-
// the liverange then we rewrite it to use a different VReg to not violate
516-
// the rule that the liveness of a virtual register forms a connected
517-
// component. This should only happen if subregister liveness is tracked.
518-
if (DeadBeforeDef)
519-
MayHaveSplitComponents = true;
520-
503+
MI->addRegisterDead(LI.reg, TRI);
521504
if (dead && MI->allDefsAreDead()) {
522505
DEBUG(dbgs() << "All defs dead: " << Def << '\t' << *MI);
523506
dead->push_back(MI);

0 commit comments

Comments
 (0)