mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-09 11:25:55 +00:00
Factored out a bit of common code to mark VNInfos for deletion.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109388 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -545,6 +545,7 @@ namespace llvm {
|
|||||||
Ranges::iterator addRangeFrom(LiveRange LR, Ranges::iterator From);
|
Ranges::iterator addRangeFrom(LiveRange LR, Ranges::iterator From);
|
||||||
void extendIntervalEndTo(Ranges::iterator I, SlotIndex NewEnd);
|
void extendIntervalEndTo(Ranges::iterator I, SlotIndex NewEnd);
|
||||||
Ranges::iterator extendIntervalStartTo(Ranges::iterator I, SlotIndex NewStr);
|
Ranges::iterator extendIntervalStartTo(Ranges::iterator I, SlotIndex NewStr);
|
||||||
|
void markValNoForDeletion(VNInfo *V);
|
||||||
|
|
||||||
LiveInterval& operator=(const LiveInterval& rhs); // DO NOT IMPLEMENT
|
LiveInterval& operator=(const LiveInterval& rhs); // DO NOT IMPLEMENT
|
||||||
|
|
||||||
|
@@ -166,6 +166,20 @@ bool LiveInterval::overlaps(SlotIndex Start, SlotIndex End) const {
|
|||||||
return I != begin() && (--I)->end > Start;
|
return I != begin() && (--I)->end > Start;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// ValNo is dead, remove it. If it is the largest value number, just nuke it
|
||||||
|
/// (and any other deleted values neighboring it), otherwise mark it as ~1U so
|
||||||
|
/// it can be nuked later.
|
||||||
|
void LiveInterval::markValNoForDeletion(VNInfo *ValNo) {
|
||||||
|
if (ValNo->id == getNumValNums()-1) {
|
||||||
|
do {
|
||||||
|
valnos.pop_back();
|
||||||
|
} while (!valnos.empty() && valnos.back()->isUnused());
|
||||||
|
} else {
|
||||||
|
ValNo->setIsUnused(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// extendIntervalEndTo - This method is used when we want to extend the range
|
/// extendIntervalEndTo - This method is used when we want to extend the range
|
||||||
/// specified by I to end at the specified endpoint. To do this, we should
|
/// specified by I to end at the specified endpoint. To do this, we should
|
||||||
/// merge and eliminate all ranges that this will overlap with. The iterator is
|
/// merge and eliminate all ranges that this will overlap with. The iterator is
|
||||||
@@ -314,16 +328,8 @@ void LiveInterval::removeRange(SlotIndex Start, SlotIndex End,
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (isDead) {
|
if (isDead) {
|
||||||
// Now that ValNo is dead, remove it. If it is the largest value
|
// Now that ValNo is dead, remove it.
|
||||||
// number, just nuke it (and any other deleted values neighboring it),
|
markValNoForDeletion(ValNo);
|
||||||
// otherwise mark it as ~1U so it can be nuked later.
|
|
||||||
if (ValNo->id == getNumValNums()-1) {
|
|
||||||
do {
|
|
||||||
valnos.pop_back();
|
|
||||||
} while (!valnos.empty() && valnos.back()->isUnused());
|
|
||||||
} else {
|
|
||||||
ValNo->setIsUnused(true);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -359,16 +365,8 @@ void LiveInterval::removeValNo(VNInfo *ValNo) {
|
|||||||
if (I->valno == ValNo)
|
if (I->valno == ValNo)
|
||||||
ranges.erase(I);
|
ranges.erase(I);
|
||||||
} while (I != E);
|
} while (I != E);
|
||||||
// Now that ValNo is dead, remove it. If it is the largest value
|
// Now that ValNo is dead, remove it.
|
||||||
// number, just nuke it (and any other deleted values neighboring it),
|
markValNoForDeletion(ValNo);
|
||||||
// otherwise mark it as ~1U so it can be nuked later.
|
|
||||||
if (ValNo->id == getNumValNums()-1) {
|
|
||||||
do {
|
|
||||||
valnos.pop_back();
|
|
||||||
} while (!valnos.empty() && valnos.back()->isUnused());
|
|
||||||
} else {
|
|
||||||
ValNo->setIsUnused(true);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// getLiveRangeContaining - Return the live range that contains the
|
/// getLiveRangeContaining - Return the live range that contains the
|
||||||
@@ -586,16 +584,8 @@ void LiveInterval::MergeValueInAsValue(
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (isDead) {
|
if (isDead) {
|
||||||
// Now that V1 is dead, remove it. If it is the largest value number,
|
// Now that V1 is dead, remove it.
|
||||||
// just nuke it (and any other deleted values neighboring it), otherwise
|
markValNoForDeletion(V1);
|
||||||
// mark it as ~1U so it can be nuked later.
|
|
||||||
if (V1->id == getNumValNums()-1) {
|
|
||||||
do {
|
|
||||||
valnos.pop_back();
|
|
||||||
} while (!valnos.empty() && valnos.back()->isUnused());
|
|
||||||
} else {
|
|
||||||
V1->setIsUnused(true);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -753,16 +743,8 @@ VNInfo* LiveInterval::MergeValueNumberInto(VNInfo *V1, VNInfo *V2) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Now that V1 is dead, remove it. If it is the largest value number, just
|
// Now that V1 is dead, remove it.
|
||||||
// nuke it (and any other deleted values neighboring it), otherwise mark it as
|
markValNoForDeletion(V1);
|
||||||
// ~1U so it can be nuked later.
|
|
||||||
if (V1->id == getNumValNums()-1) {
|
|
||||||
do {
|
|
||||||
valnos.pop_back();
|
|
||||||
} while (valnos.back()->isUnused());
|
|
||||||
} else {
|
|
||||||
V1->setIsUnused(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
return V2;
|
return V2;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user