mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-17 20:23:59 +00:00
Move LiveIntervalMap::extendTo into LiveInterval itself.
This method could probably be used by LiveIntervalAnalysis::shrinkToUses, and now it can use extendIntervalEndTo() which coalesces ranges. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126803 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -291,6 +291,22 @@ LiveInterval::addRangeFrom(LiveRange LR, iterator From) {
|
||||
return ranges.insert(it, LR);
|
||||
}
|
||||
|
||||
/// extendInBlock - If this interval is live before UseIdx in the basic
|
||||
/// block that starts at StartIdx, extend it to be live at UseIdx and return
|
||||
/// the value. If there is no live range before UseIdx, return NULL.
|
||||
VNInfo *LiveInterval::extendInBlock(SlotIndex StartIdx, SlotIndex UseIdx) {
|
||||
if (empty())
|
||||
return 0;
|
||||
iterator I = std::upper_bound(begin(), end(), UseIdx);
|
||||
if (I == begin())
|
||||
return 0;
|
||||
--I;
|
||||
if (I->end <= StartIdx)
|
||||
return 0;
|
||||
if (I->end <= UseIdx)
|
||||
extendIntervalEndTo(I, UseIdx.getNextSlot());
|
||||
return I->valno;
|
||||
}
|
||||
|
||||
/// removeRange - Remove the specified range from this interval. Note that
|
||||
/// the range must be in a single LiveRange in its entirety.
|
||||
|
Reference in New Issue
Block a user