Bug 199537 - [WHLSL] The checker does not need to keep a separate m_typeAnnotations map
Summary: [WHLSL] The checker does not need to keep a separate m_typeAnnotations map
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebGPU (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Robin Morisset
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2019-07-05 16:39 PDT by Robin Morisset
Modified: 2019-07-05 17:34 PDT (History)
3 users (show)

See Also:


Attachments
Patch (4.93 KB, patch)
2019-07-05 16:42 PDT, Robin Morisset
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Robin Morisset 2019-07-05 16:39:34 PDT
Nothing is ever deleted from it, and all of its contents are eventually copied into the expressions.
We might as well put the type annotations directly into the expressions in the first place.
It is about a 5% speedup of the checker.
Comment 1 Robin Morisset 2019-07-05 16:42:31 PDT
Created attachment 373554 [details]
Patch
Comment 2 Myles C. Maxfield 2019-07-05 16:44:58 PDT
Comment on attachment 373554 [details]
Patch

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

> Source/WebCore/Modules/webgpu/WHLSL/WHLSLChecker.cpp:-845
> -    if (leftInfo->typeAnnotation.isRightValue()) {
> -        setError();
> -        return;
> -    }

Why? This seems important.
Comment 3 Robin Morisset 2019-07-05 16:46:15 PDT
(In reply to Myles C. Maxfield from comment #2)
> Comment on attachment 373554 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=373554&action=review
> 
> > Source/WebCore/Modules/webgpu/WHLSL/WHLSLChecker.cpp:-845
> > -    if (leftInfo->typeAnnotation.isRightValue()) {
> > -        setError();
> > -        return;
> > -    }
> 
> Why? This seems important.

It comes from auto leftInfo = recurseAndGetInfo(assignmentExpression.left(), true);
And the true in that means that we went through:
if (requiresLeftValue && typeAnnotation.isRightValue()) {
        setError();
        return WTF::nullopt;
    }
So it is redundant.
Comment 4 Myles C. Maxfield 2019-07-05 16:50:42 PDT
Comment on attachment 373554 [details]
Patch

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

>>> Source/WebCore/Modules/webgpu/WHLSL/WHLSLChecker.cpp:-845
>>> -    }
>> 
>> Why? This seems important.
> 
> It comes from auto leftInfo = recurseAndGetInfo(assignmentExpression.left(), true);
> And the true in that means that we went through:
> if (requiresLeftValue && typeAnnotation.isRightValue()) {
>         setError();
>         return WTF::nullopt;
>     }
> So it is redundant.

👍
Comment 5 WebKit Commit Bot 2019-07-05 17:33:07 PDT
Comment on attachment 373554 [details]
Patch

Clearing flags on attachment: 373554

Committed r247189: <https://trac.webkit.org/changeset/247189>
Comment 6 WebKit Commit Bot 2019-07-05 17:33:09 PDT
All reviewed patches have been landed.  Closing bug.
Comment 7 Radar WebKit Bug Importer 2019-07-05 17:34:19 PDT
<rdar://problem/52708994>