agx: Add agx_exit_block helper
authorAlyssa Rosenzweig <alyssa@rosenzweig.io>
Sat, 19 Jun 2021 17:47:52 +0000 (13:47 -0400)
committerMarge Bot <eric+marge@anholt.net>
Mon, 5 Jul 2021 20:56:04 +0000 (20:56 +0000)
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11718>

src/asahi/compiler/agx_compiler.h

index 4cd8930..f261c42 100644 (file)
@@ -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 {