pan/bi: Add scoreboard state to IR
authorAlyssa Rosenzweig <alyssa@collabora.com>
Fri, 18 Feb 2022 20:28:38 +0000 (15:28 -0500)
committerMarge Bot <emma+marge@anholt.net>
Tue, 22 Feb 2022 16:57:30 +0000 (16:57 +0000)
To a limited degree, scoreboarding must be global, so add the data
structures for tracking this to the IR.

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

src/panfrost/bifrost/compiler.h

index 88cb252..86a8548 100644 (file)
@@ -617,6 +617,15 @@ typedef struct {
         bool td;
 } bi_clause;
 
+#define BI_NUM_SLOTS 8
+
+/* A model for the state of the scoreboard */
+struct bi_scoreboard_state {
+        /** Bitmap of registers read/written by a slot */
+        uint64_t read[BI_NUM_SLOTS];
+        uint64_t write[BI_NUM_SLOTS];
+};
+
 typedef struct bi_block {
         /* Link to next block. Must be first for mir_get_block */
         struct list_head link;
@@ -643,6 +652,9 @@ typedef struct bi_block {
         /* Post-RA liveness */
         uint64_t reg_live_in, reg_live_out;
 
+        /* Scoreboard state at the start/end of block */
+        struct bi_scoreboard_state scoreboard_in, scoreboard_out;
+
         /* Flags available for pass-internal use */
         uint8_t pass_flags;
 } bi_block;