Mesa (staging/21.3): broadcom/compiler: don't move ldvary earlier if current instruction has ldunif

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Nov 24 08:54:03 UTC 2021


Module: Mesa
Branch: staging/21.3
Commit: ad1a1b8014fd437ec73d3145e855bcb29e8bb53c
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=ad1a1b8014fd437ec73d3145e855bcb29e8bb53c

Author: Iago Toral Quiroga <itoral at igalia.com>
Date:   Tue Nov 23 08:49:53 2021 +0100

broadcom/compiler: don't move ldvary earlier if current instruction has ldunif

If we did, we would have the instruction coming right after ldvary write
to the same implicit destination as ldvary at the same time. We prevent
this when merging instructions, but we should make sure we prevent this
when we move ldvary around for pipelining too.

Reviewed-by: Juan A. Suarez <jasuarez at igalia.com>
(cherry picked from commit 79dee14cc218d87ea8a5020507161a363477f09a)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13923>

---

 src/broadcom/compiler/qpu_schedule.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/src/broadcom/compiler/qpu_schedule.c b/src/broadcom/compiler/qpu_schedule.c
index cfce937f4a0..7b9891e869f 100644
--- a/src/broadcom/compiler/qpu_schedule.c
+++ b/src/broadcom/compiler/qpu_schedule.c
@@ -2001,6 +2001,17 @@ fixup_pipelined_ldvary(struct v3d_compile *c,
         if (alu_reads_register(inst, false, ldvary_magic, ldvary_index))
                 return false;
 
+        /* The implicit ldvary destination may not be written to by a signal
+         * in the instruction following ldvary. Since we are planning to move
+         * ldvary to the previous instruction, this means we need to check if
+         * the current instruction has any other signal that could create this
+         * conflict. The only other signal that can write to the implicit
+         * ldvary destination that is compatible with ldvary in the same
+         * instruction is ldunif.
+         */
+        if (inst->sig.ldunif)
+                return false;
+
         /* The previous instruction can't write to the same destination as the
          * ldvary.
          */



More information about the mesa-commit mailing list