diff options
author | Mathieu Bridon <[email protected]> | 2018-08-09 10:27:19 +0200 |
---|---|---|
committer | Dylan Baker <[email protected]> | 2018-08-09 16:49:18 -0700 |
commit | d9ca4a172e8e8a42217588ca1b83a7ceb5bf3f76 (patch) | |
tree | a70fccee99267b2f5be7cda282d9cad35f77f471 /src/compiler | |
parent | b618d7ea59a4d7da9823e02ac5608a67fd99b332 (diff) |
python: Use the right function for the job
The code was just reimplementing itertools.combinations_with_replacement
in a less efficient way.
This does change the order of the results slightly, but it should be ok.
Signed-off-by: Mathieu Bridon <[email protected]>
Reviewed-by: Dylan Baker <[email protected]>
Diffstat (limited to 'src/compiler')
-rw-r--r-- | src/compiler/nir/nir_opt_algebraic.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/compiler/nir/nir_opt_algebraic.py b/src/compiler/nir/nir_opt_algebraic.py index ac53d77383d..e770a61d9ff 100644 --- a/src/compiler/nir/nir_opt_algebraic.py +++ b/src/compiler/nir/nir_opt_algebraic.py @@ -723,7 +723,7 @@ optimizations = [ 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()): +for left, right in itertools.combinations_with_replacement(invert.keys(), 2): optimizations.append((('inot', ('ior(is_used_once)', (left, a, b), (right, c, d))), ('iand', (invert[left], a, b), (invert[right], c, d)))) optimizations.append((('inot', ('iand(is_used_once)', (left, a, b), (right, c, d))), |