pan/bi: Add bi_entry_block helper

Useful for checking invariants at the start of the program.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12130>
This commit is contained in:
Alyssa Rosenzweig 2021-07-27 18:29:58 -04:00 committed by Marge Bot
parent c4f8b52e06
commit e3f14b9850
1 changed files with 6 additions and 0 deletions

View File

@ -862,6 +862,12 @@ bi_next_block(bi_block *block)
return list_first_entry(&(block->link), bi_block, link);
}
static inline bi_block *
bi_entry_block(bi_context *ctx)
{
return list_first_entry(&ctx->blocks, bi_block, link);
}
/* BIR manipulation */
bool bi_has_arg(const bi_instr *ins, bi_index arg);