From 38ed03a7203baacf36fca62539ac74fd45ed42d2 Mon Sep 17 00:00:00 2001 From: Yong He Date: Tue, 9 May 2023 09:44:33 -0700 Subject: Fix function side-effectness prop logic. (#2875) --- .../liveness/liveness-4.slang.expected | 41 ++++------------------ 1 file changed, 7 insertions(+), 34 deletions(-) (limited to 'tests/experimental') diff --git a/tests/experimental/liveness/liveness-4.slang.expected b/tests/experimental/liveness/liveness-4.slang.expected index 802388e40..ee7986319 100644 --- a/tests/experimental/liveness/liveness-4.slang.expected +++ b/tests/experimental/liveness/liveness-4.slang.expected @@ -10,25 +10,15 @@ layout(std430, binding = 0) buffer _S1 { int _data[]; } outputBuffer_0; spirv_instruction(id = 256) -void livenessStart_0(spirv_by_reference int _0[2], spirv_literal int _1); - -spirv_instruction(id = 256) -void livenessStart_1(spirv_by_reference int _0, spirv_literal int _1); +void livenessStart_0(spirv_by_reference int _0, spirv_literal int _1); spirv_instruction(id = 257) void livenessEnd_0(spirv_by_reference int _0, spirv_literal int _1); -spirv_instruction(id = 257) -void livenessEnd_1(spirv_by_reference int _0[2], spirv_literal int _1); - int calcThing_0(int offset_0) { - int another_0[2]; - livenessStart_0(another_0, 0); - another_0[0] = 1; - another_0[1] = 2; int k_0; - livenessStart_1(k_0, 0); + livenessStart_0(k_0, 0); k_0 = 0; for(;;) { @@ -41,33 +31,16 @@ int calcThing_0(int offset_0) break; } bool _S2 = (k_0 + 7) % 5 == 4; - int k_1 = k_0 + 1; - int i_0; - livenessStart_1(i_0, 0); - i_0 = 0; - for(;;) - { - if(i_0 < 17) - { - } - else - { - livenessEnd_0(i_0, 0); - break; - } - another_0[i_0 & 1] = another_0[i_0 & 1] + (k_0 + i_0); - i_0 = i_0 + 1; - } + int _S3 = k_0; livenessEnd_0(k_0, 0); + int k_1 = _S3 + 1; if(_S2) { - livenessEnd_1(another_0, 0); return 1; } - livenessStart_1(k_0, 0); + livenessStart_0(k_0, 0); k_0 = k_1; } - livenessEnd_1(another_0, 0); return -2; } @@ -75,8 +48,8 @@ layout(local_size_x = 4, local_size_y = 1, local_size_z = 1) in; void main() { int index_0 = int(gl_GlobalInvocationID.x); - int _S3 = calcThing_0(index_0); - ((outputBuffer_0)._data[(uint(index_0))]) = _S3; + int _S4 = calcThing_0(index_0); + ((outputBuffer_0)._data[(uint(index_0))]) = _S4; return; } -- cgit v1.2.3