Re: [Mesa-dev] glsl: ideas how to improve dead code elimination?

2014-05-20 Thread Eric Anholt
Matt Turner writes: > On Mon, May 19, 2014 at 10:56 AM, Aras Pranckevicius wrote: >> Hi, >> >> When Mesa's GLSL compiler is faced with a code like this: >> >> // vec4 packednormal exists >> vec3 normal; >> normal.xy = packednormal.wy * 2.0 - 1.0; >> normal.z = sqrt(1.0 - dot(norm

Re: [Mesa-dev] glsl: ideas how to improve dead code elimination?

2014-05-19 Thread Matt Turner
On Mon, May 19, 2014 at 10:56 AM, Aras Pranckevicius wrote: > Hi, > > When Mesa's GLSL compiler is faced with a code like this: > > // vec4 packednormal exists > vec3 normal; > normal.xy = packednormal.wy * 2.0 - 1.0; > normal.z = sqrt(1.0 - dot(normal.xy, normal.xy)); > // now

[Mesa-dev] glsl: ideas how to improve dead code elimination?

2014-05-19 Thread Aras Pranckevicius
Hi, When Mesa's GLSL compiler is faced with a code like this: // vec4 packednormal exists vec3 normal; normal.xy = packednormal.wy * 2.0 - 1.0; normal.z = sqrt(1.0 - dot(normal.xy, normal.xy)); // now do not use the "normal" at all anywhere Then the dead code elimination pass