panfrost: Remove pan_nir_reorder_writeout

Now that dual source stores are fused, there's no ordering hazard so we
can remove this tricky code.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13714>
This commit is contained in:
Alyssa Rosenzweig 2021-10-29 10:01:22 -04:00 committed by Marge Bot
parent d3fb341b4a
commit c4da1b84d3
4 changed files with 0 additions and 49 deletions

View File

@ -3738,8 +3738,6 @@ bi_finalize_nir(nir_shader *nir, unsigned gpu_id, bool is_blend)
}
bi_optimize_nir(nir, gpu_id, is_blend);
NIR_PASS_V(nir, pan_nir_reorder_writeout);
}
static bi_context *

View File

@ -3107,8 +3107,6 @@ midgard_compile_shader_nir(nir_shader *nir,
optimise_nir(nir, ctx->quirks, inputs->is_blend);
NIR_PASS_V(nir, pan_nir_reorder_writeout);
if ((midgard_debug & MIDGARD_DBG_SHADERS) &&
((midgard_debug & MIDGARD_DBG_INTERNAL) || !nir->info.internal)) {
nir_print_shader(nir, stdout);

View File

@ -400,7 +400,6 @@ bool pan_has_dest_mod(nir_dest **dest, nir_op op);
#define PAN_WRITEOUT_S 4
#define PAN_WRITEOUT_2 8
bool pan_nir_reorder_writeout(nir_shader *nir);
bool pan_nir_lower_zs_store(nir_shader *nir);
bool pan_nir_lower_64bit_intrin(nir_shader *shader);

View File

@ -199,47 +199,3 @@ pan_nir_lower_zs_store(nir_shader *nir)
return progress;
}
/* Real writeout stores, which break execution, need to be moved to after
* dual-source stores, which are just standard register writes. */
bool
pan_nir_reorder_writeout(nir_shader *nir)
{
bool progress = false;
nir_foreach_function(function, nir) {
if (!function->impl) continue;
nir_foreach_block(block, function->impl) {
nir_instr *last_writeout = NULL;
nir_foreach_instr_reverse_safe(instr, block) {
if (instr->type != nir_instr_type_intrinsic)
continue;
nir_intrinsic_instr *intr = nir_instr_as_intrinsic(instr);
if (intr->intrinsic != nir_intrinsic_store_output)
continue;
const nir_variable *var = nir_find_variable_with_driver_location(nir, nir_var_shader_out, nir_intrinsic_base(intr));
if (var->data.index) {
if (!last_writeout)
last_writeout = instr;
continue;
}
if (!last_writeout)
continue;
/* This is a real store, so move it to after dual-source stores */
exec_node_remove(&instr->node);
exec_node_insert_after(&last_writeout->node, &instr->node);
progress = true;
}
}
}
return progress;
}