Mesa (main): pan/bi: Export bi_block_add_successor

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Jun 1 16:29:30 UTC 2022


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

Author: Alyssa Rosenzweig <alyssa at collabora.com>
Date:   Fri May 20 11:10:11 2022 -0400

pan/bi: Export bi_block_add_successor

For use in unit tests that need to create blocks.

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

---

 src/panfrost/bifrost/bifrost_compile.c | 25 -------------------------
 src/panfrost/bifrost/compiler.h        | 25 +++++++++++++++++++++++++
 2 files changed, 25 insertions(+), 25 deletions(-)

diff --git a/src/panfrost/bifrost/bifrost_compile.c b/src/panfrost/bifrost/bifrost_compile.c
index 42cc6870c5c..870b73a83fc 100644
--- a/src/panfrost/bifrost/bifrost_compile.c
+++ b/src/panfrost/bifrost/bifrost_compile.c
@@ -115,31 +115,6 @@ bi_instance_id(bi_builder *b)
         return bi_preload(b, (b->shader->arch >= 9) ? 61 : 62);
 }
 
-static void
-bi_block_add_successor(bi_block *block, bi_block *successor)
-{
-        assert(block != NULL && successor != NULL);
-
-        /* Cull impossible edges */
-        if (block->unconditional_jumps)
-                return;
-
-        for (unsigned i = 0; i < ARRAY_SIZE(block->successors); ++i) {
-                if (block->successors[i]) {
-                       if (block->successors[i] == successor)
-                               return;
-                       else
-                               continue;
-                }
-
-                block->successors[i] = successor;
-                util_dynarray_append(&successor->predecessors, bi_block *, block);
-                return;
-        }
-
-        unreachable("Too many successors");
-}
-
 static void
 bi_emit_jump(bi_builder *b, nir_jump_instr *instr)
 {
diff --git a/src/panfrost/bifrost/compiler.h b/src/panfrost/bifrost/compiler.h
index 076c4bf535d..1a2b365f5b8 100644
--- a/src/panfrost/bifrost/compiler.h
+++ b/src/panfrost/bifrost/compiler.h
@@ -710,6 +710,31 @@ bi_exit_block(struct list_head *blocks)
         return last;
 }
 
+static inline void
+bi_block_add_successor(bi_block *block, bi_block *successor)
+{
+        assert(block != NULL && successor != NULL);
+
+        /* Cull impossible edges */
+        if (block->unconditional_jumps)
+                return;
+
+        for (unsigned i = 0; i < ARRAY_SIZE(block->successors); ++i) {
+                if (block->successors[i]) {
+                       if (block->successors[i] == successor)
+                               return;
+                       else
+                               continue;
+                }
+
+                block->successors[i] = successor;
+                util_dynarray_append(&successor->predecessors, bi_block *, block);
+                return;
+        }
+
+        unreachable("Too many successors");
+}
+
 /* 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