Bug 197305

Summary: [Air] highOrderAdjacents in AbstractColoringAllocator::conservativeHeuristic should be some kind of array
Product: WebKit Reporter: Robin Morisset <rmorisset>
Component: JavaScriptCoreAssignee: Robin Morisset <rmorisset>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, ews-watchlist, keith_miller, mark.lam, msaboff, saam, tzagallo, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 154319    
Attachments:
Description Flags
Patch
none
Patch
none
Patch
keith_miller: review+, ews-watchlist: commit-queue-
Archive of layout-test-results from ews210 for win-future
none
Patch none

Description Robin Morisset 2019-04-25 19:47:29 PDT
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.

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).
Comment 1 Robin Morisset 2019-04-25 19:54:37 PDT
Created attachment 368297 [details]
Patch

Approximately a 6% speedup for the register allocator.
Comment 2 EWS Watchlist 2019-04-25 19:55:50 PDT
Attachment 368297 [details] did not pass style-queue:


ERROR: Source/JavaScriptCore/b3/air/AirAllocateRegistersByGraphColoring.cpp:234:  Tests for true/false, null/non-null, and zero/non-zero should all be done without equality comparisons.  [readability/comparison_to_zero] [5]
Total errors found: 1 in 2 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Robin Morisset 2019-04-26 10:45:23 PDT
Created attachment 368334 [details]
Patch

Fix style nits.
Comment 4 Robin Morisset 2019-05-03 14:58:38 PDT
Created attachment 368998 [details]
Patch

Just rebased.
Comment 5 EWS Watchlist 2019-05-03 17:38:35 PDT
Comment on attachment 368998 [details]
Patch

Attachment 368998 [details] did not pass win-ews (win):
Output: https://webkit-queues.webkit.org/results/12093904

New failing tests:
http/tests/css/filters-on-iframes.html
svg/dynamic-updates/SVGRadialGradientElement-svgdom-href-prop.html
Comment 6 EWS Watchlist 2019-05-03 17:38:37 PDT
Created attachment 369031 [details]
Archive of layout-test-results from ews210 for win-future

The attached test failures were seen while running run-webkit-tests on the win-ews.
Bot: ews210  Port: win-future  Platform: CYGWIN_NT-10.0-17763-3.0.5-338.x86_64-x86_64-64bit
Comment 7 Keith Miller 2019-09-09 11:30:53 PDT
Comment on attachment 368998 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=368998&action=review

r=me

> Source/JavaScriptCore/b3/air/AirAllocateRegistersByGraphColoring.cpp:195
> +        Vector<IndexType, 100> highOrderAdjacents;

Why not just make this MacroAssembler::numGPRs + MacroAssembler::numFPRs? Alternatively you could make registerCount() constexpr.
Comment 8 Robin Morisset 2019-09-09 11:58:50 PDT
Comment on attachment 368998 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=368998&action=review

>> Source/JavaScriptCore/b3/air/AirAllocateRegistersByGraphColoring.cpp:195
>> +        Vector<IndexType, 100> highOrderAdjacents;
> 
> Why not just make this MacroAssembler::numGPRs + MacroAssembler::numFPRs? Alternatively you could make registerCount() constexpr.

Making registerCount() constexpr is very tricky since it is defined as the length of a vector that is passed through quite a bit of code.
I am currently testing MacroAssembler::numGPRs + MacroAssembler::numFPRs.
Comment 9 Robin Morisset 2019-09-09 13:15:37 PDT
Created attachment 378401 [details]
Patch

Submitting to EWS, I will cq+ it if it passes the tests.
Comment 10 WebKit Commit Bot 2019-09-09 17:23:56 PDT
Comment on attachment 378401 [details]
Patch

Clearing flags on attachment: 378401

Committed r249677: <https://trac.webkit.org/changeset/249677>
Comment 11 WebKit Commit Bot 2019-09-09 17:23:57 PDT
All reviewed patches have been landed.  Closing bug.
Comment 12 Radar WebKit Bug Importer 2019-09-09 17:24:28 PDT
<rdar://problem/55205490>