Take another .7 seconds off of linear scan time.

llvm-svn: 17936
This commit is contained in:
Chris Lattner 2004-11-18 04:02:11 +00:00
parent 850852c789
commit 7598c316e5
1 changed files with 5 additions and 3 deletions

View File

@ -68,14 +68,16 @@ bool LiveInterval::overlapsFrom(const LiveInterval& other,
const_iterator je = other.end(); const_iterator je = other.end();
assert((StartPos->start <= i->start || StartPos == other.begin()) && assert((StartPos->start <= i->start || StartPos == other.begin()) &&
"Bogus start position hint!"); StartPos != other.end() && "Bogus start position hint!");
if (i->start < j->start) { if (i->start < j->start) {
i = std::upper_bound(i, ie, j->start); i = std::upper_bound(i, ie, j->start);
if (i != ranges.begin()) --i; if (i != ranges.begin()) --i;
} else if (j->start < i->start) { } else if (j->start < i->start) {
j = std::upper_bound(j, je, i->start); if ((++StartPos)->start <= i->start) {
if (j != other.ranges.begin()) --j; j = std::upper_bound(j, je, i->start);
if (j != other.ranges.begin()) --j;
}
} else { } else {
return true; return true;
} }