aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIan Romanick <[email protected]>2020-03-05 18:03:35 -0800
committerMarge Bot <[email protected]>2020-03-18 20:36:29 +0000
commit4e3d69ad07d9c439fc99b7c1b1e999ce556d260f (patch)
tree8a0e462cd0134764351af829b6ed21ce34c720a0
parente0cefc5a23a62b0bcf77db469adf1d0eb9ff8165 (diff)
nir/algebraic: Simplify a contradiction that can occur in __flt64_nonnan
The pattern is added to opt_algebraic because, for example, comparisons with constant 0.0 will produce (a1 < 0). Even with a pass that optimized Boolean expressions, I think this would be very difficult to automatically recognize and optimize. Results on the 308 shaders extracted from the fp64 portion of the OpenGL CTS: Tiger Lake and Ice Lake had similar results. (Tiger Lake shown) total instructions in shared programs: 933054 -> 929619 (-0.37%) instructions in affected programs: 784041 -> 780606 (-0.44%) helped: 59 HURT: 0 helped stats (abs) min: 2 max: 213 x̄: 58.22 x̃: 44 helped stats (rel) min: 0.02% max: 2.51% x̄: 0.72% x̃: 0.46% 95% mean confidence interval for instructions value: -70.80 -45.64 95% mean confidence interval for instructions %-change: -0.92% -0.53% Instructions are helped. total cycles in shared programs: 7304712 -> 7280180 (-0.34%) cycles in affected programs: 7176260 -> 7151728 (-0.34%) helped: 92 HURT: 0 helped stats (abs) min: 8 max: 1414 x̄: 266.65 x̃: 166 helped stats (rel) min: 0.04% max: 2.34% x̄: 0.43% x̃: 0.22% 95% mean confidence interval for cycles value: -333.05 -200.26 95% mean confidence interval for cycles %-change: -0.54% -0.31% Cycles are helped. Regular shader-db changes: No changes on any Intel platform. Reviewed-by: Jason Ekstrand <[email protected]> Reviewed-by: Matt Turner <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4142>
-rw-r--r--src/compiler/nir/nir_opt_algebraic.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/compiler/nir/nir_opt_algebraic.py b/src/compiler/nir/nir_opt_algebraic.py
index 5cbb9e7c3c2..7d9775950a4 100644
--- a/src/compiler/nir/nir_opt_algebraic.py
+++ b/src/compiler/nir/nir_opt_algebraic.py
@@ -942,6 +942,7 @@ optimizations.extend([
(('ilt', 'a(is_lt_zero)', 'b(is_not_negative)'), True),
(('ult', 0, 'a(is_gt_zero)'), True),
+ (('ult', a, 0), False),
# Packing and then unpacking does nothing
(('unpack_64_2x32_split_x', ('pack_64_2x32_split', a, b)), a),