Skip to content

Commit e2ff448

Browse files
committed
Address reviewer feedback:
- Remove duplicate comment. - Update comments about order of PHI nodes versus COPYs.
1 parent 4f26b46 commit e2ff448

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

llvm/lib/CodeGen/LiveInterval.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -563,9 +563,6 @@ VNInfo *LiveRange::extendInBlock(SlotIndex StartIdx, SlotIndex Kill) {
563563
return CalcLiveRangeUtilVector(this).extendInBlock(StartIdx, Kill);
564564
}
565565

566-
/// Remove the specified interval from this live range.
567-
/// Does nothing if interval is not part of this live range.
568-
/// Note that the interval must be within a single Segment in its entirety.
569566
void LiveRange::removeSegment(SlotIndex Start, SlotIndex End,
570567
bool RemoveDeadValNo) {
571568
// Find the Segment containing this span.

llvm/lib/CodeGen/PHIElimination.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -426,17 +426,15 @@ void PHIElimination::LowerPHINode(MachineBasicBlock &MBB,
426426
continue;
427427
}
428428

429+
// Destination copies are not inserted in the same order as the PHI nodes
430+
// they replace. Hence the start of the live range may need to be adjusted
431+
// to match the actual slot index of the copy.
429432
if (DestSegment->start > NewStart) {
430-
// With a single PHI removed from block the index of the copy may be
431-
// lower than the original PHI. Extend live range backward to cover
432-
// the copy.
433433
VNInfo *VNI = LR->getVNInfoAt(DestSegment->start);
434434
assert(VNI && "value should be defined for known segment");
435435
LR->addSegment(
436436
LiveInterval::Segment(NewStart, DestSegment->start, VNI));
437437
} else if (DestSegment->start < NewStart) {
438-
// Otherwise, remove the region from the beginning of MBB to the copy
439-
// instruction from DestReg's live interval.
440438
assert(DestSegment->start >= MBBStartIndex);
441439
assert(DestSegment->end >= DestCopyIndex.getRegSlot());
442440
LR->removeSegment(DestSegment->start, NewStart);

0 commit comments

Comments
 (0)