diff options
author | Jason Ekstrand <[email protected]> | 2016-10-05 19:08:57 -0700 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2016-10-06 09:16:37 -0700 |
commit | 2ed17d46de045404042f13c6591895a1cf31b167 (patch) | |
tree | a3ae65b79f04ef673578382c631a045f371428e8 /src/gallium/drivers/vc4 | |
parent | 7a3bcadf4e665ff80775f520715061f4e3d63823 (diff) |
nir: Make nir_foo_first/last_cf_node return a block instead
One of NIR's invariants is that control flow lists always start and end
with blocks. There's no good reason why we should return a cf_node from
these functions since we know that it's always a block. Making it a block
lets us remove a bunch of code.
Signed-off-by: Jason Ekstrand <[email protected]>
Reviewed-by: Connor Abbott <[email protected]>
Diffstat (limited to 'src/gallium/drivers/vc4')
-rw-r--r-- | src/gallium/drivers/vc4/vc4_program.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/gallium/drivers/vc4/vc4_program.c b/src/gallium/drivers/vc4/vc4_program.c index 81c67168c18..84add5253ff 100644 --- a/src/gallium/drivers/vc4/vc4_program.c +++ b/src/gallium/drivers/vc4/vc4_program.c @@ -1777,11 +1777,9 @@ ntq_emit_if(struct vc4_compile *c, nir_if *if_stmt) return; } - nir_cf_node *nir_first_else_node = nir_if_first_else_node(if_stmt); - nir_cf_node *nir_last_else_node = nir_if_last_else_node(if_stmt); - nir_block *nir_else_block = nir_cf_node_as_block(nir_first_else_node); + nir_block *nir_else_block = nir_if_first_else_block(if_stmt); bool empty_else_block = - (nir_first_else_node == nir_last_else_node && + (nir_else_block == nir_if_last_else_block(if_stmt) && exec_list_is_empty(&nir_else_block->instr_list)); struct qblock *then_block = qir_new_block(c); |