nir/algebraic: optimize fabs(bcsel(b, fneg(a), a))
authorRhys Perry <pendingchaos02@gmail.com>
Fri, 28 Jan 2022 15:48:39 +0000 (15:48 +0000)
committerMarge Bot <emma+marge@anholt.net>
Wed, 14 Sep 2022 12:16:07 +0000 (12:16 +0000)
commitb301c33f65aefa289437eac9d06a71ee57b127a3
tree478f0dc354861c6f8273c6928123fe319e507a59
parent33e60798e144c6638343486371462e5522f3afd4
nir/algebraic: optimize fabs(bcsel(b, fneg(a), a))

fossil-db (Sienna Cichlid):
Totals from 207 (0.15% of 134913) affected shaders:
VGPRs: 7152 -> 6928 (-3.13%)
CodeSize: 762404 -> 752888 (-1.25%)
MaxWaves: 6138 -> 6146 (+0.13%)
Instrs: 144031 -> 142184 (-1.28%)
Latency: 817783 -> 807286 (-1.28%)
InvThroughput: 151031 -> 147497 (-2.34%)
VClause: 1490 -> 1453 (-2.48%)
SClause: 3357 -> 3331 (-0.77%); split: -0.92%, +0.15%
Copies: 9632 -> 9555 (-0.80%); split: -0.81%, +0.01%
Branches: 4306 -> 4270 (-0.84%)
PreSGPRs: 11232 -> 11218 (-0.12%); split: -0.15%, +0.03%
PreVGPRs: 6307 -> 6121 (-2.95%)

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14772>
src/compiler/nir/nir_opt_algebraic.py