pan/bi: +JUMP can't read same-cycle temp
authorAlyssa Rosenzweig <alyssa@collabora.com>
Wed, 18 May 2022 15:02:53 +0000 (11:02 -0400)
committerMarge Bot <emma+marge@anholt.net>
Thu, 19 May 2022 16:08:26 +0000 (16:08 +0000)
Minor ISA detail missed in the Bifrost scheduler. I hit this in an early version
of this series (where a move feeding into a blend shader return was not
coalesced). Let's get it fixed in the scheduler.

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

src/panfrost/bifrost/bi_schedule.c
src/panfrost/bifrost/test/test-scheduler-predicates.cpp

index a3e176b..8bd349c 100644 (file)
@@ -787,6 +787,10 @@ bi_reads_t(bi_instr *ins, unsigned src)
         case BI_OPCODE_BLEND:
                 return src != 2 && src != 3;
 
+        /* +JUMP can't read the offset from T */
+        case BI_OPCODE_JUMP:
+                return false;
+
         /* Else, just check if we can read any temps */
         default:
                 return bi_reads_temps(ins, src);
index 65d700f..7b7e138 100644 (file)
@@ -150,3 +150,9 @@ TEST_F(SchedulerPredicates, RestrictionsOnFAddV2F16)
    ASSERT_FALSE(bi_can_fma(fadd));
    ASSERT_FALSE(bi_can_add(fadd));
 }
+
+TEST_F(SchedulerPredicates, BranchOffset)
+{
+   bi_instr *jump = bi_jump(b, TMP());
+   ASSERT_FALSE(bi_reads_t(jump, 0));
+}