Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WGSL] Only rewrite globals in callees once #14671

Conversation

tadeuzagallo
Copy link
Member

@tadeuzagallo tadeuzagallo commented Jun 5, 2023

3d3c9d7

[WGSL] Only rewrite globals in callees once
https://bugs.webkit.org/show_bug.cgi?id=257716
rdar://110265430

Reviewed by Dan Glastonbury.

A callee might be reached through multiple paths in the call graph (e.g. f->h and
f->g->h), so we need to keep track of the callees we already visited. However, when
we encounter a callee we already visited we (might) still need to rewrite all the
call sites to that callee if its signature was modified (i.e. if it needs global
variable(s) to be passed to it).

* Source/WebGPU/WGSL/GlobalVariableRewriter.cpp:
(WGSL::RewriteGlobalVariables::visitCallee):
* Source/WebGPU/WGSL/tests/valid/global-used-by-callee.wgsl:

Canonical link: https://commits.webkit.org/264931@main

2809df4

Misc iOS, tvOS & watchOS macOS Linux Windows
βœ… πŸ§ͺ style βœ… πŸ›  ios βœ… πŸ›  mac βœ… πŸ›  wpe   πŸ›  wincairo
βœ… πŸ›  ios-sim βœ… πŸ›  mac-AS-debug βœ… πŸ§ͺ wpe-wk2
βœ… πŸ§ͺ webkitperl βœ… πŸ§ͺ ios-wk2   πŸ§ͺ api-mac βœ… πŸ›  gtk
βœ… πŸ§ͺ ios-wk2-wpt   πŸ§ͺ gtk-wk2
  πŸ§ͺ api-ios βœ… πŸ§ͺ mac-wk2 βœ… πŸ§ͺ api-gtk
βœ… πŸ›  tv   πŸ§ͺ mac-AS-debug-wk2
βœ… πŸ›  tv-sim
βœ… πŸ›  πŸ§ͺ merge   πŸ›  watch
βœ… πŸ›  watch-sim

@tadeuzagallo tadeuzagallo self-assigned this Jun 5, 2023
@tadeuzagallo tadeuzagallo added the WebGPU For bugs in WebGPU label Jun 5, 2023
@tadeuzagallo tadeuzagallo changed the title [WGSL] [WGSL] Only rewrite globals in callees once Jun 5, 2023
Copy link
Contributor

@djg djg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@tadeuzagallo tadeuzagallo force-pushed the eng/WGSL-Only-rewrite-globals-in-callees-once branch from 3818bdb to 2809df4 Compare June 7, 2023 07:37
@tadeuzagallo tadeuzagallo added the merge-queue Applied to send a pull request to merge-queue label Jun 7, 2023
https://bugs.webkit.org/show_bug.cgi?id=257716
rdar://110265430

Reviewed by Dan Glastonbury.

A callee might be reached through multiple paths in the call graph (e.g. f->h and
f->g->h), so we need to keep track of the callees we already visited. However, when
we encounter a callee we already visited we (might) still need to rewrite all the
call sites to that callee if its signature was modified (i.e. if it needs global
variable(s) to be passed to it).

* Source/WebGPU/WGSL/GlobalVariableRewriter.cpp:
(WGSL::RewriteGlobalVariables::visitCallee):
* Source/WebGPU/WGSL/tests/valid/global-used-by-callee.wgsl:

Canonical link: https://commits.webkit.org/264931@main
@webkit-commit-queue webkit-commit-queue force-pushed the eng/WGSL-Only-rewrite-globals-in-callees-once branch from 2809df4 to 3d3c9d7 Compare June 7, 2023 08:27
@webkit-commit-queue
Copy link
Collaborator

Committed 264931@main (3d3c9d7): https://commits.webkit.org/264931@main

Reviewed commits have been landed. Closing PR #14671 and removing active labels.

@webkit-commit-queue webkit-commit-queue merged commit 3d3c9d7 into WebKit:main Jun 7, 2023
@webkit-commit-queue webkit-commit-queue removed the merge-queue Applied to send a pull request to merge-queue label Jun 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
WebGPU For bugs in WebGPU
Projects
None yet
4 participants