On Tue, Jan 16, 2018 at 04:44:42PM -0800, Ian Romanick wrote:
> From: Ian Romanick <[email protected]>
>
> shader-db results:
>
> Skylake and Broadwell had similar results (Skylake shown)
> total instructions in shared programs: 14526033 -> 14526021 (<.01%)
> instructions in affected programs: 1450 -> 1438 (-0.83%)
> helped: 12
> HURT: 0
> helped stats (abs) min: 1 max: 1 x̄: 1.00 x̃: 1
> helped stats (rel) min: 0.68% max: 0.86% x̄: 0.83% x̃: 0.86%
>
> total cycles in shared programs: 533121762 -> 533118710 (<.01%)
> cycles in affected programs: 75423 -> 72371 (-4.05%)
> helped: 11
> HURT: 1
> helped stats (abs) min: 60 max: 300 x̄: 278.18 x̃: 300
> helped stats (rel) min: 1.15% max: 4.42% x̄: 4.09% x̃: 4.42%
> HURT stats (abs) min: 8 max: 8 x̄: 8.00 x̃: 8
> HURT stats (rel) min: 0.46% max: 0.46% x̄: 0.46% x̃: 0.46%
>
> Haswell, Ivy Bridge and Sandy Bridge had similar results (Haswell shown).
> total cycles in shared programs: 409473831 -> 409472382 (<.01%)
> cycles in affected programs: 46203 -> 44754 (-3.14%)
> helped: 12
> HURT: 2
> helped stats (abs) min: 1 max: 140 x̄: 121.75 x̃: 140
> helped stats (rel) min: 0.07% max: 4.01% x̄: 3.41% x̃: 4.01%
> HURT stats (abs) min: 4 max: 8 x̄: 6.00 x̃: 6
> HURT stats (rel) min: 0.17% max: 0.45% x̄: 0.31% x̃: 0.31%
> abs t: 3.56, p: 0.39%
> rel t: 3.19, p: 0.78%
> Positive result.
>
> No changes on GM45 or Iron Lake.
>
> Signed-off-by: Ian Romanick <[email protected]>
> ---
> src/compiler/nir/nir_opt_algebraic.py | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/src/compiler/nir/nir_opt_algebraic.py
> b/src/compiler/nir/nir_opt_algebraic.py
> index 09538ba..cb690d3 100644
> --- a/src/compiler/nir/nir_opt_algebraic.py
> +++ b/src/compiler/nir/nir_opt_algebraic.py
> @@ -205,6 +205,13 @@ optimizations = [
> (('~ior', ('fge', a, '#b'), ('fge', a, '#c')), ('fge', a, ('fmin', b,
> c))),
> (('~ior', ('fge', '#a', c), ('fge', '#b', c)), ('fge', ('fmax', a, b),
> c)),
>
> + # These patterns can result when (a < b || a < c) => (a < min(b, c))
> + # transformations occur before constant propagation and loop-unrolling.
> + (('~flt', a, ('fmax', b, a)), ('flt', a, b)),
> + (('~flt', ('fmin', a, b), a), ('flt', b, a)),
> + (('~fge', a, ('fmin', b, a)), True),
> + (('~fge', ('fmax', a, b), a), True),
> +
Hello Ian,
Inspired by the lines above, I try to add:
+ (('~flt', a, ('fmin', b, a)), False),
+ (('~flt', ('fmax', a, b), a), False),
Using my shader-db I've got the following results (KabyLake processor):
total instructions in shared programs: 12973560 -> 12973510 (-0.00%)
instructions in affected programs: 514 -> 464 (-9.73%)
helped: 2
HURT: 0
total cycles in shared programs: 513052691 -> 513051607 (-0.00%)
cycles in affected programs: 20638 -> 19554 (-5.25%)
helped: 2
HURT: 0
You can probably add these 2 lines. ;)
> (('fabs', ('slt', a, b)), ('slt', a, b)),
> (('fabs', ('sge', a, b)), ('sge', a, b)),
> (('fabs', ('seq', a, b)), ('seq', a, b)),
> --
> 2.9.5
>
> _______________________________________________
> mesa-dev mailing list
> [email protected]
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
_______________________________________________
mesa-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-dev