diff options
author | Caio Marcelo de Oliveira Filho <[email protected]> | 2018-03-19 16:34:17 -0700 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2018-03-21 09:36:09 -0700 |
commit | 8571c577aa02be048826f8667b93709c3c620fc5 (patch) | |
tree | af67178e827d1ed6316e49780256972217340b23 /appveyor.yml | |
parent | 470056d37b88070b630c1e95c8590c282dff82fd (diff) |
nir/dead_cf: also remove useless ifs
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 consider
only return jumps as a side-effect -- they can stop execution of nodes
after it; 'if' nodes outside loops should consider all kinds of
jumps (return, break, continue) since all of them can cause execution
of nodes after it to be skipped.
After this patch, empty ifs (those which both then and else blocks are
empty) will be removed by nir_opt_dead_cf.
It caused no change to shader-db, in part because the removal of empty
ifs is currently covered by nir_opt_peephole_select.
v2: Improve the identification of cases where break/continue can cause
side-effects. (Jason)
v3: Move code comment changes to a different patch. (Jason)
Reviewed-by: Jason Ekstrand <[email protected]>
Diffstat (limited to 'appveyor.yml')
0 files changed, 0 insertions, 0 deletions