v3d: Avoid spilling that breaks the r5 usage after a ldvary.
authorEric Anholt <eric@anholt.net>
Thu, 2 Aug 2018 18:12:37 +0000 (11:12 -0700)
committerEric Anholt <eric@anholt.net>
Mon, 6 Aug 2018 20:03:23 +0000 (13:03 -0700)
Fixes bad rendering when forcing 2 spills in glxgears.

Cc: "18.2" <mesa-stable@lists.freedesktop.org>
src/broadcom/compiler/vir_register_allocate.c

index bc34f68e59a5b686b546762f47e7e72ee155aed6..accc07a3a335ac2e4deed5ee143146fa4b98f3e3 100644 (file)
@@ -94,6 +94,15 @@ v3d_choose_spill_node(struct v3d_compile *c, struct ra_graph *g,
                                 }
                         }
 
+                        /* Refuse to spill a ldvary's dst, because that means
+                         * that ldvary's r5 would end up being used across a
+                         * thrsw.
+                         */
+                        if (inst->qpu.sig.ldvary) {
+                                assert(inst->dst.file == QFILE_TEMP);
+                                BITSET_CLEAR(c->spillable, inst->dst.index);
+                        }
+
                         if (inst->is_last_thrsw)
                                 started_last_seg = true;