/* Lower and remove dead derefs and variables to clean up the IR. */
NIR_PASS_V(nir, nir_lower_vars_to_ssa);
NIR_PASS_V(nir, nir_opt_dce);
- NIR_PASS_V(nir, nir_remove_dead_variables, nir_var_function_temp |
- nir_var_shader_in | nir_var_shader_out, NULL);
+ NIR_PASS_V(nir, nir_remove_dead_variables, nir_var_function_temp, NULL);
if (nir->xfb_info)
NIR_PASS_V(nir, nir_io_add_intrinsic_xfb_info);
struct nir_shader *nir = (struct nir_shader *)nirptr;
nir_lower_io_passes(nir);
+ NIR_PASS_V(nir, nir_remove_dead_variables, nir_var_shader_in | nir_var_shader_out, NULL);
NIR_PASS_V(nir, ac_nir_lower_subdword_loads,
(ac_nir_lower_subdword_options) {
/* Lower load_deref/store_deref of inputs and outputs.
* This depends on st_nir_assign_varying_locations.
*/
- if (nir->options->lower_io_variables)
+ if (nir->options->lower_io_variables) {
nir_lower_io_passes(nir);
+ NIR_PASS_V(nir, nir_remove_dead_variables,
+ nir_var_shader_in | nir_var_shader_out, NULL);
+ }
/* Set num_uniforms in number of attribute slots (vec4s) */
nir->num_uniforms = DIV_ROUND_UP(prog->Parameters->NumParameterValues, 4);