pan/bi: Add T0/T1 constraint check
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Wed, 6 Jan 2021 21:16:37 +0000 (16:16 -0500)
committerMarge Bot <eric+marge@anholt.net>
Mon, 8 Feb 2021 14:07:29 +0000 (14:07 +0000)
Not visible on real shaders yet, but it will be when we schedule
out-of-order (or implement 64-bit multiplication).

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8354>

src/panfrost/bifrost/bi_schedule.c

index c4f7f91..b9ab2cb 100644 (file)
@@ -650,6 +650,22 @@ bi_has_staging_passthrough_hazard(bi_index fma, bi_instr *add)
         return false;
 }
 
+/* Likewise for cross-tuple passthrough (reads_temps) */
+
+static bool
+bi_has_cross_passthrough_hazard(bi_tuple *succ, bi_instr *ins)
+{
+        bi_foreach_instr_in_tuple(succ, pins) {
+                bi_foreach_src(pins, s) {
+                        if (bi_is_word_equiv(ins->dest[0], pins->src[s]) &&
+                                        !bi_reads_temps(pins, s))
+                                return true;
+                }
+        }
+
+        return false;
+}
+
 #ifndef NDEBUG
 
 static bi_builder *