From ef6f5377daa58010ae882cf4abecabf3a31fa7e2 Mon Sep 17 00:00:00 2001 From: Georg Lehmann Date: Fri, 27 Feb 2026 14:02:17 +0100 Subject: [PATCH] nir/opt_algebraic: remove fcmp+fneg patterns that are cleaned up earlier No Foz-DB changes, as expected. Reviewed-by: Alyssa Rosenzweig Part-of: --- src/compiler/nir/nir_opt_algebraic.py | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/src/compiler/nir/nir_opt_algebraic.py b/src/compiler/nir/nir_opt_algebraic.py index d56820bad0a..54044c91a69 100644 --- a/src/compiler/nir/nir_opt_algebraic.py +++ b/src/compiler/nir/nir_opt_algebraic.py @@ -798,31 +798,23 @@ optimizations.extend([ # inot(a) (('fge', 0.0, ('b2f', 'a@1')), ('inot', a)), - (('fge', ('fneg', ('b2f', 'a@1')), 0.0), ('inot', a)), - (('fneu', ('fadd', ('b2f', 'a@1'), ('b2f', 'b@1')), 0.0), ('ior', a, b)), (('fneu', ('b2f', 'a@1'), ('fneg', ('b2f', 'b@1'))), ('ior', a, b)), (('fneu', ('fadd', ('b2f', 'a@1'), ('fneg', ('b2f', 'b@1'))), 0.0), ('ixor', a, b)), (('fneu', ('b2f', 'a@1') , ('b2f', 'b@1') ), ('ixor', a, b)), - (('fneu', ('fneg', ('b2f', 'a@1')), ('fneg', ('b2f', 'b@1'))), ('ixor', a, b)), (('feq', ('fadd', ('b2f', 'a@1'), ('b2f', 'b@1')), 0.0), ('inot', ('ior', a, b))), (('feq', ('b2f', 'a@1'), ('fneg', ('b2f', 'b@1'))), ('inot', ('ior', a, b))), (('feq', ('fadd', ('b2f', 'a@1'), ('fneg', ('b2f', 'b@1'))), 0.0), ('ieq', a, b)), (('feq', ('b2f', 'a@1') , ('b2f', 'b@1') ), ('ieq', a, b)), - (('feq', ('fneg', ('b2f', 'a@1')), ('fneg', ('b2f', 'b@1'))), ('ieq', a, b)), - # -(b2f(a) + b2f(b)) < 0 # 0 < b2f(a) + b2f(b) # 0 != b2f(a) + b2f(b) b2f must be 0 or 1, so the sum is non-negative # a || b - (('flt', ('fneg', ('fadd', ('b2f', 'a@1'), ('b2f', 'b@1'))), 0.0), ('ior', a, b)), (('flt', 0.0, ('fadd', ('b2f', 'a@1'), ('b2f', 'b@1'))), ('ior', a, b)), - # -(b2f(a) + b2f(b)) >= 0 # 0 >= b2f(a) + b2f(b) # 0 == b2f(a) + b2f(b) b2f must be 0 or 1, so the sum is non-negative # !(a || b) - (('fge', ('fneg', ('fadd', ('b2f', 'a@1'), ('b2f', 'b@1'))), 0.0), ('inot', ('ior', a, b))), (('fge', 0.0, ('fadd', ('b2f', 'a@1'), ('b2f', 'b@1'))), ('inot', ('ior', a, b))), (('flt', a, ('fneg', a)), ('flt', a, 0.0)), @@ -915,7 +907,6 @@ optimizations.extend([ (('flt', ('fadd(is_used_once)', a, ('fneg', b)), 0.0), ('flt', a, b)), - (('fge', ('fneg', ('fabs', a)), 0.0), ('feq', a, 0.0)), (('bcsel(is_only_used_as_float_nsz)', ('flt(nnan)', b, a), b, a), ('fmin(preserve_nan_inf)', a, b)), (('bcsel(is_only_used_as_float_nsz)', ('flt(nnan)', a, b), b, a), ('fmax(preserve_nan_inf)', a, b)), (('bcsel(is_only_used_as_float_nsz)', ('fge(nnan)', a, b), b, a), ('fmin(preserve_nan_inf)', a, b)), @@ -1652,7 +1643,6 @@ optimizations.extend([ (('fmax', ('fadd', ('b2f', 'a@1'), ('fneg', ('b2f', 'b@1'))), 0.0), ('b2f', ('iand', a, ('inot', b)))), (('iand', 'a@bool16', 1.0), ('b2f', a)), (('iand', 'a@bool32', 1.0), ('b2f', a)), - (('flt', ('fneg', ('b2f', 'a@1')), 0), a), # Generated by TGSI KILL_IF. # Comparison with the same args. Note that these are only done for the # float versions when the source must be a number. Generally, NaN cmp NaN # produces the opposite result of X cmp X. flt is the outlier. NaN < NaN