diff options
author | Alyssa Rosenzweig <[email protected]> | 2020-03-06 09:26:20 -0500 |
---|---|---|
committer | Marge Bot <[email protected]> | 2020-03-07 00:37:39 +0000 |
commit | 79c1af062341266d7ad64a0ac221394d6cbfdfdc (patch) | |
tree | d6b353662ca61640d7f44a202d75af12c9f9b8df | |
parent | 92a4f26e7f5249df3cb853b3a8cd9e726690d66c (diff) |
pan/bi: Add bi_schedule_barrier helper
Copypaste from Midgard.
Signed-off-by: Alyssa Rosenzweig <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4097>
-rw-r--r-- | src/panfrost/bifrost/bifrost_compile.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/panfrost/bifrost/bifrost_compile.c b/src/panfrost/bifrost/bifrost_compile.c index 6be08947d78..6a57adc4e53 100644 --- a/src/panfrost/bifrost/bifrost_compile.c +++ b/src/panfrost/bifrost/bifrost_compile.c @@ -39,6 +39,7 @@ static bi_block *emit_cf_list(bi_context *ctx, struct exec_list *list); static bi_instruction *bi_emit_branch(bi_context *ctx); static void bi_block_add_successor(bi_block *block, bi_block *successor); +static void bi_schedule_barrier(bi_context *ctx); static void emit_jump(bi_context *ctx, nir_jump_instr *instr) @@ -180,6 +181,18 @@ bi_block_add_successor(bi_block *block, bi_block *successor) unreachable("Too many successors"); } +static void +bi_schedule_barrier(bi_context *ctx) +{ + bi_block *temp = ctx->after_block; + ctx->after_block = create_empty_block(ctx); + list_addtail(&ctx->after_block->link, &ctx->blocks); + list_inithead(&ctx->after_block->instructions); + bi_block_add_successor(ctx->current_block, ctx->after_block); + ctx->current_block = ctx->after_block; + ctx->after_block = temp; +} + static bi_block * emit_block(bi_context *ctx, nir_block *block) { |