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

@@ -16,17 +16,17 @@ RWByteAddressBuffer src_storage : register(u1, space0);
typedef int4 ret_arr_ret[4];
ret_arr_ret ret_arr() {
const int4 tint_symbol_5[4] = (int4[4])0;
return tint_symbol_5;
}
S ret_struct_arr() {
const S tint_symbol_6 = (S)0;
const int4 tint_symbol_6[4] = (int4[4])0;
return tint_symbol_6;
}
typedef int4 tint_symbol_1_ret[4];
tint_symbol_1_ret tint_symbol_1(uint4 buffer[4], uint offset) {
S ret_struct_arr() {
const S tint_symbol_7 = (S)0;
return tint_symbol_7;
}
typedef int4 tint_symbol_2_ret[4];
tint_symbol_2_ret tint_symbol_2(uint4 buffer[4], uint offset) {
int4 arr_1[4] = (int4[4])0;
{
[loop] for(uint i = 0u; (i < 4u); i = (i + 1u)) {
@@ -37,8 +37,8 @@ tint_symbol_1_ret tint_symbol_1(uint4 buffer[4], uint offset) {
return arr_1;
}
typedef int4 tint_symbol_3_ret[4];
tint_symbol_3_ret tint_symbol_3(RWByteAddressBuffer buffer, uint offset) {
typedef int4 tint_symbol_4_ret[4];
tint_symbol_4_ret tint_symbol_4(RWByteAddressBuffer buffer, uint offset) {
int4 arr_2[4] = (int4[4])0;
{
[loop] for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) {
@@ -51,8 +51,8 @@ tint_symbol_3_ret tint_symbol_3(RWByteAddressBuffer buffer, uint offset) {
void foo(int4 src_param[4]) {
int4 src_function[4] = (int4[4])0;
int4 tint_symbol[4] = (int4[4])0;
const int4 tint_symbol_7[4] = {int4((1).xxxx), int4((2).xxxx), int4((3).xxxx), int4((3).xxxx)};
tint_symbol = tint_symbol_7;
const int4 tint_symbol_8[4] = {int4((1).xxxx), int4((2).xxxx), int4((3).xxxx), int4((3).xxxx)};
tint_symbol = tint_symbol_8;
tint_symbol = src_param;
tint_symbol = ret_arr();
const int4 src_let[4] = (int4[4])0;
@@ -60,9 +60,10 @@ void foo(int4 src_param[4]) {
tint_symbol = src_function;
tint_symbol = src_private;
tint_symbol = src_workgroup;
tint_symbol = ret_struct_arr().arr;
tint_symbol = tint_symbol_1(src_uniform, 0u);
tint_symbol = tint_symbol_3(src_storage, 0u);
const S tint_symbol_1 = ret_struct_arr();
tint_symbol = tint_symbol_1.arr;
tint_symbol = tint_symbol_2(src_uniform, 0u);
tint_symbol = tint_symbol_4(src_storage, 0u);
int dst_nested[4][3][2] = (int[4][3][2])0;
int src_nested[4][3][2] = (int[4][3][2])0;
dst_nested = src_nested;