pan/bi: Fix emit_if successor assignment

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Fixes: 9a00cf3d1e ("pan/bi: Add support for if-else blocks")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5260>
This commit is contained in:
Alyssa Rosenzweig 2020-05-27 18:27:08 -04:00 committed by Marge Bot
parent b34eb94d9c
commit e42a5dfd4f
1 changed files with 2 additions and 4 deletions

View File

@ -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