Mesa (staging/21.2): nir: move nir_block_ends_in_break() to nir.h
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Fri Aug 27 17:23:31 UTC 2021
Module: Mesa
Branch: staging/21.2
Commit: ce5be91818c9a8dd1aca0fe6d41b7ea26b58872e
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=ce5be91818c9a8dd1aca0fe6d41b7ea26b58872e
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>
(cherry picked from commit a7f2e683ded4387febd8529bb0a3fa8c691fcce4)
---
.pick_status.json | 2 +-
src/compiler/nir/nir.h | 11 +++++++++++
src/compiler/nir/nir_loop_analyze.h | 11 -----------
3 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/.pick_status.json b/.pick_status.json
index 139cb6a71f1..58ad650db7c 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -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
},
diff --git a/src/compiler/nir/nir.h b/src/compiler/nir/nir.h
index 3de53b51388..efeaff2d258 100644
--- a/src/compiler/nir/nir.h
+++ b/src/compiler/nir/nir.h
@@ -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) \
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