nir/deref: Add some deref cleanup functions
Sometimes it's useful for a pass to be able to clean up its own derefs instead of waiting for DCE. This little helper makes it very easy. Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com> Acked-by: Rob Clark <robdclark@gmail.com> Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> Acked-by: Dave Airlie <airlied@redhat.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
This commit is contained in:
@@ -1032,6 +1032,8 @@ nir_deref_instr_get_variable(const nir_deref_instr *instr)
|
||||
return instr->var;
|
||||
}
|
||||
|
||||
bool nir_deref_instr_remove_if_unused(nir_deref_instr *instr);
|
||||
|
||||
nir_deref_var *
|
||||
nir_deref_instr_to_deref(nir_deref_instr *instr, void *mem_ctx);
|
||||
|
||||
@@ -2728,6 +2730,8 @@ bool nir_lower_regs_to_ssa_impl(nir_function_impl *impl);
|
||||
bool nir_lower_regs_to_ssa(nir_shader *shader);
|
||||
bool nir_lower_vars_to_ssa(nir_shader *shader);
|
||||
|
||||
bool nir_remove_dead_derefs(nir_shader *shader);
|
||||
bool nir_remove_dead_derefs_impl(nir_function_impl *impl);
|
||||
bool nir_remove_dead_variables(nir_shader *shader, nir_variable_mode modes);
|
||||
bool nir_lower_constant_initializers(nir_shader *shader,
|
||||
nir_variable_mode modes);
|
||||
|
Reference in New Issue
Block a user