PromoteSideEffectsToDecl: add to 4 backends and regen tests

Added to hlsl, msl, glsl, and spirv backends.

Bug: tint:1300
Change-Id: I06062bd8e4b32acbc4a8670b060a7a22bc1ae034
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/80600
Reviewed-by: Ben Clayton <bclayton@google.com>
Reviewed-by: James Price <jrprice@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Antonio Maiorano <amaiorano@google.com>
This commit is contained in:
Antonio Maiorano
2022-03-15 15:35:13 +00:00
committed by Tint LUCI CQ
parent c25ddf4b1c
commit 93baaae60b
80 changed files with 915 additions and 742 deletions

View File

@@ -10,13 +10,13 @@ struct S {
};
tint_array_wrapper ret_arr() {
tint_array_wrapper const tint_symbol = {.arr={}};
return tint_symbol;
tint_array_wrapper const tint_symbol_1 = {.arr={}};
return tint_symbol_1;
}
S ret_struct_arr() {
S const tint_symbol_1 = {};
return tint_symbol_1;
S const tint_symbol_2 = {};
return tint_symbol_2;
}
struct tint_array_wrapper_3 {
@@ -31,21 +31,22 @@ struct tint_array_wrapper_1 {
tint_array_wrapper_2 arr[4];
};
void foo(tint_array_wrapper src_param, thread tint_array_wrapper* const tint_symbol_3, threadgroup tint_array_wrapper* const tint_symbol_4, const constant S* const tint_symbol_5, device S* const tint_symbol_6) {
void foo(tint_array_wrapper src_param, thread tint_array_wrapper* const tint_symbol_4, threadgroup tint_array_wrapper* const tint_symbol_5, const constant S* const tint_symbol_6, device S* const tint_symbol_7) {
tint_array_wrapper src_function = {};
tint_array_wrapper dst = {};
tint_array_wrapper const tint_symbol_2 = {.arr={int4(1), int4(2), int4(3), int4(3)}};
dst = tint_symbol_2;
tint_array_wrapper const tint_symbol_3 = {.arr={int4(1), int4(2), int4(3), int4(3)}};
dst = tint_symbol_3;
dst = src_param;
dst = ret_arr();
tint_array_wrapper const src_let = {.arr={}};
dst = src_let;
dst = src_function;
dst = *(tint_symbol_3);
dst = *(tint_symbol_4);
dst = ret_struct_arr().arr;
dst = (*(tint_symbol_5)).arr;
dst = *(tint_symbol_5);
S const tint_symbol = ret_struct_arr();
dst = tint_symbol.arr;
dst = (*(tint_symbol_6)).arr;
dst = (*(tint_symbol_7)).arr;
tint_array_wrapper_1 dst_nested = {};
tint_array_wrapper_1 src_nested = {};
dst_nested = src_nested;