From ec40620f8635a2bacc1040acaaa24a35220399e9 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Sat, 19 Jun 2021 13:47:52 -0400 Subject: [PATCH] agx: Add agx_exit_block helper Signed-off-by: Alyssa Rosenzweig Part-of: --- src/asahi/compiler/agx_compiler.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/asahi/compiler/agx_compiler.h b/src/asahi/compiler/agx_compiler.h index 4cd89300c09..f261c420725 100644 --- a/src/asahi/compiler/agx_compiler.h +++ b/src/asahi/compiler/agx_compiler.h @@ -491,6 +491,14 @@ agx_next_block(agx_block *block) return list_first_entry(&(block->link), agx_block, link); } +static inline agx_block * +agx_exit_block(agx_context *ctx) +{ + agx_block *last = list_last_entry(&ctx->blocks, agx_block, link); + assert(!last->successors[0] && !last->successors[1]); + return last; +} + /* Like in NIR, for use with the builder */ enum agx_cursor_option {