Mesa (main): nir/algebraic: Remove array-of-cond code

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Dec 7 07:49:39 UTC 2021


Module: Mesa
Branch: main
Commit: 7635379dc723852e6a64a3a284ff27020d9513f7
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=7635379dc723852e6a64a3a284ff27020d9513f7

Author: Emma Anholt <emma at anholt.net>
Date:   Tue Nov 30 14:17:10 2021 -0800

nir/algebraic: Remove array-of-cond code

You can't have an array of them after removing many-comm-expr, there's no
space in the struct.

Reviewed-by: Adam Jackson <ajax at redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13987>

---

 src/compiler/nir/nir_algebraic.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/compiler/nir/nir_algebraic.py b/src/compiler/nir/nir_algebraic.py
index 95af2471dff..92114482bc8 100644
--- a/src/compiler/nir/nir_algebraic.py
+++ b/src/compiler/nir/nir_algebraic.py
@@ -351,8 +351,9 @@ class Expression(Value):
          # "many-comm-expr".  If there is anything left, put it back together.
          c = self.cond[1:-1].split(",")
          c.remove("many-comm-expr")
+         assert(len(c) <= 1)
 
-         self.cond = "({})".format(",".join(c)) if c else None
+         self.cond = c[0] if c else None
          self.many_commutative_expressions = True
 
       self.sources = [ Value.create(src, "{0}_{1}".format(name_base, i), varset)



More information about the mesa-commit mailing list