r300: merge together MOV and MAD instructions
authorPavel Ondračka <pavel.ondracka@gmail.com>
Thu, 11 Aug 2022 12:49:15 +0000 (14:49 +0200)
committerMarge Bot <emma+marge@anholt.net>
Mon, 12 Sep 2022 20:29:33 +0000 (20:29 +0000)
commit9156a7aab52bc1c3ba7b96af02ba10ca87999b9e
tree2c14953f28c499684c88160f3f4d7952dd3b2b72
parent708b2b611a45242f4d1edd54850dd04dd80b36e5
r300: merge together MOV and MAD instructions

Assuming they write different channels of the same destination
and they share at least one source or one of the sources is
RC_FILE_NONE.

shader-db with RV530:
total instructions in shared programs: 136033 -> 135673 (-0.26%)
instructions in affected programs: 22987 -> 22627 (-1.57%)
total temps in shared programs: 18977 -> 18965 (-0.06%)
temps in affected programs: 74 -> 62 (-16.22%)

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6188

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