mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-21 19:30:38 +01:00
nir: Remove single-source phis before opt_if_loop_last_continue
We might have some single-source phis leftover after prior optimizations. We want to get rid of them before merging the blocks. Fixes:5921a19d4b("nir: add if opt opt_if_loop_last_continue()") Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6312 Signed-off-by: Yevhenii Kolesnikov <yevhenii.kolesnikov@globallogic.com> Reviewed-by: Danylo Piliaiev <dpiliaiev@igalia.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16095> (cherry picked from commit65caf46b3b)
This commit is contained in:
parent
d0c087790e
commit
48ddac7e23
2 changed files with 6 additions and 1 deletions
|
|
@ -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"
|
||||
},
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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),
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue