broadcom/compiler: only use last thread switch flag to detect final section

Since commit 'c98ddc778a3 broadcom/compiler: force a last thrsw for spilling'
we always ensure we signal the last thread section explicitly with a
last thread switch.

Relying on VPM stores to detect the last thread section is particularly bad,
because we can have VPM stores occurring quite early in a shader program,
which would disable TMU spilling almost entirely.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22461>
This commit is contained in:
Iago Toral Quiroga 2023-04-13 10:31:17 +02:00 committed by Marge Bot
parent dfdbf5bf94
commit 6114e66124

View file

@ -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),