mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-02-02 13:10:25 +01:00
nir: move nir_block_ends_in_break() to nir.h
Will be used in a following commit.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12064>
(cherry picked from commit a7f2e683de)
This commit is contained in:
parent
18581c3a30
commit
ce5be91818
3 changed files with 12 additions and 12 deletions
|
|
@ -8410,7 +8410,7 @@
|
|||
"description": "nir: move nir_block_ends_in_break() to nir.h",
|
||||
"nominated": false,
|
||||
"nomination_type": null,
|
||||
"resolution": 4,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": null
|
||||
},
|
||||
|
|
|
|||
|
|
@ -2749,6 +2749,17 @@ nir_block_ends_in_jump(nir_block *block)
|
|||
nir_block_last_instr(block)->type == nir_instr_type_jump;
|
||||
}
|
||||
|
||||
static inline bool
|
||||
nir_block_ends_in_break(nir_block *block)
|
||||
{
|
||||
if (exec_list_is_empty(&block->instr_list))
|
||||
return false;
|
||||
|
||||
nir_instr *instr = nir_block_last_instr(block);
|
||||
return instr->type == nir_instr_type_jump &&
|
||||
nir_instr_as_jump(instr)->type == nir_jump_break;
|
||||
}
|
||||
|
||||
#define nir_foreach_instr(instr, block) \
|
||||
foreach_list_typed(nir_instr, instr, node, &(block)->instr_list)
|
||||
#define nir_foreach_instr_reverse(instr, block) \
|
||||
|
|
|
|||
|
|
@ -92,15 +92,4 @@ nir_is_trivial_loop_if(nir_if *nif, nir_block *break_block)
|
|||
return true;
|
||||
}
|
||||
|
||||
static inline bool
|
||||
nir_block_ends_in_break(nir_block *block)
|
||||
{
|
||||
if (exec_list_is_empty(&block->instr_list))
|
||||
return false;
|
||||
|
||||
nir_instr *instr = nir_block_last_instr(block);
|
||||
return instr->type == nir_instr_type_jump &&
|
||||
nir_instr_as_jump(instr)->type == nir_jump_break;
|
||||
}
|
||||
|
||||
#endif /* NIR_LOOP_ANALYZE_H */
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue