summaryrefslogtreecommitdiffstats
path: root/tests/experimental
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2023-05-09 09:44:33 -0700
committerGitHub <noreply@github.com>2023-05-09 09:44:33 -0700
commit38ed03a7203baacf36fca62539ac74fd45ed42d2 (patch)
tree9648daee25c0a2aaac2fa8cd7d91908fd2aeef2f /tests/experimental
parent89a1234964a1927c4936a2758f72b7d6c9d0bc73 (diff)
Fix function side-effectness prop logic. (#2875)
Diffstat (limited to 'tests/experimental')
-rw-r--r--tests/experimental/liveness/liveness-4.slang.expected41
1 files changed, 7 insertions, 34 deletions
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;
}