diff options
| author | Sai Praveen Bangaru <31557731+saipraveenb25@users.noreply.github.com> | 2023-04-26 15:46:24 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-04-26 15:46:24 -0400 |
| commit | e1940e53c0f76e91a2616693b261beb9190015be (patch) | |
| tree | 2ef14f1e81eb1cf0b003cf93102afdbd542f4750 /tests/experimental/liveness | |
| parent | a1739e87b5fb90b0a39c583f8d2468f851869c9f (diff) | |
For C-like targets, emit resource declarations before other globals (#2843)
* For C-like targets, emit resource declarations before other globals
* Remove unused tests
Diffstat (limited to 'tests/experimental/liveness')
6 files changed, 88 insertions, 88 deletions
diff --git a/tests/experimental/liveness/liveness-2.slang.expected b/tests/experimental/liveness/liveness-2.slang.expected index e0486f8da..3ae6d3875 100644 --- a/tests/experimental/liveness/liveness-2.slang.expected +++ b/tests/experimental/liveness/liveness-2.slang.expected @@ -6,6 +6,9 @@ standard output = { #extension GL_EXT_spirv_intrinsics : require layout(row_major) uniform; layout(row_major) buffer; +layout(std430, binding = 0) buffer _S1 { + int _data[]; +} outputBuffer_0; spirv_instruction(id = 256) void livenessStart_0(spirv_by_reference int _0[3], spirv_literal int _1); @@ -38,15 +41,12 @@ int calcThing_0(int offset_0) idx_0[i_0] = offset_0 + i_0; i_0 = i_0 + 1; } - int _S1 = idx_0[0] + idx_0[1]; - int _S2 = idx_0[2]; + int _S2 = idx_0[0] + idx_0[1]; + int _S3 = idx_0[2]; livenessEnd_1(idx_0, 0); - return _S1 + _S2; + return _S2 + _S3; } -layout(std430, binding = 0) buffer _S3 { - int _data[]; -} outputBuffer_0; layout(local_size_x = 4, local_size_y = 1, local_size_z = 1) in; void main() { diff --git a/tests/experimental/liveness/liveness-3.slang.expected b/tests/experimental/liveness/liveness-3.slang.expected index 7719c6bb1..78e80d7b5 100644 --- a/tests/experimental/liveness/liveness-3.slang.expected +++ b/tests/experimental/liveness/liveness-3.slang.expected @@ -6,6 +6,9 @@ standard output = { #extension GL_EXT_spirv_intrinsics : require layout(row_major) uniform; layout(row_major) buffer; +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); @@ -33,9 +36,9 @@ int calcThing_0(int offset_0) int k_0; livenessStart_1(k_0, 0); k_0 = 0; - int _S1; - livenessStart_1(_S1, 0); - _S1 = offset_0; + int _S2; + livenessStart_1(_S2, 0); + _S2 = offset_0; int total_0; livenessStart_1(total_0, 0); total_0 = 0; @@ -46,7 +49,7 @@ int calcThing_0(int offset_0) } else { - livenessEnd_0(_S1, 0); + livenessEnd_0(_S2, 0); livenessEnd_0(k_0, 0); break; } @@ -55,14 +58,14 @@ int calcThing_0(int offset_0) idx_0[0] = 0; idx_0[1] = 0; idx_0[2] = 0; - bool _S2 = (k_0 + 7) % 5 == 4; + bool _S3 = (k_0 + 7) % 5 == 4; int k_1 = k_0 + 1; int i_0; livenessStart_1(i_0, 0); i_0 = 0; - int _S3; - livenessStart_1(_S3, 0); - _S3 = _S1; + int _S4; + livenessStart_1(_S4, 0); + _S4 = _S2; for(;;) { if(i_0 < 17) @@ -75,63 +78,60 @@ int calcThing_0(int offset_0) } int modRange_0 = i_0 % 3; another_0[i_0 & 1] = another_0[i_0 & 1] + modRange_0; - int _S4; + int _S5; if(modRange_0 != 0) { - int _S5 = _S3; - livenessEnd_0(_S3, 0); - int _S6 = _S5 + 1; - livenessStart_1(_S4, 0); - _S4 = _S6; + int _S6 = _S4; + livenessEnd_0(_S4, 0); + int _S7 = _S6 + 1; + livenessStart_1(_S5, 0); + _S5 = _S7; } else { - int _S7 = _S3; - livenessEnd_0(_S3, 0); - livenessStart_1(_S4, 0); - _S4 = _S7; + int _S8 = _S4; + livenessEnd_0(_S4, 0); + livenessStart_1(_S5, 0); + _S5 = _S8; } - idx_0[modRange_0] = idx_0[modRange_0] + (_S4 + i_0); + idx_0[modRange_0] = idx_0[modRange_0] + (_S5 + i_0); i_0 = i_0 + 1; - livenessStart_1(_S3, 0); - int _S8 = _S4; - livenessEnd_0(_S4, 0); - _S3 = _S8; + livenessStart_1(_S4, 0); + int _S9 = _S5; + livenessEnd_0(_S5, 0); + _S4 = _S9; } - livenessEnd_0(_S1, 0); + livenessEnd_0(_S2, 0); livenessEnd_0(k_0, 0); - if(_S2) + if(_S3) { - livenessEnd_0(_S3, 0); + livenessEnd_0(_S4, 0); livenessEnd_1(idx_0, 0); livenessEnd_2(another_0, 0); return total_0; } - int _S9 = idx_0[0] + idx_0[1]; - int _S10 = idx_0[2]; + int _S10 = idx_0[0] + idx_0[1]; + int _S11 = idx_0[2]; livenessEnd_1(idx_0, 0); - int _S11 = _S9 + _S10; - int _S12 = total_0; + int _S12 = _S10 + _S11; + int _S13 = total_0; livenessEnd_0(total_0, 0); - int total_1 = _S12 + _S11; + int total_1 = _S13 + _S12; livenessStart_1(k_0, 0); k_0 = k_1; - livenessStart_1(_S1, 0); - int _S13 = _S3; - livenessEnd_0(_S3, 0); - _S1 = _S13; + livenessStart_1(_S2, 0); + int _S14 = _S4; + livenessEnd_0(_S4, 0); + _S2 = _S14; livenessStart_1(total_0, 0); total_0 = total_1; } livenessEnd_2(another_0, 0); - int _S14 = total_0; + int _S15 = total_0; livenessEnd_0(total_0, 0); - return - _S14; + return - _S15; } -layout(std430, binding = 0) buffer _S15 { - int _data[]; -} outputBuffer_0; layout(local_size_x = 4, local_size_y = 1, local_size_z = 1) in; void main() { diff --git a/tests/experimental/liveness/liveness-4.slang.expected b/tests/experimental/liveness/liveness-4.slang.expected index d6662c6a3..802388e40 100644 --- a/tests/experimental/liveness/liveness-4.slang.expected +++ b/tests/experimental/liveness/liveness-4.slang.expected @@ -6,6 +6,9 @@ standard output = { #extension GL_EXT_spirv_intrinsics : require layout(row_major) uniform; layout(row_major) buffer; +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); @@ -37,7 +40,7 @@ int calcThing_0(int offset_0) livenessEnd_0(k_0, 0); break; } - bool _S1 = (k_0 + 7) % 5 == 4; + bool _S2 = (k_0 + 7) % 5 == 4; int k_1 = k_0 + 1; int i_0; livenessStart_1(i_0, 0); @@ -56,7 +59,7 @@ int calcThing_0(int offset_0) i_0 = i_0 + 1; } livenessEnd_0(k_0, 0); - if(_S1) + if(_S2) { livenessEnd_1(another_0, 0); return 1; @@ -68,9 +71,6 @@ int calcThing_0(int offset_0) return -2; } -layout(std430, binding = 0) buffer _S2 { - int _data[]; -} outputBuffer_0; layout(local_size_x = 4, local_size_y = 1, local_size_z = 1) in; void main() { diff --git a/tests/experimental/liveness/liveness-5.slang.expected b/tests/experimental/liveness/liveness-5.slang.expected index c2ce1d741..901b93bc6 100644 --- a/tests/experimental/liveness/liveness-5.slang.expected +++ b/tests/experimental/liveness/liveness-5.slang.expected @@ -6,6 +6,9 @@ standard output = { #extension GL_EXT_spirv_intrinsics : require layout(row_major) uniform; layout(row_major) buffer; +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); @@ -40,7 +43,7 @@ int calcThing_0(int offset_0) livenessEnd_0(k_0, 0); break; } - bool _S1 = (k_0 + 7) % 5 == 4; + bool _S2 = (k_0 + 7) % 5 == 4; int k_1 = k_0 + 1; int i_0; livenessStart_1(i_0, 0); @@ -59,10 +62,10 @@ int calcThing_0(int offset_0) i_0 = i_0 + 1; } livenessEnd_0(k_0, 0); - int _S2 = total_0; + int _S3 = total_0; livenessEnd_0(total_0, 0); - int total_1 = _S2 + another_0[k_0 & 1]; - if(_S1) + int total_1 = _S3 + another_0[k_0 & 1]; + if(_S2) { livenessEnd_1(another_0, 0); return 1; @@ -83,9 +86,6 @@ int calcThing_0(int offset_0) return total_0; } -layout(std430, binding = 0) buffer _S3 { - int _data[]; -} outputBuffer_0; layout(local_size_x = 4, local_size_y = 1, local_size_z = 1) in; void main() { diff --git a/tests/experimental/liveness/liveness-6.slang.expected b/tests/experimental/liveness/liveness-6.slang.expected index 45e94a242..1fe9408c8 100644 --- a/tests/experimental/liveness/liveness-6.slang.expected +++ b/tests/experimental/liveness/liveness-6.slang.expected @@ -6,6 +6,9 @@ standard output = { #extension GL_EXT_spirv_intrinsics : require layout(row_major) uniform; layout(row_major) buffer; +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); @@ -44,8 +47,8 @@ int calcThing_0(int offset_0) livenessStart_0(arr_0, 0); arr_0[0] = 2; arr_0[1] = 3; - int _S1 = k_0 & 1; - bool _S2 = (k_0 + 7) % 5 == 4; + int _S2 = k_0 & 1; + bool _S3 = (k_0 + 7) % 5 == 4; int k_1 = k_0 + 1; int i_0; livenessStart_1(i_0, 0); @@ -61,17 +64,17 @@ int calcThing_0(int offset_0) break; } another_0[i_0 & 1] = another_0[i_0 & 1] + (k_0 + i_0); - arr_0[_S1] = arr_0[_S1] + i_0; + arr_0[_S2] = arr_0[_S2] + i_0; i_0 = i_0 + 1; } livenessEnd_0(k_0, 0); - int _S3 = total_0; + int _S4 = total_0; livenessEnd_0(total_0, 0); - int total_1 = _S3 + another_0[_S1]; - int _S4 = arr_0[_S1]; + int total_1 = _S4 + another_0[_S2]; + int _S5 = arr_0[_S2]; livenessEnd_1(arr_0, 0); - int total_2 = total_1 + _S4; - if(_S2) + int total_2 = total_1 + _S5; + if(_S3) { livenessEnd_1(another_0, 0); return 1; @@ -92,9 +95,6 @@ int calcThing_0(int offset_0) return total_0; } -layout(std430, binding = 0) buffer _S5 { - int _data[]; -} outputBuffer_0; layout(local_size_x = 4, local_size_y = 1, local_size_z = 1) in; void main() { diff --git a/tests/experimental/liveness/liveness.slang.expected b/tests/experimental/liveness/liveness.slang.expected index 46b8f0922..aadc15d90 100644 --- a/tests/experimental/liveness/liveness.slang.expected +++ b/tests/experimental/liveness/liveness.slang.expected @@ -6,6 +6,12 @@ standard output = { #extension GL_EXT_spirv_intrinsics : require layout(row_major) uniform; layout(row_major) buffer; +layout(std430, binding = 1) buffer _S1 { + int _data[]; +} anotherBuffer_0; +layout(std430, binding = 0) buffer _S2 { + int _data[]; +} outputBuffer_0; spirv_instruction(id = 256) void livenessStart_0(spirv_by_reference uint _0, spirv_literal int _1); @@ -20,17 +26,17 @@ void livenessEnd_1(spirv_by_reference uint _0, spirv_literal int _1); int someSlowFunc_0(int a_0) { - uint _S1 = uint(a_0); - int _S2 = a_0 * 20; + uint _S3 = uint(a_0); + int _S4 = a_0 * 20; uint v_0; livenessStart_0(v_0, 0); - v_0 = _S1; + v_0 = _S3; int i_0; livenessStart_1(i_0, 0); i_0 = 0; for(;;) { - if(i_0 < _S2) + if(i_0 < _S4) { } else @@ -38,13 +44,13 @@ int someSlowFunc_0(int a_0) livenessEnd_0(i_0, 0); break; } - uint _S3 = v_0 >> 1; - uint _S4 = v_0; + uint _S5 = v_0 >> 1; + uint _S6 = v_0; livenessEnd_1(v_0, 0); - uint _S5 = (_S3 | _S4 << 31) * uint(i_0); + uint _S7 = (_S5 | _S6 << 31) * uint(i_0); int i_1 = i_0 + 1; livenessStart_0(v_0, 0); - v_0 = _S5; + v_0 = _S7; i_0 = i_1; } return int(v_0); @@ -59,14 +65,11 @@ struct SomeStruct_0 SomeStruct_0 makeSomeStruct_0() { - const int _S6[100] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; - SomeStruct_0 s_0 = { 0, 0, _S6 }; + const int _S8[100] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; + SomeStruct_0 s_0 = { 0, 0, _S8 }; return s_0; } -layout(std430, binding = 1) buffer _S7 { - int _data[]; -} anotherBuffer_0; int doThing_0(SomeStruct_0 s_1) { return s_1.x_0 * 2 + 1; @@ -74,14 +77,11 @@ int doThing_0(SomeStruct_0 s_1) int somethingElse_0(inout SomeStruct_0 s_2) { - int _S8 = s_2.x_0 + 1; - s_2.x_0 = _S8; - return _S8; + int _S9 = s_2.x_0 + 1; + s_2.x_0 = _S9; + return _S9; } -layout(std430, binding = 0) buffer _S9 { - int _data[]; -} outputBuffer_0; spirv_instruction(id = 256) void livenessStart_2(spirv_by_reference SomeStruct_0 _0, spirv_literal int _1); |
