Commit 0e703e5
committed
[WHLSL] Improve default constructor and emit fewer pointers in metal codegen
https://bugs.webkit.org/show_bug.cgi?id=200995
Reviewed by Myles C. Maxfield.
This patch makes it so that we:
1. Emit less code for copy constructors by omitting an unused variable.
2. Emit ternary expressions instead of if statements for conditional assignments.
3. Don't copy pointers for producing an lvalue from DereferenceExpression.
4. Lazily produce lvalues for GlobalVariableReference.
* Modules/webgpu/WHLSL/Metal/WHLSLFunctionWriter.cpp:
(WebCore::WHLSL::Metal::FunctionDefinitionWriter::visit):
* Modules/webgpu/WHLSL/Metal/WHLSLNativeFunctionWriter.cpp:
(WebCore::WHLSL::Metal::inlineNativeFunction):
Canonical link: https://commits.webkit.org/214732@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@248994 268f45cc-cd09-0410-ab3c-d52691b4dbfc1 parent 6745d3d commit 0e703e5
3 files changed
Lines changed: 32 additions & 27 deletions
File tree
- Source/WebCore
- Modules/webgpu/WHLSL/Metal
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
1 | 19 | | |
2 | 20 | | |
3 | 21 | | |
| |||
Lines changed: 9 additions & 22 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
535 | 535 | | |
536 | 536 | | |
537 | 537 | | |
538 | | - | |
539 | 538 | | |
540 | | - | |
| 539 | + | |
541 | 540 | | |
542 | 541 | | |
543 | | - | |
| 542 | + | |
544 | 543 | | |
545 | 544 | | |
546 | 545 | | |
| |||
649 | 648 | | |
650 | 649 | | |
651 | 650 | | |
652 | | - | |
| 651 | + | |
653 | 652 | | |
654 | | - | |
655 | | - | |
656 | | - | |
657 | 653 | | |
658 | 654 | | |
659 | | - | |
660 | | - | |
661 | | - | |
662 | | - | |
663 | | - | |
| 655 | + | |
664 | 656 | | |
665 | 657 | | |
666 | | - | |
| 658 | + | |
| 659 | + | |
667 | 660 | | |
668 | 661 | | |
669 | 662 | | |
| |||
711 | 704 | | |
712 | 705 | | |
713 | 706 | | |
714 | | - | |
715 | | - | |
716 | | - | |
717 | | - | |
718 | | - | |
719 | | - | |
| 707 | + | |
720 | 708 | | |
721 | 709 | | |
722 | 710 | | |
| |||
765 | 753 | | |
766 | 754 | | |
767 | 755 | | |
768 | | - | |
769 | 756 | | |
770 | | - | |
| 757 | + | |
771 | 758 | | |
772 | | - | |
| 759 | + | |
773 | 760 | | |
774 | 761 | | |
775 | 762 | | |
| |||
Lines changed: 5 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
146 | 146 | | |
147 | 147 | | |
148 | 148 | | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | 149 | | |
153 | 150 | | |
154 | 151 | | |
155 | 152 | | |
156 | 153 | | |
157 | 154 | | |
| 155 | + | |
| 156 | + | |
158 | 157 | | |
159 | 158 | | |
160 | 159 | | |
| |||
173 | 172 | | |
174 | 173 | | |
175 | 174 | | |
176 | | - | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
177 | 178 | | |
178 | | - | |
179 | 179 | | |
180 | 180 | | |
181 | 181 | | |
| |||
0 commit comments