nir/algebraic: Remove array-of-cond code
authorEmma Anholt <emma@anholt.net>
Tue, 30 Nov 2021 22:17:10 +0000 (14:17 -0800)
committerMarge Bot <emma+marge@anholt.net>
Tue, 7 Dec 2021 07:09:00 +0000 (07:09 +0000)
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@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13987>

src/compiler/nir/nir_algebraic.py

index 95af247..9211448 100644 (file)
@@ -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)