broadcom/compiler: don't allocate undef to rf0
authorIago Toral Quiroga <itoral@igalia.com>
Wed, 26 Apr 2023 10:57:33 +0000 (12:57 +0200)
committerMarge Bot <emma+marge@anholt.net>
Wed, 3 May 2023 05:39:35 +0000 (05:39 +0000)
rf0 is affected by restrictions in some scenarios so we rather use
a register that does not cause conflicts for scheduling.

total instructions in shared programs: 12850958 -> 12848024 (-0.02%)
instructions in affected programs: 331974 -> 329040 (-0.88%)
helped: 2559
HURT: 201
Instructions are helped.

total max-temps in shared programs: 2210893 -> 2210803 (<.01%)
max-temps in affected programs: 1486 -> 1396 (-6.06%)
helped: 96
HURT: 7
Max-temps are helped.

total sfu-stalls in shared programs: 21975 -> 21965 (-0.05%)
sfu-stalls in affected programs: 32 -> 22 (-31.25%)
helped: 16
HURT: 6
Sfu-stalls are helped.

total inst-and-stalls in shared programs: 12872933 -> 12869989 (-0.02%)
inst-and-stalls in affected programs: 332036 -> 329092 (-0.89%)
helped: 2560
HURT: 189
Inst-and-stalls are helped.

total nops in shared programs: 305911 -> 303501 (-0.79%)
nops in affected programs: 11215 -> 8805 (-21.49%)
helped: 2131
HURT: 3
Nops are helped.

Reviewed-by: Alejandro PiƱeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22797>

src/broadcom/compiler/vir_to_qpu.c

index 7f643ca..246a3a1 100644 (file)
@@ -214,9 +214,10 @@ v3d_generate_code_block(struct v3d_compile *c,
                                 break;
                         case QFILE_NULL:
                                 /* QFILE_NULL is an undef, so we can load
-                                 * anything. Using reg 0
+                                 * anything. Using a reg that doesn't have
+                                 * sched. restrictions.
                                  */
-                                src[i] = qpu_reg(0);
+                                src[i] = qpu_reg(5);
                                 break;
                         case QFILE_LOAD_IMM:
                                 assert(!"not reached");