12019-10-07 Robin Morisset <rmorisset@apple.com>
2
3 Optimize Air::TmpWidth analysis in IRC
4 https://bugs.webkit.org/show_bug.cgi?id=152478
5
6 Reviewed by NOBODY (OOPS!).
7
8 AirTmpWidth currently uses a HashMap to map tmps to their width.
9 Since tmps have consecutive indices, we can instead use vectors (one for GP and one for FP tmps).
10 As a bonus, we can just compute the width of the tmps of the bank the register allocator is currently looking at.
11 This cuts the time spent in the register allocator in JetStream2 by about 100ms out of 3.4s
12 (or sometimes 80ms out of 2.4, the bimodality of the time spent is due to a huge function in tagcloud-SP which usually but not always reach the FTL, I'll check later if it can be fixed by tweaking the inliner).
13
14 * b3/air/AirAllocateRegistersByGraphColoring.cpp:
15 (JSC::B3::Air::allocateRegistersByGraphColoring):
16 * b3/air/AirTmpWidth.cpp:
17 (JSC::B3::Air::TmpWidth::TmpWidth):
18 (JSC::B3::Air::TmpWidth::recompute):
19 * b3/air/AirTmpWidth.h:
20 (JSC::B3::Air::TmpWidth::width const):
21 (JSC::B3::Air::TmpWidth::requiredWidth):
22 (JSC::B3::Air::TmpWidth::defWidth const):
23 (JSC::B3::Air::TmpWidth::useWidth const):
24 (JSC::B3::Air::TmpWidth::Widths::Widths):
25 (JSC::B3::Air::TmpWidth::getWidths):
26 (JSC::B3::Air::TmpWidth::getWidths const):
27 (JSC::B3::Air::TmpWidth::addWidths):
28 (JSC::B3::Air::TmpWidth::getWidthsVector):
29