intel: compiler: remove dead local variables at optimization pass

Graphics / Mesa 3D Graphics Library / Mesa - Lionel Landwerlin [intel.com] - 3 September 2018 16:24 EDT

We're hitting an assert in gfxbench because one of the local variable is a sampler (according to Jason this isn't valid) :

testfw_app: ../src/compiler/nir_types.cpp:551: void glsl_get_natural_size_align_bytes(const glsl_type*, unsigned int*, unsigned int*): Assertion `!"type does not have a natural size"' failed.

Since this particular variable isn't used, it can be eliminated by removing unused local variables at the end of the optimization loop. This makes sense also for valid local variables.

v2: Move additional local variable removal out of optimization loop, but before large constant removal (Jason/Lionel)

v3: Move the removal at the end of brw_nir_optimize()

07a2098a70 intel: compiler: remove dead local variables at optimization pass
src/intel/compiler/brw_nir.c | 5 +++++
1 file changed, 5 insertions(+)

Upstream: cgit.freedesktop.org


  • Share