diff options
Diffstat (limited to 'src/compiler')
-rw-r--r-- | src/compiler/nir/nir_algebraic.py | 3 | ||||
-rw-r--r-- | src/compiler/nir/nir_opt_algebraic.py | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/src/compiler/nir/nir_algebraic.py b/src/compiler/nir/nir_algebraic.py index d6784df004e..847c59dbd89 100644 --- a/src/compiler/nir/nir_algebraic.py +++ b/src/compiler/nir/nir_algebraic.py @@ -25,6 +25,7 @@ from __future__ import print_function import ast +from collections import OrderedDict import itertools import struct import sys @@ -601,7 +602,7 @@ ${pass_name}(nir_shader *shader) class AlgebraicPass(object): def __init__(self, pass_name, transforms): - self.xform_dict = {} + self.xform_dict = OrderedDict() self.pass_name = pass_name error = False diff --git a/src/compiler/nir/nir_opt_algebraic.py b/src/compiler/nir/nir_opt_algebraic.py index db907df8545..2f1cba398f0 100644 --- a/src/compiler/nir/nir_opt_algebraic.py +++ b/src/compiler/nir/nir_opt_algebraic.py @@ -23,6 +23,7 @@ # Authors: # Jason Ekstrand ([email protected]) +from collections import OrderedDict import nir_algebraic import itertools @@ -628,7 +629,7 @@ optimizations = [ 'options->lower_unpack_snorm_4x8'), ] -invert = {'feq': 'fne', 'fne': 'feq', 'fge': 'flt', 'flt': 'fge' } +invert = OrderedDict([('feq', 'fne'), ('fne', 'feq'), ('fge', 'flt'), ('flt', 'fge')]) for left, right in list(itertools.combinations(invert.keys(), 2)) + zip(invert.keys(), invert.keys()): optimizations.append((('inot', ('ior(is_used_once)', (left, a, b), (right, c, d))), |