Mesa (master): nir/algebraic: Add missing ffma(-1, a, b) pattern
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Tue May 14 18:34:57 UTC 2019
Module: Mesa
Branch: master
Commit: a7724b1cbbf8f2517e542043e443433dad1eb791
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=a7724b1cbbf8f2517e542043e443433dad1eb791
Author: Ian Romanick <ian.d.romanick at intel.com>
Date: Fri May 10 10:20:02 2019 -0700
nir/algebraic: Add missing ffma(-1, a, b) pattern
All Gen7+ platforms had similar results. (Ice Lake shown)
total instructions in shared programs: 17229439 -> 17229377 (<.01%)
instructions in affected programs: 9859 -> 9797 (-0.63%)
helped: 41
HURT: 0
helped stats (abs) min: 1 max: 6 x̄: 1.51 x̃: 1
helped stats (rel) min: 0.08% max: 11.54% x̄: 1.65% x̃: 0.67%
95% mean confidence interval for instructions value: -1.88 -1.14
95% mean confidence interval for instructions %-change: -2.48% -0.81%
Instructions are helped.
total cycles in shared programs: 360944145 -> 360942989 (<.01%)
cycles in affected programs: 178167 -> 177011 (-0.65%)
helped: 36
HURT: 19
helped stats (abs) min: 1 max: 222 x̄: 38.03 x̃: 5
helped stats (rel) min: 0.01% max: 31.01% x̄: 4.01% x̃: 0.45%
HURT stats (abs) min: 1 max: 34 x̄: 11.21 x̃: 6
HURT stats (rel) min: 0.03% max: 2.74% x̄: 0.72% x̃: 0.50%
95% mean confidence interval for cycles value: -36.01 -6.02
95% mean confidence interval for cycles %-change: -4.18% -0.57%
Cycles are helped.
Reviewed-by: Jason Ekstrand <jason at jlekstrand.net>
---
src/compiler/nir/nir_opt_algebraic.py | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/compiler/nir/nir_opt_algebraic.py b/src/compiler/nir/nir_opt_algebraic.py
index b64bef07412..837ac5fd6bf 100644
--- a/src/compiler/nir/nir_opt_algebraic.py
+++ b/src/compiler/nir/nir_opt_algebraic.py
@@ -121,6 +121,7 @@ optimizations = [
(('~ffma', 0.0, a, b), b),
(('~ffma', a, b, 0.0), ('fmul', a, b)),
(('ffma', 1.0, a, b), ('fadd', a, b)),
+ (('ffma', -1.0, a, b), ('fadd', ('fneg', a), b)),
(('~flrp', a, b, 0.0), a),
(('~flrp', a, b, 1.0), b),
(('~flrp', a, a, b), a),
More information about the mesa-commit
mailing list