Bug 127245 - Enable LLVM TailDup
Summary: Enable LLVM TailDup
Status: RESOLVED DUPLICATE of bug 150279
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Filip Pizlo
Depends on:
Blocks: 132356
  Show dependency treegraph
Reported: 2014-01-18 20:17 PST by Filip Pizlo
Modified: 2016-02-15 16:27 PST (History)
10 users (show)

See Also:

jsc patch (2.17 KB, patch)
2014-01-18 20:20 PST, Filip Pizlo
ggaren: review+
Details | Formatted Diff | Diff
llvm patch (32.05 KB, patch)
2014-01-18 20:21 PST, 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 2014-01-18 20:17:58 PST
Patch forthcoming.
Comment 1 Filip Pizlo 2014-01-18 20:20:08 PST
Created attachment 221578 [details]
jsc patch
Comment 2 Filip Pizlo 2014-01-18 20:21:15 PST
Created attachment 221579 [details]
llvm patch

This just reverts LLVM r138841, and then updates the code a bit to various internal API changes.
Comment 3 Geoffrey Garen 2014-01-18 22:33:14 PST
Comment on attachment 221578 [details]
jsc patch

Comment 4 Geoffrey Garen 2014-01-18 22:35:07 PST
Comment on attachment 221579 [details]
llvm patch

Seems like it would be best to get this into LLVM trunk first.
Comment 5 Filip Pizlo 2014-01-18 22:39:16 PST
(In reply to comment #4)
> (From update of attachment 221579 [details])
> Seems like it would be best to get this into LLVM trunk first.

Yeah - that's definitely a blocker.

At the time that they removed TailDup there seemed to be multiple good justifications for doing so:

- It de-SSAifies the IR in a weird non-canonical way.
- It has demonstrably bad heuristics for important things like switch.
- It was unused in LLVM.

So it may be a challenge to get it pushed back in.  I suspect that this optimization is only good for JS because JS is so weird.
Comment 6 Filip Pizlo 2016-02-15 16:27:41 PST
We wrote our own compiler, and it has taildup.

*** This bug has been marked as a duplicate of bug 150279 ***