diff options
author | Connor Abbott <[email protected]> | 2015-07-21 19:54:17 -0700 |
---|---|---|
committer | Kenneth Graunke <[email protected]> | 2015-08-24 13:31:41 -0700 |
commit | 1c53f89696124de2c7e93665ef8b07bc17b2cb86 (patch) | |
tree | 624df22dcd2f35cf2c5d4c7b26e96d0e57755cea /src/glsl | |
parent | 9d5944053ca7bed58b299211fe8028274d480b5b (diff) |
nir: make cleanup_cf_node() not use remove_defs_uses()
cleanup_cf_node() is part of the control flow modification code, which
we're going to split into its own file, but remove_defs_uses() is an
internal function used by nir_instr_remove(). Break the dependency by
making cleanup_cf_node() use nir_instr_remove() instead, which simply
calls remove_defs_uses() and then removes the instruction from the list.
nir_instr_remove() does do extra things for jumps, though, so we avoid
calling it on jumps which matches the previous behavior (this will be
fixed later in the series).
Signed-off-by: Connor Abbott <[email protected]>
Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/glsl')
-rw-r--r-- | src/glsl/nir/nir.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/glsl/nir/nir.c b/src/glsl/nir/nir.c index b8a9e985088..793b341ea10 100644 --- a/src/glsl/nir/nir.c +++ b/src/glsl/nir/nir.c @@ -1212,8 +1212,10 @@ cleanup_cf_node(nir_cf_node *node) case nir_cf_node_block: { nir_block *block = nir_cf_node_as_block(node); /* We need to walk the instructions and clean up defs/uses */ - nir_foreach_instr(block, instr) - remove_defs_uses(instr); + nir_foreach_instr(block, instr) { + if (instr->type != nir_instr_type_jump) + nir_instr_remove(instr); + } break; } |