nir: correctly track current loop in nir_opt_loop()

We were not restoring an outer loop as the current loop after we had
finished processing a nested loop.

Fixes: 9995f336e6 ("nir: add merge loop terminators optimisation")

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29686>
This commit is contained in:
Timothy Arceri
2024-06-12 12:52:27 +10:00
committed by Marge Bot
parent 3d2a821198
commit b26ef8f153
2 changed files with 5 additions and 8 deletions
+5 -5
View File
@@ -694,11 +694,11 @@ opt_loop_cf_list(nir_builder *b, struct exec_list *cf_list,
}
case nir_cf_node_loop: {
current_loop = nir_cf_node_as_loop(cf_node);
assert(!nir_loop_has_continue_construct(current_loop));
progress |= opt_loop_cf_list(b, &current_loop->body, current_loop);
progress |= opt_loop_last_block(nir_loop_last_block(current_loop), true, false);
progress |= opt_loop_peel_initial_break(current_loop);
nir_loop *loop = nir_cf_node_as_loop(cf_node);
assert(!nir_loop_has_continue_construct(loop));
progress |= opt_loop_cf_list(b, &loop->body, loop);
progress |= opt_loop_last_block(nir_loop_last_block(loop), true, false);
progress |= opt_loop_peel_initial_break(loop);
break;
}
@@ -445,6 +445,3 @@ nir-stress=dEQP-VK.dynamic_rendering.primary_cmd_buff.suballocation.formats.b8g8
nir-stress=dEQP-VK.dynamic_rendering.primary_cmd_buff.suballocation.formats.r16_sint.input.dont_care.dont_care.clear_draw,Fail
nir-stress=dEQP-VK.dynamic_rendering.primary_cmd_buff.suballocation.formats.r8g8_sint.input.clear.dont_care.draw,Fail
nir-stress=dEQP-VK.dynamic_rendering.primary_cmd_buff.suballocation.formats.r8g8_unorm.input.load.dont_care.draw,Fail
# Regression in https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28998
dEQP-VK.graphicsfuzz.cov-loop-switch-discard-never-hit,Fail