Mesa (master): nir: Collapse more repeated bcsels on the same argument

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Sat Aug 4 08:12:21 UTC 2018


Module: Mesa
Branch: master
Commit: b92fded6eb6c4367813f2cb69a150fa9d3ce61f1
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=b92fded6eb6c4367813f2cb69a150fa9d3ce61f1

Author: Ian Romanick <ian.d.romanick at intel.com>
Date:   Wed Aug  1 09:58:19 2018 -0700

nir: Collapse more repeated bcsels on the same argument

All Gen platforms had pretty similar results. (Skylake shown)
total instructions in shared programs: 14277230 -> 14277220 (<.01%)
instructions in affected programs: 751 -> 741 (-1.33%)
helped: 4
HURT: 0
helped stats (abs) min: 2 max: 3 x̄: 2.50 x̃: 2
helped stats (rel) min: 1.23% max: 1.40% x̄: 1.32% x̃: 1.32%
95% mean confidence interval for instructions value: -3.42 -1.58
95% mean confidence interval for instructions %-change: -1.47% -1.17%
Instructions are helped.

total cycles in shared programs: 532577947 -> 532577908 (<.01%)
cycles in affected programs: 10641 -> 10602 (-0.37%)
helped: 4
HURT: 3
helped stats (abs) min: 1 max: 40 x̄: 13.75 x̃: 7
helped stats (rel) min: 0.11% max: 3.08% x̄: 1.10% x̃: 0.60%
HURT stats (abs)   min: 2 max: 8 x̄: 5.33 x̃: 6
HURT stats (rel)   min: 0.13% max: 0.55% x̄: 0.30% x̃: 0.23%
95% mean confidence interval for cycles value: -20.69 9.55
95% mean confidence interval for cycles %-change: -1.63% 0.63%
Inconclusive result (value mean confidence interval includes 0).

Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
Reviewed-by: Thomas Helland <thomashelland90 at gmail.com>
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 fdd1af9d17..388c6354ff 100644
--- a/src/compiler/nir/nir_opt_algebraic.py
+++ b/src/compiler/nir/nir_opt_algebraic.py
@@ -235,6 +235,7 @@ optimizations = [
    (('~bcsel', ('fge', b, a), b, a), ('fmax', a, b)),
    (('bcsel', ('inot', a), b, c), ('bcsel', a, c, b)),
    (('bcsel', a, ('bcsel', a, b, c), d), ('bcsel', a, b, d)),
+   (('bcsel', a, b, ('bcsel', a, c, d)), ('bcsel', a, b, d)),
    (('bcsel', a, True, 'b at bool'), ('ior', a, b)),
    (('fmin', a, a), a),
    (('fmax', a, a), a),




More information about the mesa-commit mailing list