mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-06 18:08:40 +02:00
nir: Report progress from nir_split_var_copies().
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
(cherry picked from commit dc18b9357b)
This commit is contained in:
parent
aa739dff86
commit
800217a165
2 changed files with 13 additions and 4 deletions
|
|
@ -1629,7 +1629,7 @@ void nir_dump_dom_frontier(nir_shader *shader, FILE *fp);
|
|||
void nir_dump_cfg_impl(nir_function_impl *impl, FILE *fp);
|
||||
void nir_dump_cfg(nir_shader *shader, FILE *fp);
|
||||
|
||||
void nir_split_var_copies(nir_shader *shader);
|
||||
bool nir_split_var_copies(nir_shader *shader);
|
||||
|
||||
void nir_lower_var_copy_instr(nir_intrinsic_instr *copy, void *mem_ctx);
|
||||
void nir_lower_var_copies(nir_shader *shader);
|
||||
|
|
|
|||
|
|
@ -64,6 +64,7 @@
|
|||
struct split_var_copies_state {
|
||||
void *mem_ctx;
|
||||
void *dead_ctx;
|
||||
bool progress;
|
||||
};
|
||||
|
||||
static nir_deref *
|
||||
|
|
@ -198,6 +199,7 @@ split_var_copy_instr(nir_intrinsic_instr *old_copy,
|
|||
* remove the old one later.
|
||||
*/
|
||||
nir_instr_insert_after(&old_copy->instr, &new_copy->instr);
|
||||
state->progress = true;
|
||||
}
|
||||
break;
|
||||
|
||||
|
|
@ -256,24 +258,31 @@ split_var_copies_block(nir_block *block, void *void_state)
|
|||
return true;
|
||||
}
|
||||
|
||||
static void
|
||||
static bool
|
||||
split_var_copies_impl(nir_function_impl *impl)
|
||||
{
|
||||
struct split_var_copies_state state;
|
||||
|
||||
state.mem_ctx = ralloc_parent(impl);
|
||||
state.dead_ctx = ralloc_context(NULL);
|
||||
state.progress = false;
|
||||
|
||||
nir_foreach_block(impl, split_var_copies_block, &state);
|
||||
|
||||
ralloc_free(state.dead_ctx);
|
||||
|
||||
return state.progress;
|
||||
}
|
||||
|
||||
void
|
||||
bool
|
||||
nir_split_var_copies(nir_shader *shader)
|
||||
{
|
||||
bool progress = false;
|
||||
|
||||
nir_foreach_overload(shader, overload) {
|
||||
if (overload->impl)
|
||||
split_var_copies_impl(overload->impl);
|
||||
progress = split_var_copies_impl(overload->impl) || progress;
|
||||
}
|
||||
|
||||
return progress;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue