nir/opt_reassociate_bfi: use alu_pass

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30582>
This commit is contained in:
Alyssa Rosenzweig 2024-08-08 22:36:36 -04:00 committed by Marge Bot
parent 2643b3cfbf
commit 16cadc04f3

View file

@ -63,13 +63,9 @@
static bool
nir_opt_reassociate_bfi_instr(nir_builder *b,
nir_instr *instr,
nir_alu_instr *bfiCD0,
UNUSED void *cb_data)
{
if (instr->type != nir_instr_type_alu)
return false;
nir_alu_instr *bfiCD0 = nir_instr_as_alu(instr);
if (bfiCD0->op != nir_op_bfi || bfiCD0->def.num_components != 1)
return false;
@ -134,10 +130,6 @@ nir_opt_reassociate_bfi_instr(nir_builder *b,
bool
nir_opt_reassociate_bfi(nir_shader *shader)
{
bool progress = nir_shader_instructions_pass(shader,
nir_opt_reassociate_bfi_instr,
nir_metadata_control_flow,
NULL);
return progress;
return nir_shader_alu_pass(shader, nir_opt_reassociate_bfi_instr,
nir_metadata_control_flow, NULL);
}