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

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Feb 24 20:12:34 UTC 2022


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

Author: Alyssa Rosenzweig <alyssa at collabora.com>
Date:   Wed Feb 23 13:47:08 2022 -0500

pan/bi: Add bi_before_nonempty_block helper

To be used in the message preloading pass.

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

---

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

diff --git a/src/panfrost/bifrost/compiler.h b/src/panfrost/bifrost/compiler.h
index cc37c661c2f..664e25a3c7e 100644
--- a/src/panfrost/bifrost/compiler.h
+++ b/src/panfrost/bifrost/compiler.h
@@ -1133,6 +1133,15 @@ bi_after_instr(bi_instr *instr)
     };
 }
 
+static inline bi_cursor
+bi_before_nonempty_block(bi_block *block)
+{
+        bi_instr *I = list_first_entry(&block->instructions, bi_instr, link);
+        assert(I != NULL);
+
+        return bi_before_instr(I);
+}
+
 /* Invariant: a tuple must be nonempty UNLESS it is the last tuple of a clause,
  * in which case there must exist a nonempty penultimate tuple */
 



More information about the mesa-commit mailing list