nir: skip opt_loop_peel_initial_break if continue block only has phis

Doing that optimization wouldn't do anything useful in this case.

nir_block_has_non_copy() is used by opt_loop_peel_initial_break().

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31002>
This commit is contained in:
Rhys Perry
2024-09-11 11:06:54 +01:00
committed by Marge Bot
parent 8410b4cdd6
commit 97f4250a7c
+2
View File
@@ -3507,6 +3507,8 @@ nir_block_contains_work(nir_block *block)
return true;
nir_foreach_instr(instr, block) {
if (instr->type == nir_instr_type_phi)
continue;
if (instr->type != nir_instr_type_alu ||
!nir_op_is_vec_or_mov(nir_instr_as_alu(instr)->op))
return true;