Module: Mesa Branch: main Commit: 505b81b8c10938d76b926d70b8cc9e6316f03e82 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=505b81b8c10938d76b926d70b8cc9e6316f03e82
Author: Jesse Natalie <[email protected]> Date: Mon May 8 17:48:20 2023 -0700 nir: Add undef phi srcs when adding successors Reviewed-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22913> --- src/compiler/nir/nir_control_flow.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/compiler/nir/nir_control_flow.c b/src/compiler/nir/nir_control_flow.c index aafbdd136f9..ad2fca98067 100644 --- a/src/compiler/nir/nir_control_flow.c +++ b/src/compiler/nir/nir_control_flow.c @@ -274,6 +274,7 @@ block_add_normal_succs(nir_block *block) nir_block *next_block = nir_cf_node_as_block(next); link_blocks(block, next_block, NULL); + nir_insert_phi_undef(next_block, block); } else if (parent->type == nir_cf_node_loop) { nir_loop *loop = nir_cf_node_as_loop(parent); @@ -300,6 +301,8 @@ block_add_normal_succs(nir_block *block) nir_block *first_else_block = nir_if_first_else_block(next_if); link_blocks(block, first_then_block, first_else_block); + nir_insert_phi_undef(first_then_block, block); + nir_insert_phi_undef(first_else_block, block); } else if (next->type == nir_cf_node_loop) { nir_loop *next_loop = nir_cf_node_as_loop(next);
