diff options
author | Connor Abbott <[email protected]> | 2016-04-08 16:32:58 -0400 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2016-04-28 15:52:17 -0700 |
commit | b1eada04b24052ff7fe01cbef90b374bdff15a1a (patch) | |
tree | d1c6612e8f346b0c0ee2e86ce8fc4d17760aebd6 | |
parent | 2febb88e6d11837b2057c98f5bc191bc1ae74817 (diff) |
nir/lower_idiv: fixup for new foreach_block()
Reviewed-by: Jason Ekstrand <[email protected]>
-rw-r--r-- | src/compiler/nir/nir_lower_idiv.c | 21 |
1 files changed, 7 insertions, 14 deletions
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); } |