Re: [Mesa-dev] [PATCH] nir/dead_cf: also remove useless ifs

2018-03-17 Thread Jason Ekstrand
On March 16, 2018 18:25:14 Caio Marcelo de Oliveira Filho 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 don't use the values produced by th

[Mesa-dev] [PATCH] nir/dead_cf: also remove useless ifs

2018-03-16 Thread Caio Marcelo de Oliveira Filho
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