diff --git a/src/compiler/nir/nir.c b/src/compiler/nir/nir.c index 20a0734bd2c..9c312e32626 100644 --- a/src/compiler/nir/nir.c +++ b/src/compiler/nir/nir.c @@ -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; } diff --git a/src/gallium/drivers/etnaviv/etnaviv_compiler_nir_liveness.c b/src/gallium/drivers/etnaviv/etnaviv_compiler_nir_liveness.c index f4c9d64b084..f14914f7b80 100644 --- a/src/gallium/drivers/etnaviv/etnaviv_compiler_nir_liveness.c +++ b/src/gallium/drivers/etnaviv/etnaviv_compiler_nir_liveness.c @@ -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)];