Revert "nir/lower_goto_if: Add a route::outside set"

This reverts commit d57573dcd4aa2160f3153df466b01f377484a3fa.  The
actual bug was an issue with prev_frontiers which has been properly
fixed in the previous commit.

Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6750>
diff --git a/src/compiler/nir/nir_lower_goto_ifs.c b/src/compiler/nir/nir_lower_goto_ifs.c
index f5532e0..0e6902e 100644
--- a/src/compiler/nir/nir_lower_goto_ifs.c
+++ b/src/compiler/nir/nir_lower_goto_ifs.c
@@ -50,7 +50,6 @@
 };
 
 struct routes {
-   struct set *outside;
    struct path regular;
    struct path brk;
    struct path cont;
@@ -69,9 +68,6 @@
    /** Reach set from inside_outside if irreducable */
    struct set *reach;
 
-   /** Outside set from inside_outside if irreducable */
-   struct set *outside;
-
    /** True if a skip region starts with this level */
    bool skip_start;
 
@@ -295,18 +291,14 @@
 static void
 loop_routing_start(struct routes *routing, nir_builder *b,
                    struct path loop_path, struct set *reach,
-                   struct set *outside, void *mem_ctx)
+                   void *mem_ctx)
 {
    if (NIR_LOWER_GOTO_IFS_DEBUG) {
       printf("loop_routing_start:\n");
       printf("    reach =                       ");
       print_block_set(reach);
-      printf("    outside =                     ");
-      print_block_set(outside);
       printf("    loop_path.reachable =         ");
       print_block_set(loop_path.reachable);
-      printf("    routing->outside =            ");
-      print_block_set(routing->outside);
       printf("    routing->regular.reachable =  ");
       print_block_set(routing->regular.reachable);
       printf("    routing->brk.reachable =      ");
@@ -334,12 +326,6 @@
       continue_needed = true;
    }
 
-   if (outside && outside->entries) {
-      routing->outside = _mesa_set_clone(routing->outside, routing);
-      set_foreach(outside, entry)
-         _mesa_set_add_pre_hashed(routing->outside, entry->hash, entry->key);
-   }
-
    routing->brk = routing_backup->regular;
    routing->cont = loop_path;
    routing->regular = loop_path;
@@ -632,7 +618,6 @@
       inside_outside((nir_block *) entry->key, loop_heads, remaining,
                      curr_level->reach, brk_reachable, mem_ctx);
    }
-   curr_level->outside = remaining;
    _mesa_set_destroy(loop_heads, NULL);
 }
 
@@ -672,21 +657,16 @@
  *                       zeroth level
  */
 static void
-organize_levels(struct list_head *levels, struct set *children,
+organize_levels(struct list_head *levels, struct set *remaining,
                 struct set *reach, struct routes *routing,
                 nir_function_impl *impl, bool is_domminated, void *mem_ctx)
 {
    if (NIR_LOWER_GOTO_IFS_DEBUG) {
       printf("organize_levels:\n");
-      printf("    children = ");
-      print_block_set(children);
       printf("    reach =     ");
       print_block_set(reach);
    }
 
-   /* Duplicate remaining because we're going to destroy it */
-   struct set *remaining = _mesa_set_clone(children, mem_ctx);
-
    /* blocks that can be reached by the remaining blocks */
    struct set *remaining_frontier = _mesa_pointer_set_create(mem_ctx);
 
@@ -855,10 +835,8 @@
       }
       struct path in_path = routing->regular;
       routing->regular = level->out_path;
-      if (level->irreducible) {
-         loop_routing_start(routing, b, in_path, level->reach,
-                            level->outside, mem_ctx);
-      }
+      if (level->irreducible)
+         loop_routing_start(routing, b, in_path, level->reach, mem_ctx);
       select_blocks(routing, b, in_path, mem_ctx);
       if (level->irreducible)
          loop_routing_end(routing, b);
@@ -877,7 +855,7 @@
 {
    struct set *remaining = _mesa_pointer_set_create(mem_ctx);
    for (int i = 0; i < block->num_dom_children; i++) {
-      if (!_mesa_set_search(routing->outside, block->dom_children[i]))
+      if (!_mesa_set_search(routing->brk.reachable, block->dom_children[i]))
          _mesa_set_add(remaining, block->dom_children[i]);
    }
 
@@ -905,7 +883,7 @@
       };
       _mesa_set_add(loop_path.reachable, block);
 
-      loop_routing_start(routing, b, loop_path, reach, outside, mem_ctx);
+      loop_routing_start(routing, b, loop_path, reach, mem_ctx);
    }
 
    struct set *reach = _mesa_pointer_set_create(mem_ctx);
@@ -982,7 +960,6 @@
 
    struct routes *routing = rzalloc(mem_ctx, struct routes);
    *routing = (struct routes) {
-      .outside = empty_set,
       .regular.reachable = end_set,
       .brk.reachable = empty_set,
       .cont.reachable = empty_set,