Before, we might have left dangling predecessors from jumps that were going to be removed.
v2: split out from "nir: insert ssa_undef instructions when cleaning up defs/uses" Signed-off-by: Connor Abbott <cwabbo...@gmail.com> --- src/glsl/nir/nir.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/glsl/nir/nir.c b/src/glsl/nir/nir.c index a2b5e7c..dc6d63f 100644 --- a/src/glsl/nir/nir.c +++ b/src/glsl/nir/nir.c @@ -1214,9 +1214,15 @@ cleanup_cf_node(nir_cf_node *node, nir_function_impl *impl) switch (node->type) { case nir_cf_node_block: { nir_block *block = nir_cf_node_as_block(node); - /* We need to walk the instructions and clean up defs/uses */ - nir_foreach_instr(block, instr) + /* We need to walk the instructions and clean up defs/uses, + * as well as clean up any jumps to control flow that may not be getting + * deleted. + */ + nir_foreach_instr(block, instr) { + if (instr->type == nir_instr_type_jump) + handle_remove_jump(block, nir_instr_as_jump(instr)->type); remove_defs_uses(instr, impl); + } break; } -- 2.1.0 _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev