WHLSLFunctionWriter.cpp has a few blatantly unnecessary/inneficient parts: - FunctionDeclarationWriter is a subclass of Visitor for no reason, it could just be a stand-alone function - We convert a few times between StringBuilder and String. We could just keep a single StringBuilder throughout. - We give a name to every function in functionMapping, even those that we know at that point not to be reachable. - When computing reachable functions we can visit each function many times (exponential complexity, same problem that we already fixed in the recursion checker)
Created attachment 375586 [details] Patch
Comment on attachment 375586 [details] Patch It conflicts with the patch that inlines native functions.
Created attachment 375591 [details] Patch Properly rebased. One of the simplifications is gone because it no longer makes sense (we no longer want to emit native function declarations, even if they're reachable).
Attachment 375591 [details] did not pass style-queue: ERROR: Source/WebCore/Modules/webgpu/WHLSL/Metal/WHLSLFunctionWriter.cpp:740: Wrong number of spaces before statement. (expected: 12) [whitespace/indent] [4] ERROR: Source/WebCore/Modules/webgpu/WHLSL/Metal/WHLSLFunctionWriter.cpp:767: Wrong number of spaces before statement. (expected: 12) [whitespace/indent] [4] Total errors found: 2 in 2 files If any of these errors are false positives, please file a bug against check-webkit-style.
Created attachment 375721 [details] Patch Rebased, most of the part disappeared because it was duplicated in https://bugs.webkit.org/attachment.cgi?id=375632&action=prettypatch
Comment on attachment 375721 [details] Patch Clearing flags on attachment: 375721 Committed r248384: <https://trac.webkit.org/changeset/248384>
All reviewed patches have been landed. Closing bug.
<rdar://problem/54046511>