aco: fix target calculation when vgpr spilling introduces sgpr spilling
authorRhys Perry <pendingchaos02@gmail.com>
Thu, 2 Jan 2020 15:36:49 +0000 (15:36 +0000)
committerMarge Bot <eric+marge@anholt.net>
Wed, 29 Jan 2020 18:02:27 +0000 (18:02 +0000)
commit590c26beab153fbc7c2193ce65a9a63329a80be8
treef466e60d3798433abdf0b0ed1437e272f64929d5
parenta61eff8330234306077444e97e178542991f6e27
aco: fix target calculation when vgpr spilling introduces sgpr spilling

A shader might require vgpr spilling but not require sgpr spilling. In
that case, the spiller lowers the sgpr target by 5 which could mean sgpr
spilling is then required. Then the vgpr target has to be lowered to make
space for the linear vgprs. Previously, space wasn't make for the linear
vgprs.

Found while testing the spiller on the pipeline-db with a lowered limit

Fixes: a7ff1bb5b9a78cf57073b5e2e136daf0c85078d6
   ('aco: simplify calculation of target register pressure when spilling')

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3257>
src/amd/compiler/aco_spill.cpp