nir: make opt_if_loop_terminator() less strict

nir_cf_{extract,reinsert}() can't stitch a block together
if the block we are extracting ends in a jump but other jumps
nested in further ifs should be fine to move.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4477>
This commit is contained in:
Timothy Arceri 2020-04-07 23:33:55 +10:00 committed by Marge Bot
parent 1f649ff107
commit 52c8bc0130

View file

@ -998,7 +998,7 @@ opt_if_loop_terminator(nir_if *nif)
if (is_block_empty(first_continue_from_blk)) if (is_block_empty(first_continue_from_blk))
return false; return false;
if (!nir_is_trivial_loop_if(nif, break_blk)) if (nir_block_ends_in_jump(continue_from_blk))
return false; return false;
/* Even though this if statement has a jump on one side, we may still have /* Even though this if statement has a jump on one side, we may still have