diff --git a/src/broadcom/compiler/vir_register_allocate.c b/src/broadcom/compiler/vir_register_allocate.c index 66fe35371df..b22f915d1df 100644 --- a/src/broadcom/compiler/vir_register_allocate.c +++ b/src/broadcom/compiler/vir_register_allocate.c @@ -294,10 +294,6 @@ v3d_choose_spill_node(struct v3d_compile *c) if (inst->is_last_thrsw) started_last_seg = true; - if (v3d_qpu_writes_vpm(&inst->qpu) || - v3d_qpu_uses_tlb(&inst->qpu)) - started_last_seg = true; - /* Track when we're in between a TMU setup and the * final LDTMU or TMUWT from that TMU setup. We * penalize spills during that time. @@ -310,6 +306,11 @@ v3d_choose_spill_node(struct v3d_compile *c) } } + /* We always emit a "last thrsw" to ensure all our spilling occurs + * before the last thread section. See vir_emit_last_thrsw. + */ + assert(started_last_seg); + for (unsigned i = 0; i < c->num_temps; i++) { if (BITSET_TEST(c->spillable, i)) { ra_set_node_spill_cost(c->g, temp_to_node(i),