Bug 200518 - [WHLSL] Prune unreachable stdlib functions after the Checker runs
Summary: [WHLSL] Prune unreachable stdlib functions after the Checker runs
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebGPU (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Saam Barati
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2019-08-07 14:24 PDT by Saam Barati
Modified: 2019-08-07 23:24 PDT (History)
10 users (show)

See Also:


Attachments
patch (11.29 KB, patch)
2019-08-07 14:59 PDT, Saam Barati
no flags Details | Formatted Diff | Diff
patch (11.31 KB, patch)
2019-08-07 15:02 PDT, Saam Barati
rmorisset: review+
Details | Formatted Diff | Diff
patch for landing (11.35 KB, patch)
2019-08-07 16:15 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-08-07 14:24:20 PDT
...
Comment 1 Saam Barati 2019-08-07 14:59:17 PDT
Created attachment 375757 [details]
patch
Comment 2 EWS Watchlist 2019-08-07 15:01:06 PDT
Attachment 375757 [details] did not pass style-queue:


ERROR: Source/WebCore/Modules/webgpu/WHLSL/WHLSLPrepare.cpp:43:  Alphabetical sorting problem.  [build/include_order] [4]
Total errors found: 1 in 6 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Saam Barati 2019-08-07 15:02:24 PDT
Created attachment 375758 [details]
patch
Comment 4 Robin Morisset 2019-08-07 15:12:50 PDT
Comment on attachment 375758 [details]
patch

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

I think this patch also makes the ReachableFunctionGatherer that runs later obsolete since it will only ever receive reachable functions.

> Source/WebCore/Modules/webgpu/WHLSL/WHLSLPruneUnreachableStandardLibraryFunctions.cpp:82
> +        if (function->entryPointType() || function->parsingMode() != ParsingMode::StandardLibrary)

I don't think you need the first part of this check: the entryPointType is certainly user-defined, no?
Comment 5 Saam Barati 2019-08-07 15:29:07 PDT
(In reply to Robin Morisset from comment #4)
> Comment on attachment 375758 [details]
> patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=375758&action=review
> 
> I think this patch also makes the ReachableFunctionGatherer that runs later
> obsolete since it will only ever receive reachable functions.
> 
Not quite. That also prunes native functions.

> > Source/WebCore/Modules/webgpu/WHLSL/WHLSLPruneUnreachableStandardLibraryFunctions.cpp:82
> > +        if (function->entryPointType() || function->parsingMode() != ParsingMode::StandardLibrary)
> 
> I don't think you need the first part of this check: the entryPointType is
> certainly user-defined, no?
Yes this is true. I just thought it's nice to call it out explicitly, but I can assert instead.
Comment 6 Saam Barati 2019-08-07 15:30:11 PDT
(In reply to Saam Barati from comment #5)
> (In reply to Robin Morisset from comment #4)
> > Comment on attachment 375758 [details]
> > patch
> > 
> > View in context:
> > https://bugs.webkit.org/attachment.cgi?id=375758&action=review
> > 
> > I think this patch also makes the ReachableFunctionGatherer that runs later
> > obsolete since it will only ever receive reachable functions.
> > 
> Not quite. That also prunes native functions.
More importantly, we can prune non stdlib functions later on.

> 
> > > Source/WebCore/Modules/webgpu/WHLSL/WHLSLPruneUnreachableStandardLibraryFunctions.cpp:82
> > > +        if (function->entryPointType() || function->parsingMode() != ParsingMode::StandardLibrary)
> > 
> > I don't think you need the first part of this check: the entryPointType is
> > certainly user-defined, no?
> Yes this is true. I just thought it's nice to call it out explicitly, but I
> can assert instead.
Comment 7 Robin Morisset 2019-08-07 15:30:36 PDT
Comment on attachment 375758 [details]
patch

r=me
Comment 8 Saam Barati 2019-08-07 16:15:14 PDT
Created attachment 375763 [details]
patch for landing
Comment 9 WebKit Commit Bot 2019-08-07 23:23:04 PDT
Comment on attachment 375763 [details]
patch for landing

Clearing flags on attachment: 375763

Committed r248403: <https://trac.webkit.org/changeset/248403>
Comment 10 WebKit Commit Bot 2019-08-07 23:23:06 PDT
All reviewed patches have been landed.  Closing bug.
Comment 11 Radar WebKit Bug Importer 2019-08-07 23:24:15 PDT
<rdar://problem/54067367>