Summary: | [WSL] Allow functions to have multiple pointer returns | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Myles C. Maxfield <mmaxfield> | ||||||||||
Component: | WebGPU | Assignee: | Myles C. Maxfield <mmaxfield> | ||||||||||
Status: | RESOLVED MOVED | ||||||||||||
Severity: | Normal | ||||||||||||
Priority: | P2 | ||||||||||||
Version: | Other | ||||||||||||
Hardware: | Unspecified | ||||||||||||
OS: | Unspecified | ||||||||||||
See Also: | https://bugs.webkit.org/show_bug.cgi?id=176967 | ||||||||||||
Bug Depends on: | |||||||||||||
Bug Blocks: | 176199 | ||||||||||||
Attachments: |
|
Description
Myles C. Maxfield
2017-10-28 17:57:26 PDT
Created attachment 325270 [details]
WIP
Created attachment 325305 [details]
Patch
Comment on attachment 325305 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=325305&action=review > Tools/WebGPUShadingLanguageRI/LogicalMode.js:117 > + [Node.visit(node.value, this), Node.visit(node.argumentList[1], this)]); s/node.argumentList[1]/this._subscript.argumentList[1]/ Created attachment 325322 [details]
Patch
Created attachment 325331 [details]
Patch
This is going to be tricky. On one hand, anders are not useful if they can't have multiple pointer returns. On the other hand, multiple pointer returns naively require phi operations over pointers. So we'll have to inline the ander and see if we can remove the pointer. But, for user-created types, any arbitrary stuff can be in the ander. So, we have to specify exactly what types of transformations the compiler will perform to try to remove these pointers. Seems that a policy of "anders are mostly useless, please use getters and setters instead" along with compiler optimizations is sufficient for now. Migrated to https://github.com/gpuweb/WHLSL/issues/121 |