From 1e522e7d750fd8a1be7ab65eae2dadfc499cbd08 Mon Sep 17 00:00:00 2001 From: Georg Lehmann Date: Tue, 11 Feb 2025 16:23:53 +0100 Subject: [PATCH] nir/opt_algebraic: optimize dxbc boolean not MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Foz-DB Navi21: Totals from 237 (0.30% of 79377) affected shaders: Instrs: 486690 -> 486146 (-0.11%); split: -0.11%, +0.00% CodeSize: 2629516 -> 2626052 (-0.13%); split: -0.13%, +0.00% VGPRs: 18744 -> 18736 (-0.04%) Latency: 7404763 -> 7399806 (-0.07%); split: -0.07%, +0.01% InvThroughput: 1800282 -> 1798388 (-0.11%); split: -0.11%, +0.00% VClause: 12101 -> 12106 (+0.04%); split: -0.01%, +0.05% Copies: 34225 -> 34170 (-0.16%); split: -0.21%, +0.05% PreSGPRs: 14634 -> 14639 (+0.03%) PreVGPRs: 16713 -> 16706 (-0.04%) VALU: 317523 -> 316693 (-0.26%); split: -0.26%, +0.00% SALU: 53814 -> 54097 (+0.53%); split: -0.38%, +0.90% Reviewed-by: Ian Romanick Reviewed-by: Alyssa Rosenzweig Reviewed-by: Timur Kristóf Part-of: --- src/compiler/nir/nir_opt_algebraic.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/compiler/nir/nir_opt_algebraic.py b/src/compiler/nir/nir_opt_algebraic.py index 299dddf627d..23348965eec 100644 --- a/src/compiler/nir/nir_opt_algebraic.py +++ b/src/compiler/nir/nir_opt_algebraic.py @@ -1473,6 +1473,8 @@ optimizations.extend([ (('bcsel', a, ('ineg', ('b2i', 'b@1')), -1), ('ineg', ('b2i', ('bcsel', a, b, True)))), (('bcsel', a, 0, ('ineg', ('b2i', 'b@1'))), ('ineg', ('b2i', ('bcsel', a, False, b)))), (('bcsel', a, -1, ('ineg', ('b2i', 'b@1'))), ('ineg', ('b2i', ('bcsel', a, True, b)))), + + (('inot', ('ineg', ('b2i', a))), ('ineg', ('b2i', ('inot', a)))), ]) for op in ('ior', 'iand', 'ixor'):