summaryrefslogtreecommitdiffstats
path: root/src/glsl/nir/nir_control_flow.c
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.c
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.c')
-rw-r--r--src/glsl/nir/nir_control_flow.c31
1 files changed, 0 insertions, 31 deletions
diff --git a/src/glsl/nir/nir_control_flow.c b/src/glsl/nir/nir_control_flow.c
index 786413843b6..86c7ca2beba 100644
--- a/src/glsl/nir/nir_control_flow.c
+++ b/src/glsl/nir/nir_control_flow.c
@@ -709,37 +709,6 @@ cleanup_cf_node(nir_cf_node *node, nir_function_impl *impl)
}
void
-nir_cf_node_remove(nir_cf_node *node)
-{
- nir_function_impl *impl = nir_cf_node_get_function(node);
- nir_metadata_preserve(impl, nir_metadata_none);
-
- if (node->type == nir_cf_node_block) {
- /*
- * Basic blocks can't really be removed by themselves, since they act as
- * padding between the non-basic blocks. So all we do here is empty the
- * block of instructions.
- *
- * TODO: could we assert here?
- */
- exec_list_make_empty(&nir_cf_node_as_block(node)->instr_list);
- } else {
- nir_cf_node *before = nir_cf_node_prev(node);
- assert(before->type == nir_cf_node_block);
- nir_block *before_block = nir_cf_node_as_block(before);
-
- nir_cf_node *after = nir_cf_node_next(node);
- assert(after->type == nir_cf_node_block);
- nir_block *after_block = nir_cf_node_as_block(after);
-
- exec_node_remove(&node->node);
- stitch_blocks(before_block, after_block);
- }
-
- cleanup_cf_node(node, impl);
-}
-
-void
nir_cf_extract(nir_cf_list *extracted, nir_cursor begin, nir_cursor end)
{
nir_block *block_begin, *block_end, *block_before, *block_after;