summaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/drivers/freedreno/ir3/ir3_nir_lower_if_else.c11
-rw-r--r--src/gallium/drivers/vc4/vc4_program.c6
2 files changed, 6 insertions, 11 deletions
diff --git a/src/gallium/drivers/freedreno/ir3/ir3_nir_lower_if_else.c b/src/gallium/drivers/freedreno/ir3/ir3_nir_lower_if_else.c
index 6e1395c9001..b781fa7663f 100644
--- a/src/gallium/drivers/freedreno/ir3/ir3_nir_lower_if_else.c
+++ b/src/gallium/drivers/freedreno/ir3/ir3_nir_lower_if_else.c
@@ -224,17 +224,14 @@ lower_if_else_block(nir_block *block, nir_builder *b, void *mem_ctx)
return false;
nir_if *if_stmt = nir_cf_node_as_if(prev_node);
- nir_cf_node *then_node = nir_if_first_then_node(if_stmt);
- nir_cf_node *else_node = nir_if_first_else_node(if_stmt);
+ nir_block *then_block = nir_if_first_then_block(if_stmt);
+ nir_block *else_block = nir_if_first_else_block(if_stmt);
/* We can only have one block in each side ... */
- if (nir_if_last_then_node(if_stmt) != then_node ||
- nir_if_last_else_node(if_stmt) != else_node)
+ if (nir_if_last_then_block(if_stmt) != then_block ||
+ nir_if_last_else_block(if_stmt) != else_block)
return false;
- nir_block *then_block = nir_cf_node_as_block(then_node);
- nir_block *else_block = nir_cf_node_as_block(else_node);
-
/* ... and those blocks must only contain "allowed" instructions. */
if (!block_check_for_allowed_instrs(then_block) ||
!block_check_for_allowed_instrs(else_block))
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);