aco: always optimize v_mad to v_madak in presence of literals
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Wed, 1 Apr 2020 16:09:43 +0000 (18:09 +0200)
committerMarge Bot <eric+marge@anholt.net>
Fri, 3 Apr 2020 07:30:49 +0000 (07:30 +0000)
commitc953292630985cdd0d295f64e880610710bbf50d
treeb816d006ef72cedda105d408d07bb939aeaa9dea
parent63b4fcba33848029e7dd1476d9f82070308a7239
aco: always optimize v_mad to v_madak in presence of literals

v_mad and v_madak are both 64-bit instructions, so it doesn't
increase code size to always apply a 32-bit literal instead of
using v_mad and a sgpr which contains that literal.

Found with some Youngblood shaders but help some other games.

vkpipeline-db (VEGA10):
Totals from affected shaders:
SGPRS: 46168 -> 46016 (-0.33 %)
VGPRS: 45576 -> 45564 (-0.03 %)
Code Size: 5187208 -> 5179584 (-0.15 %) bytes
Max Waves: 3297 -> 3297 (0.00 %)

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4410>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4410>
src/amd/compiler/aco_optimizer.cpp