Mesa (main): pan/bi: Add bi_{start, exit}_block helpers
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Tue Feb 22 17:10:15 UTC 2022
Module: Mesa
Branch: main
Commit: 75406a561fa11c2dcaa7b00dae40f68d806cd55c
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=75406a561fa11c2dcaa7b00dae40f68d806cd55c
Author: Alyssa Rosenzweig <alyssa at collabora.com>
Date: Thu Dec 23 11:06:59 2021 -0500
pan/bi: Add bi_{start, exit}_block helpers
Useful for data flow analysis.
Signed-off-by: Alyssa Rosenzweig <alyssa at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14298>
---
src/panfrost/bifrost/compiler.h | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/src/panfrost/bifrost/compiler.h b/src/panfrost/bifrost/compiler.h
index fddc5217e9c..88cb252a520 100644
--- a/src/panfrost/bifrost/compiler.h
+++ b/src/panfrost/bifrost/compiler.h
@@ -647,6 +647,22 @@ typedef struct bi_block {
uint8_t pass_flags;
} bi_block;
+static inline bi_block *
+bi_start_block(struct list_head *blocks)
+{
+ bi_block *first = list_first_entry(blocks, bi_block, link);
+ assert(first->predecessors->entries == 0);
+ return first;
+}
+
+static inline bi_block *
+bi_exit_block(struct list_head *blocks)
+{
+ bi_block *last = list_last_entry(blocks, bi_block, link);
+ assert(!last->successors[0] && !last->successors[1]);
+ return last;
+}
+
/* Subset of pan_shader_info needed per-variant, in order to support IDVS */
struct bi_shader_info {
struct panfrost_ubo_push *push;
More information about the mesa-commit
mailing list