Subzero: Improve regalloc performance by optimizing UnhandledPrecolored. A lot of time was being spent in the two loops that check precolored ranges in the Unhandled set, specifically in the endsBefore() check. Solve this by keeping a shadow copy of Unhandled, restricted to the ranges that are precolored. BUG= none R=jvoung@chromium.org Review URL: https://codereview.chromium.org/622553003
diff --git a/src/IceRegAlloc.h b/src/IceRegAlloc.h index 791b349..99ed908 100644 --- a/src/IceRegAlloc.h +++ b/src/IceRegAlloc.h
@@ -71,6 +71,9 @@ typedef std::set<LiveRangeWrapper, RangeCompare> OrderedRanges; typedef std::list<LiveRangeWrapper> UnorderedRanges; OrderedRanges Unhandled; + // UnhandledPrecolored is a subset of Unhandled, specially collected + // for faster processing. + OrderedRanges UnhandledPrecolored; UnorderedRanges Active, Inactive, Handled; LinearScan(const LinearScan &) = delete; LinearScan &operator=(const LinearScan &) = delete;