treewide: Collapse more SSA checks
Via Coccinelle patch:
@@
expression x;
@@
-if (x->is_ssa) {
...
-}
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24432>
This commit is contained in:
committed by
Marge Bot
parent
700e270df5
commit
306182c63e
@@ -1254,14 +1254,12 @@ nir_instr_dce_add_dead_srcs_cb(nir_src *src, void *state)
|
||||
{
|
||||
nir_instr_worklist *wl = state;
|
||||
|
||||
if (src->is_ssa) {
|
||||
list_del(&src->use_link);
|
||||
if (!nir_instr_free_and_dce_is_live(src->ssa->parent_instr))
|
||||
nir_instr_worklist_push_tail(wl, src->ssa->parent_instr);
|
||||
list_del(&src->use_link);
|
||||
if (!nir_instr_free_and_dce_is_live(src->ssa->parent_instr))
|
||||
nir_instr_worklist_push_tail(wl, src->ssa->parent_instr);
|
||||
|
||||
/* Stop nir_instr_remove from trying to delete the link again. */
|
||||
src->ssa = NULL;
|
||||
}
|
||||
/* Stop nir_instr_remove from trying to delete the link again. */
|
||||
src->ssa = NULL;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -72,28 +72,27 @@ set_src_live(nir_src *src, void *void_state)
|
||||
{
|
||||
struct live_defs_state *state = void_state;
|
||||
|
||||
if (src->is_ssa) {
|
||||
nir_instr *instr = src->ssa->parent_instr;
|
||||
nir_instr *instr = src->ssa->parent_instr;
|
||||
|
||||
if (is_sysval(instr) || instr->type == nir_instr_type_deref)
|
||||
return true;
|
||||
if (is_sysval(instr) || instr->type == nir_instr_type_deref)
|
||||
return true;
|
||||
|
||||
switch (instr->type) {
|
||||
case nir_instr_type_load_const:
|
||||
case nir_instr_type_ssa_undef:
|
||||
switch (instr->type) {
|
||||
case nir_instr_type_load_const:
|
||||
case nir_instr_type_ssa_undef:
|
||||
return true;
|
||||
case nir_instr_type_alu: {
|
||||
/* alu op bypass */
|
||||
nir_alu_instr *alu = nir_instr_as_alu(instr);
|
||||
if (instr->pass_flags & BYPASS_SRC) {
|
||||
for (unsigned i = 0; i < nir_op_infos[alu->op].num_inputs; i++)
|
||||
set_src_live(&alu->src[i].src, state);
|
||||
return true;
|
||||
case nir_instr_type_alu: {
|
||||
/* alu op bypass */
|
||||
nir_alu_instr *alu = nir_instr_as_alu(instr);
|
||||
if (instr->pass_flags & BYPASS_SRC) {
|
||||
for (unsigned i = 0; i < nir_op_infos[alu->op].num_inputs; i++)
|
||||
set_src_live(&alu->src[i].src, state);
|
||||
return true;
|
||||
}
|
||||
} break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
unsigned i = state->live_map[src_index(state->impl, src)];
|
||||
|
||||
Reference in New Issue
Block a user