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)
committerEric Engestrom <eric@engestrom.ch>
Wed, 14 Dec 2022 20:47:01 +0000 (20:47 +0000)
commit91c565df53043f4f474f377647bc0e1e05556942
treeea358705426316d0cdc098df1520ccb624502f5c
parentd8d1b09474ab208484bef7ddaa2ee90c5ff4bd1e
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>
(cherry picked from commit 381de3c809fce5427308c696bbd313360194eff4)
.pick_status.json
src/amd/compiler/aco_optimizer.cpp