nir/lower_goto_if: Rework handling of skip targets
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/2401>
diff --git a/src/compiler/nir/nir_lower_goto_ifs.c b/src/compiler/nir/nir_lower_goto_ifs.c
index 28ae1b9..b944b4c 100644
--- a/src/compiler/nir/nir_lower_goto_ifs.c
+++ b/src/compiler/nir/nir_lower_goto_ifs.c
@@ -590,22 +590,20 @@
routing->brk.reachable, mem_ctx);
}
assert(curr_level->blocks->entries);
- curr_level->skip_start = 0;
struct strct_lvl *prev_level = NULL;
if (!list_is_empty(levels))
prev_level = list_last_entry(levels, struct strct_lvl, link);
- if (skip_targets->entries) {
- set_foreach(skip_targets, entry) {
- if (_mesa_set_search_pre_hashed(curr_level->blocks,
- entry->hash, entry->key)) {
- _mesa_set_remove(skip_targets, entry);
- prev_level->skip_end = 1;
- curr_level->skip_start = !!skip_targets->entries;
- }
+ set_foreach(skip_targets, entry) {
+ if (_mesa_set_search_pre_hashed(curr_level->blocks,
+ entry->hash, entry->key)) {
+ _mesa_set_remove(skip_targets, entry);
+ prev_level->skip_end = 1;
}
}
+ curr_level->skip_start = skip_targets->entries != 0;
+
struct set *prev_frontier = NULL;
if (!prev_level) {
prev_frontier = reach;