12019-05-03 Robin Morisset <rmorisset@apple.com>
2
3 [Air] highOrderAdjacents in AbstractColoringAllocator::conservativeHeuristic should be some kind of array
4 https://bugs.webkit.org/show_bug.cgi?id=197305
5
6 Reviewed by NOBODY (OOPS!).
7
8 Currently it is a HashSet, but it only ever holds at most registerCount() items. And linear search tends to be faster on such a small collection than hashing + searching in a HashSet.
9 Further benefits include avoiding the allocation of the HashSet, not actually adding the nodes adjacent to V (since there are no duplicates in the adjacency lists).
10
11 This patch also contains a trivial optimization: if the remaining number of nodes to consider + the number of highOrderAdjacents already seen is smaller than registerCount() we can return true directly.
12 Apart from that, the patch got some trivial cleanup of GraphColoringRegisterAllocation::allocateOnBank() (that for example was only logging the number of iterations for FP registers, and not the more interesting number for GP registers).
13
14 The time spent in the register allocator throughout JetStream2 on this MacBook Pro moves from 3767 / 3710 / 3785 ms to 3551 / 3454 / 3503 ms.
15 So about a 6% speedup for that phase, and between 1 and 1.5% speedup for FTL/OMG compilation overall.
16
17 No new tests as there is no intended change to the code being generated, and this was already tested by running testb3 + JetStream2.
18
19 * b3/air/AirAllocateRegistersByGraphColoring.cpp:
20