Bug 197305 - [Air] highOrderAdjacents in AbstractColoringAllocator::conservativeHeuristic should be some kind of array
Summary: [Air] highOrderAdjacents in AbstractColoringAllocator::conservativeHeuristic ...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Robin Morisset
URL:
Keywords: InRadar
Depends on:
Blocks: 154319
  Show dependency treegraph
 
Reported: 2019-04-25 19:47 PDT by Robin Morisset
Modified: 2019-09-09 17:24 PDT (History)
8 users (show)

See Also:


Attachments
Patch (8.27 KB, patch)
2019-04-25 19:54 PDT, Robin Morisset
no flags Details | Formatted Diff | Diff
Patch (8.79 KB, patch)
2019-04-26 10:45 PDT, Robin Morisset
no flags Details | Formatted Diff | Diff
Patch (8.74 KB, patch)
2019-05-03 14:58 PDT, Robin Morisset
keith_miller: review+
ews-watchlist: commit-queue-
Details | Formatted Diff | Diff
Archive of layout-test-results from ews210 for win-future (13.70 MB, application/zip)
2019-05-03 17:38 PDT, EWS Watchlist
no flags Details
Patch (8.83 KB, patch)
2019-09-09 13:15 PDT, Robin Morisset
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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>