summaryrefslogtreecommitdiffstats
path: root/src/compiler/nir/nir_opt_copy_propagate.c
diff options
context:
space:
mode:
authorConnor Abbott <cwabbott0@gmail.com>2016-04-12 14:52:43 -0400
committerJason Ekstrand <jason.ekstrand@intel.com>2016-04-27 15:05:34 -0700
commit958300137f26ee7d32d87a71e0c1843671d73732 (patch)
tree9d8033b3e27aa38e38a2a0bb5be313aab890cc95 /src/compiler/nir/nir_opt_copy_propagate.c
parentaaaa22c775f484922ccac705de41dd892e2aff4d (diff)
downloadexternal_mesa3d-958300137f26ee7d32d87a71e0c1843671d73732.zip
external_mesa3d-958300137f26ee7d32d87a71e0c1843671d73732.tar.gz
external_mesa3d-958300137f26ee7d32d87a71e0c1843671d73732.tar.bz2
nir/opt_cp: use nir_block_get_following_if()
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Diffstat (limited to 'src/compiler/nir/nir_opt_copy_propagate.c')
-rw-r--r--src/compiler/nir/nir_opt_copy_propagate.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/compiler/nir/nir_opt_copy_propagate.c b/src/compiler/nir/nir_opt_copy_propagate.c
index acae60e..6847e71 100644
--- a/src/compiler/nir/nir_opt_copy_propagate.c
+++ b/src/compiler/nir/nir_opt_copy_propagate.c
@@ -250,13 +250,9 @@ copy_prop_block(nir_block *block, void *_state)
*progress = true;
}
- if (block->cf_node.node.next != NULL && /* check that we aren't the end node */
- !nir_cf_node_is_last(&block->cf_node) &&
- nir_cf_node_next(&block->cf_node)->type == nir_cf_node_if) {
- nir_if *if_stmt = nir_cf_node_as_if(nir_cf_node_next(&block->cf_node));
- if (copy_prop_if(if_stmt))
- *progress = true;
- }
+ nir_if *if_stmt = nir_block_get_following_if(block);
+ if (if_stmt && copy_prop_if(if_stmt))
+ *progress = true;
return true;
}