summaryrefslogtreecommitdiffstats
path: root/src/compiler/nir/nir_loop_analyze.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/compiler/nir/nir_loop_analyze.c')
-rw-r--r--src/compiler/nir/nir_loop_analyze.c15
1 files changed, 2 insertions, 13 deletions
diff --git a/src/compiler/nir/nir_loop_analyze.c b/src/compiler/nir/nir_loop_analyze.c
index 84da035052d..d5281a5faa4 100644
--- a/src/compiler/nir/nir_loop_analyze.c
+++ b/src/compiler/nir/nir_loop_analyze.c
@@ -290,17 +290,6 @@ initialize_ssa_def(nir_ssa_def *def, void *void_state)
return true;
}
-static inline bool
-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;
-}
-
static bool
find_loop_terminators(loop_info_state *state)
{
@@ -315,11 +304,11 @@ find_loop_terminators(loop_info_state *state)
nir_block *last_then = nir_if_last_then_block(nif);
nir_block *last_else = nir_if_last_else_block(nif);
- if (ends_in_break(last_then)) {
+ if (nir_block_ends_in_break(last_then)) {
break_blk = last_then;
continue_from_blk = last_else;
continue_from_then = false;
- } else if (ends_in_break(last_else)) {
+ } else if (nir_block_ends_in_break(last_else)) {
break_blk = last_else;
continue_from_blk = last_then;
}