Bug 178986

Summary: [WSL] Allow functions to have multiple pointer returns
Product: WebKit Reporter: Myles C. Maxfield <mmaxfield>
Component: WebGPUAssignee: 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 Flags
WIP
none
Patch
none
Patch
none
Patch none

Description Myles C. Maxfield 2017-10-28 17:57:26 PDT
This is needed for anders.
Comment 1 Myles C. Maxfield 2017-10-28 17:58:24 PDT
Created attachment 325270 [details]
WIP
Comment 2 Myles C. Maxfield 2017-10-29 17:11:45 PDT
Created attachment 325305 [details]
Patch
Comment 3 Myles C. Maxfield 2017-10-29 17:13:01 PDT
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]/
Comment 4 Myles C. Maxfield 2017-10-29 21:56:06 PDT
Created attachment 325322 [details]
Patch
Comment 5 Myles C. Maxfield 2017-10-30 00:09:17 PDT
Created attachment 325331 [details]
Patch
Comment 6 Myles C. Maxfield 2018-08-29 17:14:00 PDT
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.
Comment 7 Myles C. Maxfield 2018-09-06 15:12:55 PDT
Seems that a policy of "anders are mostly useless, please use getters and setters instead" along with compiler optimizations is sufficient for now.
Comment 8 Myles C. Maxfield 2018-10-13 15:56:55 PDT
Migrated to https://github.com/gpuweb/WHLSL/issues/121