nir/algebraic: Undistribute fsat from fmax
authorIan Romanick <ian.d.romanick@intel.com>
Thu, 23 Mar 2023 23:01:13 +0000 (16:01 -0700)
committerMarge Bot <emma+marge@anholt.net>
Wed, 29 Mar 2023 23:48:19 +0000 (23:48 +0000)
commit71e5530c07a1743c68d889b11c3fa2259a6376be
treed933b51cc2789bc4fdae31e45a07471480fbfa3f
parent782de1932c84a27e25e1fcf593228f7bcaf248e4
nir/algebraic: Undistribute fsat from fmax

To be helpful, the thing inside the fsat has to be used with and without
the fsat. Otherwise it just moves a saturate destination modifier
around. To not be harmful, the fsat has to only be used by the bcsel.

All Broadwell and newer Intel platforms had similar results. (Ice Lake shown)
total instructions in shared programs: 20174475 -> 20174449 (<.01%)
instructions in affected programs: 3913 -> 3887 (-0.66%)
helped: 13 / HURT: 0

total cycles in shared programs: 866844832 -> 866844719 (<.01%)
cycles in affected programs: 46037 -> 45924 (-0.25%)
helped: 10 / HURT: 1

All Intel platforms had similar results. (Ice Lake shown)
Instructions in all programs: 161491468 -> 161491372 (-0.0%)
helped: 31 / HURT: 8

Cycles in all programs: 10933090736 -> 10933024716 (-0.0%)
helped: 32 / HURT: 18

Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22169>
src/compiler/nir/nir_opt_algebraic.py