> > @@ -136,17 +136,27 @@ static bool
> > cf_node_has_side_effects(nir_cf_node *node)
> > {
> > nir_foreach_block_in_cf_node(block, node) {
> > + bool inside_loop = node->type == nir_cf_node_loop;
> > + for (nir_cf_node *n = &block->cf_node; !inside_loop && n != node; n
> > = n->par
On Mon, Mar 19, 2018 at 1:00 PM, Caio Marcelo de Oliveira Filho <
caio.olive...@intel.com> wrote:
> Generalize the code for remove dead loops to also remove dead if
> nodes. The conditions are the same in both cases, if the node (and
> it's children) don't have side-effects AND the nodes after it
Generalize the code for remove dead loops to also remove dead if
nodes. The conditions are the same in both cases, if the node (and
it's children) don't have side-effects AND the nodes after it don't
use the values produced by the node.
The only difference is when evaluating side effects: loops co