Bug 185060 - [negative result] B3 should have generalized path specialization
Summary: [negative result] B3 should have generalized path specialization
Status: RESOLVED WONTFIX
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: Filip Pizlo
URL:
Keywords:
Depends on: 185069 185123
Blocks:
  Show dependency treegraph
 
Reported: 2018-04-26 17:17 PDT by Filip Pizlo
Modified: 2018-04-30 17:03 PDT (History)
9 users (show)

See Also:


Attachments
it's a start (22.27 KB, patch)
2018-04-26 17:18 PDT, Filip Pizlo
no flags Details | Formatted Diff | Diff
a bit more (25.99 KB, patch)
2018-04-26 19:31 PDT, Filip Pizlo
no flags Details | Formatted Diff | Diff
this phase is nuts (27.50 KB, patch)
2018-04-26 19:43 PDT, Filip Pizlo
no flags Details | Formatted Diff | Diff
I'm slowly putting this phase together (29.98 KB, patch)
2018-04-26 21:38 PDT, Filip Pizlo
no flags Details | Formatted Diff | Diff
close to written (35.77 KB, patch)
2018-04-27 16:40 PDT, Filip Pizlo
no flags Details | Formatted Diff | Diff
it might be written (50.17 KB, patch)
2018-04-27 19:23 PDT, Filip Pizlo
no flags Details | Formatted Diff | Diff
it's starting to compile (52.66 KB, patch)
2018-04-28 12:46 PDT, Filip Pizlo
no flags Details | Formatted Diff | Diff
it specialized something without crashing or emitting broken code (53.71 KB, patch)
2018-04-28 19:24 PDT, Filip Pizlo
no flags Details | Formatted Diff | Diff
it's starting to come to life (54.73 KB, patch)
2018-04-29 21:29 PDT, Filip Pizlo
no flags Details | Formatted Diff | Diff
mostly works, not a speed-up (64.69 KB, patch)
2018-04-30 17:03 PDT, Filip Pizlo
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Filip Pizlo 2018-04-26 17:17:45 PDT
Patch forthcoming.

I don't know if this will be profitable yet.  Reading IR in Octane, it seems like it might be.  Only one way to find out!
Comment 1 Filip Pizlo 2018-04-26 17:18:18 PDT
Created attachment 338939 [details]
it's a start
Comment 2 Filip Pizlo 2018-04-26 19:31:12 PDT
Created attachment 338952 [details]
a bit more
Comment 3 Filip Pizlo 2018-04-26 19:43:20 PDT
Created attachment 338954 [details]
this phase is nuts
Comment 4 Filip Pizlo 2018-04-26 21:38:25 PDT
Created attachment 338965 [details]
I'm slowly putting this phase together
Comment 5 Filip Pizlo 2018-04-27 16:40:44 PDT
Created attachment 339038 [details]
close to written
Comment 6 Filip Pizlo 2018-04-27 19:23:41 PDT
Created attachment 339050 [details]
it might be written
Comment 7 Filip Pizlo 2018-04-28 12:46:02 PDT
Created attachment 339075 [details]
it's starting to compile
Comment 8 Filip Pizlo 2018-04-28 19:24:26 PDT
Created attachment 339087 [details]
it specialized something without crashing or emitting broken code

It was a small function, too small to cause interesting compiler problems.
Comment 9 Filip Pizlo 2018-04-29 10:05:05 PDT
It's a 14% speed-up on the following benchmark. Note that we're duplicating a CheckAdd (which has a full OSR thingy). Note that we're not (yet) unswitching the loop, because the structure load is not hoisted out of the loop.

function foo(o) {
    var result = 0;
    for (var i = 0; i < 100; ++i) {
        result += o.f;
        o.f = i;
    }
    return result;
}

noInline(foo);

var before = preciseTime();
for (var i = 0; i < 100000; ++i) {
    var result = foo(i & 1 ? {f:42} : {e:41, f:42});
    if (result != (99 * 98) / 2 + 42)
        throw "Error: bad result: " + result;
}
var after = preciseTime();
print("That took " + (after - before) * 1000 + " ms");
Comment 10 Filip Pizlo 2018-04-29 21:29:29 PDT
Created attachment 339104 [details]
it's starting to come to life
Comment 11 Filip Pizlo 2018-04-30 16:38:42 PDT
Current perf data suggests that this is not a speed-up.  Will verify again once I fix some bugs.  But this is looking like a negative result, mostly because taildup is too darn good.
Comment 12 Filip Pizlo 2018-04-30 17:03:10 PDT
Created attachment 339163 [details]
mostly works, not a speed-up

Still has test failures.  But it's definitely not a speed-up, so I'm going to stop working on it.