Bug 196234 - Add a ValueRepReduction phase
Summary: Add a ValueRepReduction phase
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Saam Barati
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2019-03-25 17:43 PDT by Saam Barati
Modified: 2019-04-02 13:54 PDT (History)
17 users (show)

See Also:


Attachments
WIP (24.18 KB, patch)
2019-03-27 18:26 PDT, Saam Barati
no flags Details | Formatted Diff | Diff
WIP (22.89 KB, patch)
2019-03-27 20:23 PDT, Saam Barati
no flags Details | Formatted Diff | Diff
patch (27.03 KB, patch)
2019-03-28 13:35 PDT, Saam Barati
no flags Details | Formatted Diff | Diff
patch (23.73 KB, patch)
2019-03-28 15:09 PDT, Saam Barati
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Saam Barati 2019-03-25 17:43:28 PDT
...
Comment 1 Saam Barati 2019-03-27 18:26:47 PDT
Created attachment 366140 [details]
WIP
Comment 2 Saam Barati 2019-03-27 19:07:12 PDT
I broke out 22 subtests in JS2 that are affected by this optimization. If I run those 22 tests on their own on iOS, it appears to be a 1-2% progression.
Comment 3 Saam Barati 2019-03-27 20:23:28 PDT
Created attachment 366145 [details]
WIP
Comment 4 Saam Barati 2019-03-28 13:35:24 PDT
Created attachment 366199 [details]
patch
Comment 5 Saam Barati 2019-03-28 13:46:45 PDT
Comment on attachment 366199 [details]
patch

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

> PerformanceTests/JetStream2/cli.js:46
> +//testList = ["typescript", "tagcloud-SP", "stanford-crypto-sha256", "stanford-crypto-pbkdf2", "stanford-crypto-aes", "raytrace", "pdfjs", "navier-stokes", "n-body-SP", "ML", "mandreel", "gbemu", "gaussian-blur", "float-mm.c", "crypto-aes-SP", "cdjs", "Box2D", "Basic", "base64-SP", "async-fs", "3d-raytrace-SP", "3d-cube-SP"]
> +
>  load("./JetStreamDriver.js");
>  
> +

Oops: I'll revert this.

> Source/JavaScriptCore/dfg/DFGStrengthReductionPhase.cpp:473
> +        case DoubleRep: {
> +            break;
> +
> +            if (m_node->child1()->op() != ValueRep)
> +                break;
> +            // FIXME: If we added a PurifyNaN node, we could just convert to being Identity(PurifyNaN(resultNode))
> +            if (m_node->child1().useKind() != RealNumberUse)
> +                break;
> +
> +            Node* valueRep = m_node->child1().node();
> +            if (valueRep->child1().useKind() != DoubleRepUse)
> +                break;
> +
> +            Node* resultNode = valueRep->child1().node();
> +            m_insertionSet.insertNode(
> +                m_nodeIndex, SpecNone, Check, m_node->origin,
> +                Edge(resultNode, DoubleRepRealUse));
> +            m_node->convertToIdentityOn(resultNode);
> +            m_changed = true;
> +            break;
> +        }
> +
> +        case MovHint: {
> +            break;
> +            if (m_node->child1()->op() != ValueRep)
> +                break;
> +            if (m_node->child1()->child1().useKind() != DoubleRepUse)
> +                break;
> +            m_node->child1() = Edge(m_node->child1()->child1().node(), DoubleRepUse);
> +            m_changed = true;
> +            break;
> +        }

Oops. I'll never these.
Comment 6 Saam Barati 2019-03-28 15:09:01 PDT
Created attachment 366214 [details]
patch
Comment 7 WebKit Commit Bot 2019-04-02 08:58:39 PDT
Comment on attachment 366214 [details]
patch

Clearing flags on attachment: 366214

Committed r243744: <https://trac.webkit.org/changeset/243744>
Comment 8 WebKit Commit Bot 2019-04-02 08:58:41 PDT
All reviewed patches have been landed.  Closing bug.
Comment 9 Radar WebKit Bug Importer 2019-04-02 13:54:31 PDT
<rdar://problem/49532927>