From b26ef8f1537dca0d8428281f460604fe0cb2a4d5 Mon Sep 17 00:00:00 2001 From: Timothy Arceri Date: Wed, 12 Jun 2024 12:52:27 +1000 Subject: [PATCH] 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: 9995f336e60 ("nir: add merge loop terminators optimisation") Reviewed-by: Rhys Perry Part-of: --- src/compiler/nir/nir_opt_loop.c | 10 +++++----- src/gallium/frontends/lavapipe/ci/lvp-fails.txt | 3 --- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/compiler/nir/nir_opt_loop.c b/src/compiler/nir/nir_opt_loop.c index aa0a9b8ab6e..cfc9099607d 100644 --- a/src/compiler/nir/nir_opt_loop.c +++ b/src/compiler/nir/nir_opt_loop.c @@ -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, ¤t_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; } diff --git a/src/gallium/frontends/lavapipe/ci/lvp-fails.txt b/src/gallium/frontends/lavapipe/ci/lvp-fails.txt index cf9ddfd85c1..c38cdbe9f22 100644 --- a/src/gallium/frontends/lavapipe/ci/lvp-fails.txt +++ b/src/gallium/frontends/lavapipe/ci/lvp-fails.txt @@ -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