mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-24 21:50:12 +01:00
nir/opt_idiv_const: 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:
parent
b6daa35d9d
commit
6e39379183
1 changed files with 4 additions and 8 deletions
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue