summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Romanick <ian.d.romanick@intel.com>2020-09-14 11:05:51 -0700
committerIan Romanick <ian.d.romanick@intel.com>2021-04-02 12:56:19 -0700
commit0aadf06c0595978ad9c847bbfa463d16aca9a6b8 (patch)
tree43290b231a5028c864c4789baa64ad5eb224dbe6
parent39075aee348132e8e8f68db650a2a7d118dd5d86 (diff)
WIP: nir/algebraic: Add algebraic opt for fge comparison with identical operands.NaNu-NaNu
No shader-db or pipeline-db changes on any Intel platform.
-rw-r--r--src/compiler/nir/nir_opt_algebraic.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/compiler/nir/nir_opt_algebraic.py b/src/compiler/nir/nir_opt_algebraic.py
index dec81509f05..0b1c13e8675 100644
--- a/src/compiler/nir/nir_opt_algebraic.py
+++ b/src/compiler/nir/nir_opt_algebraic.py
@@ -1129,6 +1129,9 @@ optimizations.extend([
(('fge', 'a(is_a_number)', a), True),
(('feq', 'a(is_a_number)', a), True),
(('fneu', 'a(is_a_number)', a), False),
+ # Other optimizations can reduce a == a when logically joined with other
+ # comparisons even when a might not be a number.
+ (('fge', a, a), ('feq', a, a)),
# Logical and bit operations
(('iand', a, a), a),
(('iand', a, ~0), a),