mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-07 19:30:12 +01:00
pan/bi: Add bi_after_block_logical helper
Useful for lowering phis. Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17794>
This commit is contained in:
parent
29f53ee8bb
commit
a2affda89d
1 changed files with 15 additions and 0 deletions
|
|
@ -1270,6 +1270,21 @@ bi_after_instr(bi_instr *instr)
|
|||
};
|
||||
}
|
||||
|
||||
static inline bi_cursor
|
||||
bi_after_block_logical(bi_block *block)
|
||||
{
|
||||
if (list_is_empty(&block->instructions))
|
||||
return bi_after_block(block);
|
||||
|
||||
bi_instr *last = list_last_entry(&block->instructions, bi_instr, link);
|
||||
assert(last != NULL);
|
||||
|
||||
if (last->branch_target)
|
||||
return bi_before_instr(last);
|
||||
else
|
||||
return bi_after_block(block);
|
||||
}
|
||||
|
||||
static inline bi_cursor
|
||||
bi_before_nonempty_block(bi_block *block)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue