Bug 196234

Summary: Add a ValueRepReduction phase
Product: WebKit Reporter: Saam Barati <saam>
Component: JavaScriptCoreAssignee: Saam Barati <saam>
Status: RESOLVED FIXED    
Severity: Normal CC: benjamin, cdumez, commit-queue, ews-watchlist, fpizlo, ggaren, gskachkov, guijemont, keith_miller, mark.lam, msaboff, rmorisset, rniwa, ticaiolima, tzagallo, webkit-bug-importer, ysuzuki
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
WIP
none
WIP
none
patch
none
patch none

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>