Mesa (main): pan/bi: Add bi_entry_block helper

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Jul 29 23:53:26 UTC 2021


Module: Mesa
Branch: main
Commit: e3f14b9850e4452742aab7e08f725a4b8858904a
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=e3f14b9850e4452742aab7e08f725a4b8858904a

Author: Alyssa Rosenzweig <alyssa at collabora.com>
Date:   Tue Jul 27 18:29:58 2021 -0400

pan/bi: Add bi_entry_block helper

Useful for checking invariants at the start of the program.

Signed-off-by: Alyssa Rosenzweig <alyssa at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12130>

---

 src/panfrost/bifrost/compiler.h | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/panfrost/bifrost/compiler.h b/src/panfrost/bifrost/compiler.h
index 02df7f8ebae..b1d50cc7945 100644
--- a/src/panfrost/bifrost/compiler.h
+++ b/src/panfrost/bifrost/compiler.h
@@ -862,6 +862,12 @@ bi_next_block(bi_block *block)
         return list_first_entry(&(block->link), bi_block, link);
 }
 
+static inline bi_block *
+bi_entry_block(bi_context *ctx)
+{
+        return list_first_entry(&ctx->blocks, bi_block, link);
+}
+
 /* BIR manipulation */
 
 bool bi_has_arg(const bi_instr *ins, bi_index arg);



More information about the mesa-commit mailing list