Mesa (master): nir/algebraic: add optimizations for fsign/isign
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Mon Jul 20 16:31:07 UTC 2020
Module: Mesa
Branch: master
Commit: 2fca183910ddbd2f87ec713396172fcf2c4abae4
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=2fca183910ddbd2f87ec713396172fcf2c4abae4
Author: Daniel Schürmann <daniel at schuermann.dev>
Date: Wed Apr 29 17:56:05 2020 +0100
nir/algebraic: add optimizations for fsign/isign
This just reverts fsign/isign lowering.
Totals from affected shaders:
SGPRS: 257496 -> 256672 (-0.32 %)
VGPRS: 181800 -> 178864 (-1.61 %)
Spilled SGPRs: 105 -> 105 (0.00 %)
Spilled VGPRs: 0 -> 0 (0.00 %)
Private memory VGPRs: 0 -> 0 (0.00 %)
Scratch size: 0 -> 0 (0.00 %) dwords per thread
Code Size: 11355852 -> 11141840 (-1.88 %) bytes
LDS: 3789 -> 3789 (0.00 %) blocks
Max Waves: 30453 -> 30951 (1.64 %)
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig at collabora.com>
Reviewed-by: Rhys Perry <pendingchaos02 at gmail.com>
Reviewed-by: Marek Olšák <marek.olsak at amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4830>
---
src/compiler/nir/nir_opt_algebraic.py | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/compiler/nir/nir_opt_algebraic.py b/src/compiler/nir/nir_opt_algebraic.py
index 3719d0cc8c6..92c3a9901ca 100644
--- a/src/compiler/nir/nir_opt_algebraic.py
+++ b/src/compiler/nir/nir_opt_algebraic.py
@@ -1394,7 +1394,11 @@ optimizations.extend([
'options->lower_pack_split'),
(('isign', a), ('imin', ('imax', a, -1), 1), 'options->lower_isign'),
+ (('imin', ('imax', a, -1), 1), ('isign', a), '!options->lower_isign'),
+ (('imax', ('imin', a, 1), -1), ('isign', a), '!options->lower_isign'),
(('fsign', a), ('fsub', ('b2f', ('flt', 0.0, a)), ('b2f', ('flt', a, 0.0))), 'options->lower_fsign'),
+ (('fadd', ('b2f32', ('flt', 0.0, 'a at 32')), ('fneg', ('b2f32', ('flt', 'a at 32', 0.0)))), ('fsign', a), '!options->lower_fsign'),
+ (('iadd', ('b2i32', ('flt', 0, 'a at 32')), ('ineg', ('b2i32', ('flt', 'a at 32', 0)))), ('f2i32', ('fsign', a)), '!options->lower_fsign'),
# Address/offset calculations:
# Drivers supporting imul24 should use the nir_lower_amul() pass, this
More information about the mesa-commit
mailing list