RESOLVED FIXED 228615
[JSC/Air] Optimize enableMovesOnValueAndAdjacents in IRC
https://bugs.webkit.org/show_bug.cgi?id=228615
Summary [JSC/Air] Optimize enableMovesOnValueAndAdjacents in IRC
Robin Morisset
Reported 2021-07-29 15:37:04 PDT
The Iterated Register Coalescing (IRC) register coalescing spends a very significant fraction of its time in JS2 in enableMovesOnValueAndAdjacents (816ms out of 2.07s spent in register allocation for Wasm code in one particular run). The reason is that if this function is called on N nodes that are neighbors of each other, then enableMovesOnValue (which is kinda expensive as it iterates a SmallSet which is not always small) will be called N times on each of the N nodes. This can trivially be fixed by keeping track of which nodes need enableMovesOnValue called on them and only calling it on them once.
Attachments
Patch (4.54 KB, patch)
2021-07-29 15:50 PDT, Robin Morisset
saam: review+
Patch (4.51 KB, patch)
2021-11-18 14:31 PST, Robin Morisset
no flags
Robin Morisset
Comment 1 2021-07-29 15:50:06 PDT
Radar WebKit Bug Importer
Comment 2 2021-08-05 15:37:16 PDT
Saam Barati
Comment 3 2021-11-17 16:14:30 PST
Comment on attachment 434580 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=434580&action=review > Source/JavaScriptCore/b3/air/AirAllocateRegistersByGraphColoring.cpp:1322 > + // Set of Tmps whose moves are now ready for possible coalescing. > + BitVector m_hasMovesToEnable; nit: I'd name this "m_movesToEnable"
Robin Morisset
Comment 4 2021-11-18 14:31:43 PST
EWS
Comment 5 2021-11-18 22:06:41 PST
Committed r286045 (244432@main): <https://commits.webkit.org/244432@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 444739 [details].
Note You need to log in before you can comment on or make changes to this bug.