}
/*
- * Test if a loop node or if node is dead. Such nodes are dead if:
+ * Test if a loop node is dead. Such nodes are dead if:
*
* 1) It has no side effects (i.e. intrinsics which could possibly affect the
* state of the program aside from producing an SSA value, indicated by a lack
static bool
node_is_dead(nir_cf_node *node)
{
- assert(node->type == nir_cf_node_loop || node->type == nir_cf_node_if);
+ assert(node->type == nir_cf_node_loop);
nir_block *after = nir_cf_node_as_block(nir_cf_node_next(node));
{
nir_if *following_if = nir_block_get_following_if(block);
if (following_if) {
- if (node_is_dead(&following_if->cf_node)) {
- nir_cf_node_remove(&following_if->cf_node);
- return true;
- }
-
if (!nir_src_is_const(following_if->condition))
return false;