agx: Add agx_exit_block helper

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11718>
This commit is contained in:
Alyssa Rosenzweig
2021-06-19 13:47:52 -04:00
committed by Marge Bot
parent ebd25e7ee7
commit ec40620f86

View File

@@ -491,6 +491,14 @@ agx_next_block(agx_block *block)
return list_first_entry(&(block->link), agx_block, link); 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 */ /* Like in NIR, for use with the builder */
enum agx_cursor_option { enum agx_cursor_option {