Signed-off-by: Connor Abbott <cwabbo...@gmail.com> --- src/compiler/nir/nir_opt_copy_propagate.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-)
diff --git a/src/compiler/nir/nir_opt_copy_propagate.c b/src/compiler/nir/nir_opt_copy_propagate.c index d99f78d..c1a84c2 100644 --- a/src/compiler/nir/nir_opt_copy_propagate.c +++ b/src/compiler/nir/nir_opt_copy_propagate.c @@ -241,22 +241,18 @@ copy_prop_if(nir_if *if_stmt) } static bool -copy_prop_block(nir_block *block, void *_state) +copy_prop_block(nir_block *block) { - bool *progress = (bool *) _state; + bool *progress = false; nir_foreach_instr(block, instr) { if (copy_prop_instr(instr)) *progress = true; } - if (block->cf_node.node.next != NULL && /* check that we aren't the end node */ - !nir_cf_node_is_last(&block->cf_node) && - nir_cf_node_next(&block->cf_node)->type == nir_cf_node_if) { - nir_if *if_stmt = nir_cf_node_as_if(nir_cf_node_next(&block->cf_node)); - if (copy_prop_if(if_stmt)) + nir_if *if_stmt = nir_block_get_following_if(block); + if (if_stmt && copy_prop_if(if_stmt)) *progress = true; - } return true; } -- 2.5.0 _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev