Linker: Eliminate uncalled functions, because they can be ill-defined.

Fixes issue #610. Also provides a testing option to keep uncalled functions.
This commit is contained in:
John Kessenich 2016-12-09 19:22:20 -07:00
parent bf6d7f43fd
commit 906cc21816
68 changed files with 101 additions and 7783 deletions

View file

@ -310,19 +310,6 @@ Linked vertex stage:
Shader version: 420
ERROR: node is still EOpNull!
0:20 Function Definition: foo( (const int)
0:20 Function Parameters:
0:? Sequence
0:23 Sequence
0:23 move second child to first child (temp int)
0:23 'b' (const (read only) int)
0:23 'anonconst' (global int)
0:25 Sequence
0:25 move second child to first child (temp int)
0:25 'd' (const (read only) int)
0:25 'b' (const (read only) int)
0:29 Branch: Return with expression
0:29 'b' (const (read only) int)
0:32 Function Definition: main( (global void)
0:32 Function Parameters:
0:? Sequence
@ -342,164 +329,6 @@ ERROR: node is still EOpNull!
0:42 Constant:
0:42 true (const bool)
0:42 No loop body
0:50 Function Definition: bar(vf4; (global void)
0:50 Function Parameters:
0:50 'v' (volatile in 4-component vector of float)
0:? Sequence
0:53 's' (temp int)
0:54 's' (temp int)
0:55 Test condition and select (temp void)
0:55 Condition
0:55 Compare Equal (temp bool)
0:55 direct index (temp float)
0:55 direct index (temp 4-component vector of float)
0:55 'bad' (in 10-element array of 4-component vector of float)
0:55 Constant:
0:55 0 (const int)
0:55 Constant:
0:55 0 (const int)
0:55 Constant:
0:55 4.200000
0:55 true case is null
0:57 Test condition and select (temp void)
0:57 Condition
0:57 Constant:
0:57 true (const bool)
0:57 true case
0:58 move second child to first child (temp 4-component vector of float)
0:58 'badorder3' (flat out 4-component vector of float)
0:58 direct index (temp 4-component vector of float)
0:58 'bad' (in 10-element array of 4-component vector of float)
0:58 Constant:
0:58 0 (const int)
0:61 Sequence
0:61 move second child to first child (temp 3-component vector of float)
0:61 'smeared' (temp 3-component vector of float)
0:61 Construct vec3 (temp 3-component vector of float)
0:61 'f' (temp float)
0:62 'f' (temp float)
0:63 'f' (temp float)
0:88 Function Definition: bar23444( (global void)
0:88 Function Parameters:
0:? Sequence
0:91 Sequence
0:91 move second child to first child (temp float)
0:91 'a1' (temp float)
0:91 direct index (temp float)
0:91 direct index (temp 3-component vector of float)
0:91 'm43' (temp 4X3 matrix of float)
0:91 Constant:
0:91 3 (const int)
0:91 Constant:
0:91 1 (const int)
0:93 Sequence
0:93 move second child to first child (temp int)
0:93 'a2' (temp int)
0:93 Constant:
0:93 4 (const int)
0:94 add second child into first child (temp int)
0:94 'a2' (temp int)
0:94 Constant:
0:94 3 (const int)
0:95 add second child into first child (temp int)
0:95 'a2' (temp int)
0:95 Constant:
0:95 3 (const int)
0:96 Sequence
0:96 move second child to first child (temp float)
0:96 'b' (const (read only) float)
0:96 component-wise multiply (temp float)
0:96 Constant:
0:96 2.000000
0:96 'a1' (temp float)
0:97 Sequence
0:97 move second child to first child (temp int)
0:97 'a' (temp int)
0:97 Constant:
0:97 -1 (const int)
0:109 Function Definition: qux( (global void)
0:109 Function Parameters:
0:111 Sequence
0:111 Sequence
0:111 move second child to first child (temp int)
0:111 'i' (temp int)
0:111 aoeu: direct index for structure (layout(column_major shared ) uniform int)
0:111 'anon@0' (layout(binding=7 column_major shared ) uniform block{layout(column_major shared ) uniform int aoeu})
0:111 Constant:
0:111 0 (const uint)
0:112 imageAtomicCompSwap (global int)
0:112 'iimg2D' (layout(r32i ) uniform iimage2D)
0:112 Construct ivec2 (temp 2-component vector of int)
0:112 'i' (temp int)
0:112 'i' (temp int)
0:112 'i' (temp int)
0:112 'i' (temp int)
0:113 imageAtomicAdd (global uint)
0:113 'uimg2D' (layout(r32ui ) uniform uimage2D)
0:113 Construct ivec2 (temp 2-component vector of int)
0:113 'i' (temp int)
0:113 'i' (temp int)
0:113 Convert int to uint (temp uint)
0:113 'i' (temp int)
0:114 imageAtomicMin (global int)
0:114 'iimg2Drgba' (layout(rgba32i ) uniform iimage2D)
0:114 Construct ivec2 (temp 2-component vector of int)
0:114 'i' (temp int)
0:114 'i' (temp int)
0:114 'i' (temp int)
0:115 Constant:
0:115 0.000000
0:116 Sequence
0:116 move second child to first child (temp 4-component vector of int)
0:116 'pos' (temp 4-component vector of int)
0:116 imageLoad (global 4-component vector of int)
0:116 'iimg2D' (layout(r32i ) uniform iimage2D)
0:116 Construct ivec2 (temp 2-component vector of int)
0:116 'i' (temp int)
0:116 'i' (temp int)
0:117 Sequence
0:117 move second child to first child (temp 4-component vector of float)
0:117 'col' (temp 4-component vector of float)
0:117 imageLoad (global 4-component vector of float)
0:117 'img2DMS' (uniform image2DMS)
0:117 Construct ivec2 (temp 2-component vector of int)
0:117 'i' (temp int)
0:117 'i' (temp int)
0:117 'i' (temp int)
0:118 imageStore (global void)
0:118 'img2DMSWO' (writeonly uniform image2DMS)
0:118 Construct ivec2 (temp 2-component vector of int)
0:118 'i' (temp int)
0:118 'i' (temp int)
0:118 'i' (temp int)
0:118 Constant:
0:118 0.000000
0:118 0.000000
0:118 0.000000
0:118 0.000000
0:119 imageLoad (global 4-component vector of float)
0:119 'img2DMSWO' (writeonly uniform image2DMS)
0:119 Construct ivec2 (temp 2-component vector of int)
0:119 'i' (temp int)
0:119 'i' (temp int)
0:119 'i' (temp int)
0:125 Function Definition: passr(iI21; (global void)
0:125 Function Parameters:
0:125 'image' (coherent readonly in iimage2D)
0:132 Function Definition: passrc( (global void)
0:132 Function Parameters:
0:134 Sequence
0:134 Function Call: passr(iI21; (global void)
0:134 'qualim1' (layout(r32i ) coherent readonly uniform iimage2D)
0:135 Function Call: passr(iI21; (global void)
0:135 'qualim2' (layout(r32i ) coherent volatile readonly uniform iimage2D)
0:136 Function Call: passr(iI21; (global void)
0:136 'iimg2D' (layout(r32i ) uniform iimage2D)
0:153 Function Definition: qlod( (global void)
0:153 Function Parameters:
0:? Sequence
0:157 'levels' (temp int)
0:158 'levels' (temp int)
0:? Linker Objects
0:? 'v2' (smooth out 2-component vector of float)
0:? 'bad' (in 10-element array of 4-component vector of float)