Commit 4f5ec4d8 authored by Yolanda Chen's avatar Yolanda Chen Committed by Commit Bot

[regalloc] Fix liverange bundle TryMerge to merge connected UseIntervals

The current bundle merge check on uses does not merge UseInterval starting from the other UserInterval's end.
This is incorrect and will miss some bundle merge opportunties.

Change-Id: I0b828f83cfe7ae401e3c0c40dc94aa3787f2e05e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2059570
Commit-Queue: Yolanda Chen <yolanda.chen@intel.com>
Reviewed-by: 's avatarSigurd Schneider <sigurds@chromium.org>
Reviewed-by: 's avatarThibaud Michaud <thibaudm@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66404}
parent 93230d31
......@@ -2808,9 +2808,9 @@ bool LiveRangeBundle::TryMerge(LiveRangeBundle* other, bool trace_alloc) {
auto iter2 = other->uses_.begin();
while (iter1 != uses_.end() && iter2 != other->uses_.end()) {
if (iter1->start > iter2->end) {
if (iter1->start >= iter2->end) {
++iter2;
} else if (iter2->start > iter1->end) {
} else if (iter2->start >= iter1->end) {
++iter1;
} else {
TRACE_COND(trace_alloc, "No merge %d:%d %d:%d\n", iter1->start,
......
......@@ -721,6 +721,7 @@ class LiveRangeBundle : public ZoneObject {
private:
friend class BundleBuilder;
// Representation of the non-empty interval [start,end[.
class Range {
public:
Range(int s, int e) : start(s), end(e) {}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment