aco: more carefully apply constant offsets into scratch accesses
authorRhys Perry <pendingchaos02@gmail.com>
Thu, 1 Dec 2022 15:05:49 +0000 (15:05 +0000)
committerMarge Bot <emma+marge@anholt.net>
Tue, 6 Dec 2022 15:23:38 +0000 (15:23 +0000)
commit381de3c809fce5427308c696bbd313360194eff4
tree8a9c97b069379167fcc5688f040b48f1d33fbff1
parentfae8c75ad0bb707cf1ae780838b9874518642239
aco: more carefully apply constant offsets into scratch accesses

Death stranding does scratch_arr[80-idx]. This doesn't seem to work if we
try to combine the subtraction into the access.

fossil-db (navi21):
Totals from 52 (0.04% of 135636) affected shaders:
Instrs: 78560 -> 79036 (+0.61%)
CodeSize: 427940 -> 431188 (+0.76%)
Latency: 1313809 -> 1318142 (+0.33%)
InvThroughput: 292833 -> 293842 (+0.34%)
VClause: 2361 -> 2555 (+8.22%); split: -0.51%, +8.73%
Copies: 8767 -> 8746 (-0.24%); split: -0.35%, +0.11%

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Fixes: 0e783d687a3 ("aco: use scratch_* for scratch load/store on GFX9+")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7735
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20117>
src/amd/compiler/aco_optimizer.cpp