summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>2020-05-27 18:27:08 -0400
committerMarge Bot <eric+marge@anholt.net>2020-05-29 20:34:55 +0000
commite42a5dfd4f2b22c73f4627128ac6d3dbcb10aca1 (patch)
treede6f13b27b9404b342d70ff59847a1e7cdecc6d9
parentb34eb94d9c97a7bfdd64da444dcc0860f6546f89 (diff)
pan/bi: Fix emit_if successor assignment
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> Fixes: 9a00cf3d1ef ("pan/bi: Add support for if-else blocks") Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5260>
-rw-r--r--src/panfrost/bifrost/bifrost_compile.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/panfrost/bifrost/bifrost_compile.c b/src/panfrost/bifrost/bifrost_compile.c
index 2404d988aae..1e41b53e435 100644
--- a/src/panfrost/bifrost/bifrost_compile.c
+++ b/src/panfrost/bifrost/bifrost_compile.c
@@ -1084,18 +1084,16 @@ emit_if(bi_context *ctx, nir_if *nif)
/* The else block is empty, so don't emit an exit jump */
bi_remove_instruction(then_exit);
then_branch->branch_target = ctx->after_block;
+ pan_block_add_successor(&end_then_block->base, &ctx->after_block->base); /* fallthrough */
} else {
then_branch->branch_target = else_block;
then_exit->branch_target = ctx->after_block;
pan_block_add_successor(&end_then_block->base, &then_exit->branch_target->base);
+ pan_block_add_successor(&end_else_block->base, &ctx->after_block->base); /* fallthrough */
}
- /* Wire up the successors */
-
pan_block_add_successor(&before_block->base, &then_branch->branch_target->base); /* then_branch */
-
pan_block_add_successor(&before_block->base, &then_block->base); /* fallthrough */
- pan_block_add_successor(&end_else_block->base, &ctx->after_block->base); /* fallthrough */
}
static void