summaryrefslogtreecommitdiff
path: root/tests/experimental/liveness/liveness.slang.expected
diff options
context:
space:
mode:
authorjsmall-nvidia <jsmall@nvidia.com>2022-06-13 14:00:48 -0400
committerGitHub <noreply@github.com>2022-06-13 14:00:48 -0400
commit68d9d87f9385a8c7c29443dcfcbf70434dc889bd (patch)
tree2898c7443e21c311b4a2aa3ba36f9c07e5ae1bd0 /tests/experimental/liveness/liveness.slang.expected
parent522e14116b7c7d4eccf0a855ffbcc2076d44db88 (diff)
Liveness fixes and improvements (#2270)
* #include an absolute path didn't work - because paths were taken to always be relative. * Use TerminatedUnownedStringSlice for literals in output C++. * Remove Escape/Unescape functions used in slang-token-reader.cpp Add target type of 'host-cpp' etc to map to the target types. * Fix some corner cases around string encoding. * Added unit test for string escaping. Fixed some assorted escaping bugs. * Updated test output. * Added decode test. * Stop using hex output, to get around 'greedy' aspect. Use octal instead. * Added HostHostCallable Small changes to use ArtifactDesc/Info instead of large switches. * Fix C++ emit to handle arbitrary function export. * Add options handling for callable without an output being specified. * Can compile with COM interface. Added example using com interface. * Use the IR Ptr type instead of hack in C++ emit for interfaces. * Fix issue with outputting the COM call when ptr is used. * Fix crash issue on compilation failure. * Add support for __global. * Added `ActualGlobalRate` Added special handling around globals and COM interfaces. Tested out in cpu-com-example. * Fix typo in NodeBase. * Support for accessing globals by name working. * Bounds checking for C++ Improved bounds checks for CUDA. * Check that actual global initialization is working. * Fix typo. * Refactor the com replacement such that it doesn't need a cache or do anything special with GlobalVar. * Fix typo in CUDA prelude. * Remove context. Only create replacement if needed. * Split out COM host-callable into a unit-test. * host-callable com testing on C++and llvm. * Comment around the COM ptr replacement. * WIP Zero bound test. * Disable com test on vs 32 bit. Fix C++ prelude * Disable 32 bit targets testing com host-callable. * For now disable zero index test. * Enable bounds checking for CPU/CUDA. * Small fixes. Disable CUDA zero index bound fix. * Add test result for bound check. * Work around for index wrapping issue. * Added Fixed array test. * Only enable prelude asserts via SLANG_PRELUDE_ENABLE_ASSERT (unless defined by the user) * Small fix around instCount. * Improve liveness loop handing and tests. * Improve liveness comment. * More conservative loop handling. * Make liveness deterministic to make testing work. * Added 'span tidy' Added some more tests. * Simplify span simplification, because could collapse inappropriate spans. * Updated liveness with simple loop tracking. * Update test results. * Small tidy up. * Update comments in liveness tests. * Improve liveness comments. * Loop handling without needing LoopInfo tracking. * Improve liveness comments. * Small fix around removing uninteresting spans. Improve naming.
Diffstat (limited to 'tests/experimental/liveness/liveness.slang.expected')
-rw-r--r--tests/experimental/liveness/liveness.slang.expected253
1 files changed, 30 insertions, 223 deletions
diff --git a/tests/experimental/liveness/liveness.slang.expected b/tests/experimental/liveness/liveness.slang.expected
index 7301d88bf..c74206573 100644
--- a/tests/experimental/liveness/liveness.slang.expected
+++ b/tests/experimental/liveness/liveness.slang.expected
@@ -6,55 +6,29 @@ standard output = {
#extension GL_EXT_spirv_intrinsics : require
layout(row_major) uniform;
layout(row_major) buffer;
-
-#line 85 0
spirv_instruction(id = 256)
void livenessStart_0(spirv_by_reference int _0, spirv_literal int _1);
-
-#line 85
spirv_instruction(id = 256)
void livenessStart_1(spirv_by_reference uint _0, spirv_literal int _1);
-
-#line 85
spirv_instruction(id = 257)
void livenessEnd_0(spirv_by_reference uint _0, spirv_literal int _1);
-
-#line 85
spirv_instruction(id = 257)
void livenessEnd_1(spirv_by_reference int _0, spirv_literal int _1);
-
-#line 24 1
int someSlowFunc_0(int a_0)
{
uint _S1 = uint(a_0);
-
-#line 26
int i_0;
-
-#line 26
uint v_0;
-
-#line 26
livenessStart_0(i_0, 0);
-
-#line 26
i_0 = 0;
-
-#line 26
livenessStart_1(v_0, 0);
-
-#line 26
v_0 = _S1;
-
-#line 26
for(;;)
{
-
-#line 27
if(i_0 < a_0 * 20)
{
}
@@ -62,53 +36,18 @@ int someSlowFunc_0(int a_0)
{
break;
}
-
-#line 29
uint _S2 = v_0 >> 1;
-
-#line 29
uint _S3 = v_0;
-
-#line 29
livenessEnd_0(v_0, 0);
-
-#line 29
uint _S4 = (_S2 | _S3 << 31) * uint(i_0);
-
-#line 27
- int _S5 = i_0;
-
-#line 27
- livenessEnd_1(i_0, 0);
-
-#line 27
- int i_1 = _S5 + 1;
-
-#line 27
- livenessStart_0(i_0, 0);
-
-#line 27
- i_0 = i_1;
-
-#line 27
+ i_0 = i_0 + 1;
livenessStart_1(v_0, 0);
-
-#line 27
v_0 = _S4;
-
-#line 27
}
-
-#line 27
livenessEnd_1(i_0, 0);
-
-
-
return int(v_0);
}
-
-#line 6
struct SomeStruct_0
{
int a_1;
@@ -116,239 +55,107 @@ struct SomeStruct_0
int c_0[100];
};
-
-#line 17
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 };
-
-#line 19
- SomeStruct_0 s_0 = { 0, 0, _S6 };
+ const int _S5[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, _S5 };
return s_0;
}
-
-#line 15
-layout(std430, binding = 1) buffer _S7 {
+layout(std430, binding = 1) buffer _S6 {
int _data[];
} anotherBuffer_0;
-
-#line 40
int doThing_0(SomeStruct_0 s_1)
{
return s_1.x_0 * 2 + 1;
}
-
-#line 34
int somethingElse_0(inout SomeStruct_0 s_2)
{
s_2.x_0 = s_2.x_0 + 1;
return s_2.x_0;
}
-
-#line 4
-layout(std430, binding = 0) buffer _S8 {
+layout(std430, binding = 0) buffer _S7 {
int _data[];
} outputBuffer_0;
-
-#line 4
spirv_instruction(id = 256)
void livenessStart_2(spirv_by_reference SomeStruct_0 _0, spirv_literal int _1);
-
-#line 62
spirv_instruction(id = 257)
void livenessEnd_2(spirv_by_reference SomeStruct_0 _0, spirv_literal int _1);
-
-#line 46
layout(local_size_x = 4, local_size_y = 1, local_size_z = 1) in;
void main()
{
-
-#line 48
int index_0 = int(gl_GlobalInvocationID.x);
-
-#line 48
- int i_2;
-
-#line 48
+ int i_1;
int res_0;
-
-#line 48
- livenessStart_0(i_2, 0);
-
-#line 48
- i_2 = 0;
-
-#line 48
+ livenessStart_0(i_1, 0);
+ i_1 = 0;
livenessStart_0(res_0, 0);
-
-#line 48
res_0 = index_0;
-
-#line 48
for(;;)
{
-
-
- if(i_2 < index_0)
+ if(i_1 < index_0)
{
}
else
{
break;
}
-
-#line 54
int v_1 = someSlowFunc_0(index_0);
-
SomeStruct_0 s_3;
-
-#line 56
livenessStart_2(s_3, 0);
SomeStruct_0 t_0;
-
-#line 57
livenessStart_2(t_0, 0);
-
-#line 57
- SomeStruct_0 _S9 = makeSomeStruct_0();
-
-#line 57
- t_0 = _S9;
- const int _S10[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 };
-
-#line 58
- SomeStruct_0 u_0 = { 0, 0, _S10 };
-
-#line 58
+ SomeStruct_0 _S8 = makeSomeStruct_0();
+ t_0 = _S8;
+ const int _S9[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 u_0 = { 0, 0, _S9 };
SomeStruct_0 u_1;
-
if(bool(v_1 & 256))
{
s_3.x_0 = ((anotherBuffer_0)._data[(uint(v_1 & 3))]);
t_0.x_0 = ((anotherBuffer_0)._data[(uint(v_1 & 3))]);
-
-#line 63
livenessStart_2(u_1, 0);
-
-#line 63
u_1 = u_0;
-
-#line 63
}
else
{
-
-
SomeStruct_0 x_1;
-
-#line 68
livenessStart_2(x_1, 0);
-
-#line 68
x_1 = u_0;
x_1.x_0 = ((anotherBuffer_0)._data[(uint(v_1 & 3))]) + 1;
- SomeStruct_0 _S11 = x_1;
-
-#line 70
+ SomeStruct_0 _S10 = x_1;
livenessEnd_2(x_1, 0);
-
-#line 70
livenessStart_2(u_1, 0);
-
-#line 70
- u_1 = _S11;
-
-#line 70
+ u_1 = _S10;
}
-
-
-
s_3.c_0[index_0 & 7] = s_3.c_0[index_0 & 7] + 1;
-
- int _S12 = s_3.x_0 + t_0.x_0;
-
-#line 76
- SomeStruct_0 _S13 = u_1;
-
-#line 76
+ int _S11 = s_3.x_0 + t_0.x_0;
+ SomeStruct_0 _S12 = u_1;
livenessEnd_2(u_1, 0);
-
-#line 76
- int _S14 = _S12 + _S13.x_0;
-
-#line 76
- int _S15 = doThing_0(t_0);
-
-#line 76
- int _S16 = _S14 + _S15;
-
-#line 76
- int _S17 = somethingElse_0(t_0);
-
-#line 76
+ int _S13 = _S11 + _S12.x_0;
+ int _S14 = doThing_0(t_0);
+ int _S15 = _S13 + _S14;
+ int _S16 = somethingElse_0(t_0);
livenessEnd_2(t_0, 0);
-
-#line 76
- int _S18 = _S16 + _S17;
-
-#line 76
- int _S19 = s_3.c_0[2];
-
-#line 76
+ int _S17 = _S15 + _S16;
+ int _S18 = s_3.c_0[2];
livenessEnd_2(s_3, 0);
-
-#line 76
- int _S20 = _S18 + _S19;
-
-#line 76
- int _S21 = res_0;
-
-#line 76
+ int _S19 = _S17 + _S18;
+ int _S20 = res_0;
livenessEnd_1(res_0, 0);
-
-#line 76
- int res_1 = _S21 + _S20;
-
-#line 52
- int _S22 = i_2;
-
-#line 52
- livenessEnd_1(i_2, 0);
-
-#line 52
- int i_3 = _S22 + 1;
-
-#line 52
- livenessStart_0(i_2, 0);
-
-#line 52
- i_2 = i_3;
-
-#line 52
+ int res_1 = _S20 + _S19;
+ i_1 = i_1 + 1;
livenessStart_0(res_0, 0);
-
-#line 52
res_0 = res_1;
-
-#line 52
}
-
-#line 52
- livenessEnd_1(i_2, 0);
-
-#line 52
- int _S23 = res_0;
-
-#line 52
+ livenessEnd_1(i_1, 0);
+ int _S21 = res_0;
livenessEnd_1(res_0, 0);
-
-#line 79
- ((outputBuffer_0)._data[(uint(index_0))]) = _S23;
+ ((outputBuffer_0)._data[(uint(index_0))]) = _S21;
return;
}