aco/spill: always end spill vgpr after control flow
authorRhys Perry <pendingchaos02@gmail.com>
Tue, 10 Jan 2023 17:33:52 +0000 (17:33 +0000)
committerEric Engestrom <eric@engestrom.ch>
Wed, 8 Feb 2023 20:34:42 +0000 (20:34 +0000)
commitb8ae58820e3150615ef6a16d89b1ff76626a1beb
treec0f416a07463a0cd9f5ddab7f8df1cf376db6aa4
parent4710d25a44028e79faedcc719b4e2abfaa99d43c
aco/spill: always end spill vgpr after control flow

To fix a hypothetical issue:

v0 = start_linear_vgpr
if (...) {

} else {
   use_linear_vgpr(v0)
}
v0 = phi

We need a p_end_linear_vgpr to ensure that the phi does not use the same
VGPR as the linear VGPR.

This is also much simpler.

fossil-db (gfx1100):
Totals from 1195 (0.89% of 134574) affected shaders:
Instrs: 4123856 -> 4123826 (-0.00%); split: -0.00%, +0.00%
CodeSize: 21461256 -> 21461100 (-0.00%); split: -0.00%, +0.00%
Latency: 62816001 -> 62812999 (-0.00%); split: -0.00%, +0.00%
InvThroughput: 9339049 -> 9338564 (-0.01%); split: -0.01%, +0.00%
Copies: 304028 -> 304005 (-0.01%); split: -0.02%, +0.01%
PreVGPRs: 115761 -> 115762 (+0.00%)

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20621>
(cherry picked from commit bbc5247bf71cebfdb2ee79646bd2231a909a74eb)
.pick_status.json
src/amd/compiler/aco_spill.cpp