Mesa (staging/20.3): Revert "nir: Replace an odd comparison involving fmin of -b2f"
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Wed Jan 6 18:02:21 UTC 2021
Module: Mesa
Branch: staging/20.3
Commit: 72233905e362b2bd70d1ba3ff2e186c01c0497ab
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=72233905e362b2bd70d1ba3ff2e186c01c0497ab
Author: Ian Romanick <ian.d.romanick at intel.com>
Date: Thu Jun 11 18:48:41 2020 -0700
Revert "nir: Replace an odd comparison involving fmin of -b2f"
I originally noticed that 3b308147916 ("nir/algebraic: Optimize 1-bit
Booleans") caused this pattern no longer be matched by incorrectly
replacing b at 32 with b at 1. Making that correct had no effect on
shader-db. When this pattern originally was added, it only affected 4
shaders, so it's not worth the effort to debug further.
This reverts commit f50400cc8040cf2d07de97e76d9b1ed144c5c8b4.
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira at intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6358>
(cherry picked from commit 314a40c902c6e92b9d6ba0e9b43708d7e1fa9f00)
---
.pick_status.json | 2 +-
src/compiler/nir/nir_opt_algebraic.py | 13 -------------
2 files changed, 1 insertion(+), 14 deletions(-)
diff --git a/.pick_status.json b/.pick_status.json
index 4fb8630d2fa..f1cb264d154 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -1345,7 +1345,7 @@
"description": "Revert \"nir: Replace an odd comparison involving fmin of -b2f\"",
"nominated": true,
"nomination_type": 2,
- "resolution": 0,
+ "resolution": 1,
"master_sha": null,
"because_sha": "f50400cc8040cf2d07de97e76d9b1ed144c5c8b4"
},
diff --git a/src/compiler/nir/nir_opt_algebraic.py b/src/compiler/nir/nir_opt_algebraic.py
index 2fb4d5ae629..8d14b8c2853 100644
--- a/src/compiler/nir/nir_opt_algebraic.py
+++ b/src/compiler/nir/nir_opt_algebraic.py
@@ -423,19 +423,6 @@ optimizations.extend([
(('ieq', ('iadd', a, b), a), ('ieq', b, 0)),
(('ine', ('iadd', a, b), a), ('ine', b, 0)),
- # fmin(-b2f(a), b) >= 0.0
- # -b2f(a) >= 0.0 && b >= 0.0
- # -b2f(a) == 0.0 && b >= 0.0 -b2f can only be 0 or -1, never >0
- # b2f(a) == 0.0 && b >= 0.0
- # a == False && b >= 0.0
- # !a && b >= 0.0
- #
- # The fge in the second replacement is not a typo. I leave the proof that
- # "fmin(-b2f(a), b) >= 0 <=> fmin(-b2f(a), b) == 0" as an exercise for the
- # reader.
- (('fge', ('fmin', ('fneg', ('b2f', 'a at 1')), 'b at 1'), 0.0), ('iand', ('inot', a), ('fge', b, 0.0))),
- (('feq', ('fmin', ('fneg', ('b2f', 'a at 1')), 'b at 1'), 0.0), ('iand', ('inot', a), ('fge', b, 0.0))),
-
(('feq', ('b2f', 'a at 1'), 0.0), ('inot', a)),
(('~fneu', ('b2f', 'a at 1'), 0.0), a),
(('ieq', ('b2i', 'a at 1'), 0), ('inot', a)),
More information about the mesa-commit
mailing list