nir/dead_cf: add support for removing useless loops
authorConnor Abbott <cwabbott0@gmail.com>
Fri, 8 May 2015 18:42:14 +0000 (14:42 -0400)
committerKenneth Graunke <kenneth@whitecape.org>
Tue, 1 Sep 2015 07:58:17 +0000 (00:58 -0700)
commitaec6744501be06e37dbcb620eba0deef54fcad31
treeee1e8eea6baf738e1ebb558a3007965526c66d8f
parent019eea1c4fadaa86ce88ab81ac2f14613381738b
nir/dead_cf: add support for removing useless loops

v2: fix detecting if the loop has any phi nodes after it.
v2: use nir_foreach_ssa_def() instead of nir_foreach_dest() when
    checking for values live after the loop to catch const_load
    instructions.
v2: fix handling return instructions
v2: add some documentation to loop_is_dead()

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
src/glsl/nir/nir_opt_dead_cf.c