summaryrefslogtreecommitdiffstats
path: root/src/glsl/nir/nir_control_flow.h
diff options
context:
space:
mode:
authorConnor Abbott <[email protected]>2015-07-21 19:54:35 -0700
committerKenneth Graunke <[email protected]>2015-08-24 13:31:42 -0700
commitd7971b41ce3bd5ffce9580b3796b40d3591d6e5e (patch)
tree2a8d47dc6b861b8f4e6065a2ed1c273ff5018f6a /src/glsl/nir/nir_control_flow.h
parentfc7f2d2364a98d4ec8fb8627b03c6f84b353998c (diff)
nir/cf: reimplement nir_cf_node_remove() using the new API
This gives us some testing of it. Also, the old nir_cf_node_remove() wasn't handling phi nodes correctly and was calling cleanup_cf_node() too late. Signed-off-by: Connor Abbott <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/glsl/nir/nir_control_flow.h')
-rw-r--r--src/glsl/nir/nir_control_flow.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/glsl/nir/nir_control_flow.h b/src/glsl/nir/nir_control_flow.h
index 45aff3e61be..5efd41caadf 100644
--- a/src/glsl/nir/nir_control_flow.h
+++ b/src/glsl/nir/nir_control_flow.h
@@ -167,8 +167,6 @@ nir_cf_node_insert_end(struct exec_list *list, nir_cf_node *node)
nir_cf_node_insert(nir_after_cf_list(list), node);
}
-/** removes a control flow node, doing any cleanup necessary */
-void nir_cf_node_remove(nir_cf_node *node);
/** Control flow motion.
*
@@ -239,6 +237,15 @@ nir_cf_list_extract(nir_cf_list *extracted, struct exec_list *cf_list)
nir_after_cf_list(cf_list));
}
+/** removes a control flow node, doing any cleanup necessary */
+static inline void
+nir_cf_node_remove(nir_cf_node *node)
+{
+ nir_cf_list list;
+ nir_cf_extract(&list, nir_before_cf_node(node), nir_after_cf_node(node));
+ nir_cf_delete(&list);
+}
+
#ifdef __cplusplus
}
#endif