mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-06 04:31:08 +00:00
Fix LiveInterval::overlaps so it doesn't claim touching intervals overlap.
Also, one binary search is enough. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108261 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
ac80975ea4
commit
186eb73845
@ -161,16 +161,8 @@ bool LiveInterval::overlapsFrom(const LiveInterval& other,
|
||||
/// by [Start, End).
|
||||
bool LiveInterval::overlaps(SlotIndex Start, SlotIndex End) const {
|
||||
assert(Start < End && "Invalid range");
|
||||
const_iterator I = begin();
|
||||
const_iterator E = end();
|
||||
const_iterator si = std::upper_bound(I, E, Start);
|
||||
const_iterator ei = std::upper_bound(I, E, End);
|
||||
if (si != ei)
|
||||
return true;
|
||||
if (si == I)
|
||||
return false;
|
||||
--si;
|
||||
return si->contains(Start);
|
||||
const_iterator I = std::lower_bound(begin(), end(), End);
|
||||
return I != begin() && (--I)->end > Start;
|
||||
}
|
||||
|
||||
/// extendIntervalEndTo - This method is used when we want to extend the range
|
||||
|
Loading…
Reference in New Issue
Block a user