Mesa (main): nir: move nir_block_ends_in_break() to nir.h
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Tue Aug 3 11:25:30 UTC 2021
Module: Mesa
Branch: main
Commit: a7f2e683ded4387febd8529bb0a3fa8c691fcce4
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=a7f2e683ded4387febd8529bb0a3fa8c691fcce4
Author: Timothy Arceri <tarceri at itsqueeze.com>
Date: Thu Jul 29 15:43:26 2021 +1000
nir: move nir_block_ends_in_break() to nir.h
Will be used in a following commit.
Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12064>
---
src/compiler/nir/nir.h | 11 +++++++++++
src/compiler/nir/nir_loop_analyze.h | 11 -----------
2 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/src/compiler/nir/nir.h b/src/compiler/nir/nir.h
index 76ca1f94a9d..47e4658ceb0 100644
--- a/src/compiler/nir/nir.h
+++ b/src/compiler/nir/nir.h
@@ -2938,6 +2938,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) \
diff --git a/src/compiler/nir/nir_loop_analyze.h b/src/compiler/nir/nir_loop_analyze.h
index 7b4ed66ee58..18c23051717 100644
--- a/src/compiler/nir/nir_loop_analyze.h
+++ b/src/compiler/nir/nir_loop_analyze.h
@@ -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 */
More information about the mesa-commit
mailing list