diff options
| author | Yong He <yonghe@outlook.com> | 2023-01-27 16:41:31 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-01-27 16:41:31 -0800 |
| commit | 4a66e9729175a89833e5db784bb64e6a7f60cdf2 (patch) | |
| tree | 6a3cb0da3a6682ac0f8b06e66cb8e5fcd6dff279 /tests/experimental | |
| parent | 93a6b6119b6b65c4f6b00ca12d745e21b679c82f (diff) | |
Register allocation during phi elimination. (#2613)
* Register allocation during phi elimination.
* Enhance the test case.
* Cleanup line breaks in test case.
* remove unncessary line break changes.
* More cleanups.
---------
Co-authored-by: Yong He <yhe@nvidia.com>
Diffstat (limited to 'tests/experimental')
| -rw-r--r-- | tests/experimental/liveness/liveness-3.slang.expected | 26 | ||||
| -rw-r--r-- | tests/experimental/liveness/liveness-5.slang.expected | 21 | ||||
| -rw-r--r-- | tests/experimental/liveness/liveness-6.slang.expected | 21 |
3 files changed, 25 insertions, 43 deletions
diff --git a/tests/experimental/liveness/liveness-3.slang.expected b/tests/experimental/liveness/liveness-3.slang.expected index 58f562d86..dac9ff1bd 100644 --- a/tests/experimental/liveness/liveness-3.slang.expected +++ b/tests/experimental/liveness/liveness-3.slang.expected @@ -52,13 +52,13 @@ int calcThing_0(int offset_0) livenessStart_2(idx_0, 0); const int _S3[3] = { 0, 0, 0 }; idx_0 = _S3; - int _S4 = _S2; int i_0; - int _S5; + int _S4; + int _S5 = _S2; livenessStart_1(i_0, 0); i_0 = 0; - livenessStart_1(_S5, 0); - _S5 = _S4; + livenessStart_1(_S4, 0); + _S4 = _S5; for(;;) { if(i_0 < 17) @@ -74,32 +74,32 @@ int calcThing_0(int offset_0) int _S7; if(_S6 != 0) { - int _S8 = _S5; - livenessEnd_0(_S5, 0); + int _S8 = _S4; + livenessEnd_0(_S4, 0); int _S9 = _S8 + 1; livenessStart_1(_S7, 0); _S7 = _S9; } else { - int _S10 = _S5; - livenessEnd_0(_S5, 0); + int _S10 = _S4; + livenessEnd_0(_S4, 0); livenessStart_1(_S7, 0); _S7 = _S10; } idx_0[modRange_0] = idx_0[modRange_0] + (_S7 + i_0); i_0 = i_0 + 1; - livenessStart_1(_S5, 0); + livenessStart_1(_S4, 0); int _S11 = _S7; livenessEnd_0(_S7, 0); - _S5 = _S11; + _S4 = _S11; } livenessEnd_0(i_0, 0); livenessEnd_0(_S2, 0); int _S12 = (k_0 + 7) % 5; if(_S12 == 4) { - livenessEnd_0(_S5, 0); + livenessEnd_0(_S4, 0); livenessEnd_1(idx_0, 0); livenessEnd_0(k_0, 0); livenessEnd_2(another_0, 0); @@ -114,8 +114,8 @@ int calcThing_0(int offset_0) int total_1 = _S16 + _S15; k_0 = k_0 + 1; livenessStart_1(_S2, 0); - int _S17 = _S5; - livenessEnd_0(_S5, 0); + int _S17 = _S4; + livenessEnd_0(_S4, 0); _S2 = _S17; livenessStart_1(total_0, 0); total_0 = total_1; diff --git a/tests/experimental/liveness/liveness-5.slang.expected b/tests/experimental/liveness/liveness-5.slang.expected index ea6e37036..a8a9707d7 100644 --- a/tests/experimental/liveness/liveness-5.slang.expected +++ b/tests/experimental/liveness/liveness-5.slang.expected @@ -72,35 +72,26 @@ int calcThing_0(int offset_0) } livenessEnd_0(k_0, 0); livenessEnd_1(another_0, 0); - int total_2; if(total_0 > 4) { - int _S5 = total_0; - livenessEnd_0(total_0, 0); - int _S6 = - _S5; - livenessStart_1(total_2, 0); - total_2 = _S6; + total_0 = - total_0; } else { - int _S7 = total_0; - livenessEnd_0(total_0, 0); - livenessStart_1(total_2, 0); - total_2 = _S7; } - return total_2; + return total_0; } -layout(std430, binding = 0) buffer _S8 { +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() { int index_0 = int(gl_GlobalInvocationID.x); - uint _S9 = uint(index_0); - int _S10 = calcThing_0(index_0); - ((outputBuffer_0)._data[(_S9)]) = _S10; + uint _S6 = uint(index_0); + int _S7 = calcThing_0(index_0); + ((outputBuffer_0)._data[(_S6)]) = _S7; return; } diff --git a/tests/experimental/liveness/liveness-6.slang.expected b/tests/experimental/liveness/liveness-6.slang.expected index 26a537330..402e19886 100644 --- a/tests/experimental/liveness/liveness-6.slang.expected +++ b/tests/experimental/liveness/liveness-6.slang.expected @@ -81,35 +81,26 @@ int calcThing_0(int offset_0) } livenessEnd_0(k_0, 0); livenessEnd_1(another_0, 0); - int total_3; if(total_0 > 4) { - int _S8 = total_0; - livenessEnd_0(total_0, 0); - int _S9 = - _S8; - livenessStart_1(total_3, 0); - total_3 = _S9; + total_0 = - total_0; } else { - int _S10 = total_0; - livenessEnd_0(total_0, 0); - livenessStart_1(total_3, 0); - total_3 = _S10; } - return total_3; + return total_0; } -layout(std430, binding = 0) buffer _S11 { +layout(std430, binding = 0) buffer _S8 { int _data[]; } outputBuffer_0; layout(local_size_x = 4, local_size_y = 1, local_size_z = 1) in; void main() { int index_0 = int(gl_GlobalInvocationID.x); - uint _S12 = uint(index_0); - int _S13 = calcThing_0(index_0); - ((outputBuffer_0)._data[(_S12)]) = _S13; + uint _S9 = uint(index_0); + int _S10 = calcThing_0(index_0); + ((outputBuffer_0)._data[(_S9)]) = _S10; return; } |
