From 6e39379183f44e0241360ff30f129081c9c38e67 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Thu, 8 Aug 2024 22:32:04 -0400 Subject: [PATCH] nir/opt_idiv_const: use alu_pass Signed-off-by: Alyssa Rosenzweig Reviewed-by: Reviewed-by: Christian Gmeiner Part-of: --- src/compiler/nir/nir_opt_idiv_const.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/compiler/nir/nir_opt_idiv_const.c b/src/compiler/nir/nir_opt_idiv_const.c index 0b0d4e130b6..20f1e596d4c 100644 --- a/src/compiler/nir/nir_opt_idiv_const.c +++ b/src/compiler/nir/nir_opt_idiv_const.c @@ -146,14 +146,10 @@ build_imod(nir_builder *b, nir_def *n, int64_t d) } static bool -nir_opt_idiv_const_instr(nir_builder *b, nir_instr *instr, void *user_data) +nir_opt_idiv_const_instr(nir_builder *b, nir_alu_instr *alu, void *user_data) { unsigned *min_bit_size = user_data; - if (instr->type != nir_instr_type_alu) - return false; - - nir_alu_instr *alu = nir_instr_as_alu(instr); if (alu->op != nir_op_udiv && alu->op != nir_op_idiv && alu->op != nir_op_umod && @@ -221,7 +217,7 @@ nir_opt_idiv_const_instr(nir_builder *b, nir_instr *instr, void *user_data) bool nir_opt_idiv_const(nir_shader *shader, unsigned min_bit_size) { - return nir_shader_instructions_pass(shader, nir_opt_idiv_const_instr, - nir_metadata_control_flow, - &min_bit_size); + return nir_shader_alu_pass(shader, nir_opt_idiv_const_instr, + nir_metadata_control_flow, + &min_bit_size); }