broadcom/compiler: fix postponed TMU spills with multiple writes
authorIago Toral Quiroga <itoral@igalia.com>
Wed, 22 Jun 2022 06:29:42 +0000 (08:29 +0200)
committerMarge Bot <emma+marge@anholt.net>
Tue, 28 Jun 2022 05:49:51 +0000 (05:49 +0000)
commit98420408d0bd0d339c723d6de544a668b2b8f9b6
tree9ec39b67500807ab1d8aa2a600c88c3559f95199
parent0bc65b1d81f1064a1ef14a6afbeab2dc46e2329b
broadcom/compiler: fix postponed TMU spills with multiple writes

If we are spilling a register that is used in the middle of a TMU
sequence, we postpone the spill until the TMU sequence finishes,
at which point we inject the spill and rewrite the original
instruction to write to the new temp.

However, this doesn't work if the register is written multiple
times during the TMU sequence. In that scenario, we need to ensure
that all writes are rewritten to use the new temp, not just the last
one.

Cc: mesa-stable
Reviewed-by: Alejandro PiƱeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17201>
src/broadcom/compiler/vir_register_allocate.c