Mesa (master): nir/algebraic: Don't add reordered version of patterns for commutative instructions

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Jan 5 02:24:37 UTC 2021


Module: Mesa
Branch: master
Commit: fe3c5182775b935b6fb8e75b9a94de9561349870
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=fe3c5182775b935b6fb8e75b9a94de9561349870

Author: Ian Romanick <ian.d.romanick at intel.com>
Date:   Fri Jan 24 17:10:07 2020 -0800

nir/algebraic: Don't add reordered version of patterns for commutative instructions

The reordered are automatically considered by nir_algebraic rules for
commutative instructions.

No shader-db or fossil-db changes on any Intel platform.

Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira at intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6358>

---

 src/compiler/nir/nir_opt_algebraic.py | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/compiler/nir/nir_opt_algebraic.py b/src/compiler/nir/nir_opt_algebraic.py
index 5ff51f9746f..063a8579052 100644
--- a/src/compiler/nir/nir_opt_algebraic.py
+++ b/src/compiler/nir/nir_opt_algebraic.py
@@ -1883,8 +1883,13 @@ for op in ['flt', 'fge', 'feq']:
 # which constant folding will eat for lunch.  The resulting ternary will
 # further get cleaned up by the boolean reductions above and we will be
 # left with just the original variable "a".
-for op in ['flt', 'fge', 'feq', 'fneu',
-           'ilt', 'ige', 'ieq', 'ine', 'ult', 'uge']:
+for op in ['feq', 'fneu', 'ieq', 'ine']:
+   optimizations += [
+      ((op, ('bcsel', 'a', '#b', '#c'), '#d'),
+       ('bcsel', 'a', (op, 'b', 'd'), (op, 'c', 'd'))),
+   ]
+
+for op in ['flt', 'fge', 'ilt', 'ige', 'ult', 'uge']:
    optimizations += [
       ((op, ('bcsel', 'a', '#b', '#c'), '#d'),
        ('bcsel', 'a', (op, 'b', 'd'), (op, 'c', 'd'))),



More information about the mesa-commit mailing list