broadcom/compiler: add comment on why we don't use r5 with ldunifa
authorIago Toral Quiroga <itoral@igalia.com>
Mon, 7 Mar 2022 13:03:03 +0000 (14:03 +0100)
committerMarge Bot <emma+marge@anholt.net>
Wed, 9 Mar 2022 15:53:04 +0000 (15:53 +0000)
Reviewed-by: Alejandro PiƱeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15276>

src/broadcom/compiler/vir_register_allocate.c

index 4862f42..46c7e52 100644 (file)
@@ -916,6 +916,11 @@ update_graph_and_reg_classes_for_inst(struct v3d_compile *c, int *acc_nodes,
         if (inst->dst.file == QFILE_TEMP) {
                 /* Only a ldunif gets to write to R5, which only has a
                  * single 32-bit channel of storage.
+                 *
+                 * NOTE: ldunifa is subject to the same, however, going by
+                 * shader-db it is best to keep r5 exclusive to ldunif, probably
+                 * because ldunif has usually a shorter lifespan, allowing for
+                 * more accumulator reuse and QPU merges.
                  */
                 if (!inst->qpu.sig.ldunif) {
                         uint8_t class_bits =