From 16cadc04f35893274175c13bcbfe88659a4be217 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Thu, 8 Aug 2024 22:36:36 -0400 Subject: [PATCH] nir/opt_reassociate_bfi: use alu_pass Signed-off-by: Alyssa Rosenzweig Reviewed-by: Reviewed-by: Christian Gmeiner Part-of: --- src/compiler/nir/nir_opt_reassociate_bfi.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/src/compiler/nir/nir_opt_reassociate_bfi.c b/src/compiler/nir/nir_opt_reassociate_bfi.c index 46e1979ec4d..877ad6c1475 100644 --- a/src/compiler/nir/nir_opt_reassociate_bfi.c +++ b/src/compiler/nir/nir_opt_reassociate_bfi.c @@ -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); }