mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-22 00:30:13 +01:00
intel: compiler: remove dead local variables at optimization pass
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()
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107806
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
This commit is contained in:
parent
095600dad6
commit
07a2098a70
1 changed files with 5 additions and 0 deletions
|
|
@ -597,6 +597,11 @@ brw_nir_optimize(nir_shader *nir, const struct brw_compiler *compiler,
|
||||||
OPT(nir_lower_pack);
|
OPT(nir_lower_pack);
|
||||||
} while (progress);
|
} while (progress);
|
||||||
|
|
||||||
|
/* Workaround Gfxbench unused local sampler variable which will trigger an
|
||||||
|
* assert in the opt_large_constants pass.
|
||||||
|
*/
|
||||||
|
OPT(nir_remove_dead_variables, nir_var_local);
|
||||||
|
|
||||||
return nir;
|
return nir;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue