Bug 186175 - [BigInt] Add ValueMul into DFG
Summary: [BigInt] Add ValueMul into DFG
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Caio Lima
URL:
Keywords: InRadar
Depends on:
Blocks: 186173
  Show dependency treegraph
 
Reported: 2018-05-31 19:09 PDT by Caio Lima
Modified: 2018-12-14 16:16 PST (History)
10 users (show)

See Also:


Attachments
WIP - Patch (25.92 KB, patch)
2018-11-20 09:37 PST, Caio Lima
no flags Details | Formatted Diff | Diff
WIP - Patch (30.30 KB, patch)
2018-11-28 17:25 PST, Caio Lima
no flags Details | Formatted Diff | Diff
WIP - Patch (30.32 KB, patch)
2018-11-29 04:20 PST, Caio Lima
no flags Details | Formatted Diff | Diff
WIP - Patch (30.76 KB, patch)
2018-12-04 16:31 PST, Caio Lima
no flags Details | Formatted Diff | Diff
Archive of layout-test-results from ews100 for mac-sierra (2.47 MB, application/zip)
2018-12-05 00:42 PST, EWS Watchlist
no flags Details
WIP - Patch (33.31 KB, patch)
2018-12-06 05:35 PST, Caio Lima
no flags Details | Formatted Diff | Diff
Patch (35.54 KB, patch)
2018-12-08 04:56 PST, Caio Lima
no flags Details | Formatted Diff | Diff
Benchmarks results (96.59 KB, text/plain)
2018-12-10 12:22 PST, Caio Lima
no flags Details
Patch (35.48 KB, patch)
2018-12-10 12:24 PST, Caio Lima
no flags Details | Formatted Diff | Diff
Patch (35.48 KB, patch)
2018-12-10 12:42 PST, Caio Lima
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Caio Lima 2018-05-31 19:09:34 PDT
...
Comment 1 Caio Lima 2018-11-20 09:37:07 PST
Created attachment 355348 [details]
WIP - Patch
Comment 2 Caio Lima 2018-11-28 17:25:00 PST
Created attachment 355948 [details]
WIP - Patch
Comment 3 Caio Lima 2018-11-29 04:20:43 PST
Created attachment 356002 [details]
WIP - Patch
Comment 4 Caio Lima 2018-12-04 16:31:01 PST
Created attachment 356551 [details]
WIP - Patch
Comment 5 EWS Watchlist 2018-12-05 00:42:13 PST
Comment on attachment 356551 [details]
WIP - Patch

Attachment 356551 [details] did not pass mac-ews (mac):
Output: https://webkit-queues.webkit.org/results/10275208

New failing tests:
http/tests/misc/resource-timing-resolution.html
Comment 6 EWS Watchlist 2018-12-05 00:42:15 PST
Created attachment 356590 [details]
Archive of layout-test-results from ews100 for mac-sierra

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: ews100  Port: mac-sierra  Platform: Mac OS X 10.12.6
Comment 7 Caio Lima 2018-12-06 05:35:24 PST
Created attachment 356725 [details]
WIP - Patch
Comment 8 Caio Lima 2018-12-08 04:56:03 PST
Created attachment 356873 [details]
Patch
Comment 9 Yusuke Suzuki 2018-12-10 02:09:08 PST
Comment on attachment 356873 [details]
Patch

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

r=me with nits

> Source/JavaScriptCore/dfg/DFGFixupPhase.cpp:79
> +    void fixupMultiplication(Node* node, Edge& leftChild, Edge& rightChild)

I prefer the name `fixupArithMul`, since it is only used for ArithMul.

> Source/JavaScriptCore/dfg/DFGPredictionPropagationPhase.cpp:344
> +                    mergePrediction(SpecInt32Only);

`change |= mergePrediction(SpecInt32Only)` is required.
Comment 10 Caio Lima 2018-12-10 12:03:37 PST
Comment on attachment 356873 [details]
Patch

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

Thank you very much for the review!

>> Source/JavaScriptCore/dfg/DFGFixupPhase.cpp:79
>> +    void fixupMultiplication(Node* node, Edge& leftChild, Edge& rightChild)
> 
> I prefer the name `fixupArithMul`, since it is only used for ArithMul.

Better name. Changed.

>> Source/JavaScriptCore/dfg/DFGPredictionPropagationPhase.cpp:344
>> +                    mergePrediction(SpecInt32Only);
> 
> `change |= mergePrediction(SpecInt32Only)` is required.

Oops. Nice catch.
Comment 11 Caio Lima 2018-12-10 12:22:26 PST
Created attachment 356979 [details]
Benchmarks results

Benchmark is perf neutral into x86_64.
Comment 12 Caio Lima 2018-12-10 12:24:54 PST
Created attachment 356981 [details]
Patch
Comment 13 Caio Lima 2018-12-10 12:42:37 PST
Created attachment 356984 [details]
Patch
Comment 14 WebKit Commit Bot 2018-12-10 13:11:52 PST
Comment on attachment 356984 [details]
Patch

Clearing flags on attachment: 356984

Committed r239045: <https://trac.webkit.org/changeset/239045>
Comment 15 WebKit Commit Bot 2018-12-10 13:11:53 PST
All reviewed patches have been landed.  Closing bug.
Comment 16 Radar WebKit Bug Importer 2018-12-10 13:12:29 PST
<rdar://problem/46605762>
Comment 17 Saam Barati 2018-12-14 09:34:39 PST
Comment on attachment 356984 [details]
Patch

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

> Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h:858
> +        clobberWorld();

Why do we clobberWorld if we speculate BigInt?

> Source/JavaScriptCore/dfg/DFGClobberize.h:653
> +    case ValueMul:

I think we can define a CSE rule for this when speculating BigInt
Comment 18 Caio Lima 2018-12-14 16:16:25 PST
Comment on attachment 356984 [details]
Patch

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

>> Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h:858
>> +        clobberWorld();
> 
> Why do we clobberWorld if we speculate BigInt?

I implemented thinking in being conservative, but I think I was very pessimistic about SpecBigInt. I think we should support constant propagation/folding and CSE as well, so we can change such rules. IIRC, I'm following the same thing into all other ValueArith nodes.

>> Source/JavaScriptCore/dfg/DFGClobberize.h:653
>> +    case ValueMul:
> 
> I think we can define a CSE rule for this when speculating BigInt

I agree. Created the following bug: https://bugs.webkit.org/show_bug.cgi?id=192723