diff --git a/.pick_status.json b/.pick_status.json index 7a8b377aaed..f94377577c2 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -548,7 +548,7 @@ "description": "nir: Remove single-source phis before opt_if_loop_last_continue", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "because_sha": "5921a19d4b0c6491b3535b5154d585384c9ea144" }, { diff --git a/src/compiler/nir/nir_opt_if.c b/src/compiler/nir/nir_opt_if.c index f72451faa2f..2327e1c07e3 100644 --- a/src/compiler/nir/nir_opt_if.c +++ b/src/compiler/nir/nir_opt_if.c @@ -818,6 +818,11 @@ opt_if_loop_last_continue(nir_loop *loop, bool aggressive_last_continue) exec_list_is_empty(&last_block->instr_list)) return false; + /* If there are single-source phis in the last block, + * get rid of them first + */ + nir_opt_remove_phis_block(last_block); + /* Move the last block of the loop inside the last if-statement */ nir_cf_list tmp; nir_cf_extract(&tmp, nir_after_cf_node(if_node),