v3d: Avoid spilling that breaks the r5 usage after a ldvary.
[mesa.git] / 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;