aco: Transform uniform bitwise instructions to 32-bit if possible.
authorTimur Kristóf <timur.kristof@gmail.com>
Thu, 16 Jan 2020 18:32:31 +0000 (19:32 +0100)
committerMarge Bot <eric+marge@anholt.net>
Fri, 24 Jan 2020 14:40:45 +0000 (14:40 +0000)
commit8a32f57fff56b3b94f1b5589feba38016f39427c
treefe13e7b5e27bba55bf8b0f10d5e7bb0fb751d330
parentd1925fec535bdadb28b9b25aa93be880fc79918f
aco: Transform uniform bitwise instructions to 32-bit if possible.

This allows removing superfluous s_cselect instructions
that come from turning booleans into 64-bit vector condition.

v2 by Daniel Schürmann:
- Make the code massively simpler
v3 by Timur Kristóf:
- Fix regressions, make it work in wave32 mode
- Eliminate extra moves by not always using the SCC definition
- Use s_absdiff_i32 for uniform XOR
- Skip the transformation for uncommon or invalid instructions

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3450>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3450>
src/amd/compiler/aco_optimizer.cpp