lima/gpir: Make lima_gpir_node_insert_child() useful
authorConnor Abbott <cwabbott0@gmail.com>
Thu, 3 Oct 2019 19:19:40 +0000 (15:19 -0400)
committerMarge Bot <eric+marge@anholt.net>
Mon, 16 Mar 2020 23:08:06 +0000 (23:08 +0000)
We weren't using this function before. The name is confusing, but it
changes the child while also fixing up the dependence link, if you don't
have access to it already. Or at least, I think that's what the
intention is, and what we'll need to change the branch condition in the
next commit. Adding a dependency between the new and old source doesn't
make any sense for this, and we also need to change the actual source.

Reviewed-by: Vasily Khoruzhick <anarsoul@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4125>

src/gallium/drivers/lima/ir/gp/node.c

index 78f7bd130ea174b6c69d09c4e33644cf7db23479..ef534e7e2863bc6d8cee595e14b495e505be5010 100644 (file)
@@ -413,10 +413,10 @@ void gpir_node_insert_child(gpir_node *parent, gpir_node *child,
    gpir_node_foreach_pred(parent, dep) {
       if (dep->pred == child) {
          gpir_node_replace_pred(dep, insert_child);
+         gpir_node_replace_child(parent, child, insert_child);
          break;
       }
    }
-   gpir_node_add_dep(insert_child, child, GPIR_DEP_INPUT);
 }
 
 void gpir_node_delete(gpir_node *node)