r300: don't move position output to the end when duplicating it for WPOS
authorPavel Ondračka <pavel.ondracka@gmail.com>
Mon, 7 Mar 2022 12:41:55 +0000 (13:41 +0100)
committerMarge Bot <emma+marge@anholt.net>
Tue, 29 Mar 2022 21:37:24 +0000 (21:37 +0000)
commit5dcef1e7b87498f1f115f2167a007fb724987b97
tree4349d48d56b9bb5338c8051b5115f91ee1a36b28
parent8cf10ae144fdafc475165cd24911387d66f849fd
r300: don't move position output to the end when duplicating it for WPOS

Instead just emit both outputs as soon as possible.

If the last write is inside a loop or a branch, emit it after
the ENDLOOP or ENDIF. This saves some temps and also allows us
to potentially benefit from R300_PVS_XYZW_VALID_INST as right
now the position output write is always penultimate with the
WPOS output being the last.

total temps in shared programs: 14101 -> 14029 (-0.51%)
temps in affected programs: 435 -> 363 (-16.55%)
helped: 72
HURT: 0

Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Reviewed-by: Filip Gawin <filip.gawin@zoho.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15321>
src/gallium/drivers/r300/compiler/radeon_compiler.c