From: Connor Abbott Date: Fri, 8 Apr 2016 20:32:58 +0000 (-0400) Subject: nir/lower_idiv: fixup for new foreach_block() X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b1eada04b24052ff7fe01cbef90b374bdff15a1a;p=mesa.git nir/lower_idiv: fixup for new foreach_block() Reviewed-by: Jason Ekstrand --- diff --git a/src/compiler/nir/nir_lower_idiv.c b/src/compiler/nir/nir_lower_idiv.c index 724c0c6eb3d..f5dafa72137 100644 --- a/src/compiler/nir/nir_lower_idiv.c +++ b/src/compiler/nir/nir_lower_idiv.c @@ -117,26 +117,19 @@ convert_instr(nir_builder *bld, nir_alu_instr *alu) nir_ssa_def_rewrite_uses(&alu->dest.dest.ssa, nir_src_for_ssa(q)); } -static bool -convert_block(nir_block *block, void *state) -{ - nir_builder *b = state; - - nir_foreach_instr_safe(block, instr) { - if (instr->type == nir_instr_type_alu) - convert_instr(b, nir_instr_as_alu(instr)); - } - - return true; -} - static void convert_impl(nir_function_impl *impl) { nir_builder b; nir_builder_init(&b, impl); - nir_foreach_block_call(impl, convert_block, &b); + nir_foreach_block(block, impl) { + nir_foreach_instr_safe(block, instr) { + if (instr->type == nir_instr_type_alu) + convert_instr(&b, nir_instr_as_alu(instr)); + } + } + nir_metadata_preserve(impl, nir_metadata_block_index | nir_metadata_dominance); }