nir/lower_bit_size: Pass a nir_instr to the callback

This way we can start supporting more than just ALU ops.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7482>
This commit is contained in:
Jason Ekstrand
2020-11-05 22:53:52 -06:00
committed by Marge Bot
parent 15c6e05a72
commit 2c4b47184d
4 changed files with 14 additions and 9 deletions

View File

@@ -633,8 +633,12 @@ brw_nir_optimize(nir_shader *nir, const struct brw_compiler *compiler,
}
static unsigned
lower_bit_size_callback(const nir_alu_instr *alu, UNUSED void *data)
lower_bit_size_callback(const nir_instr *instr, UNUSED void *data)
{
if (instr->type != nir_instr_type_alu)
return 0;
nir_alu_instr *alu = nir_instr_as_alu(instr);
assert(alu->dest.dest.is_ssa);
if (alu->dest.dest.ssa.bit_size >= 32)
return 0;