[Mesa-dev] [PATCH 13/22] nir: Pull b2f out of bcsel

Samuel Iglesias Gonsálvez siglesias at igalia.com
Tue Feb 27 11:25:09 UTC 2018


Reviewed-by: Samuel Iglesias Gonsálvez <siglesias at igalia.com>


On 24/02/18 00:55, Ian Romanick wrote:
> From: Ian Romanick <ian.d.romanick at intel.com>
>
> All platforms had similar results. (Skylake shown)
> total instructions in shared programs: 14516592 -> 14516586 (<.01%)
> instructions in affected programs: 500 -> 494 (-1.20%)
> helped: 2
> HURT: 0
>
> total cycles in shared programs: 533167044 -> 533166998 (<.01%)
> cycles in affected programs: 6988 -> 6942 (-0.66%)
> helped: 2
> HURT: 0
>
> Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
> ---
>  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 0069516..65211e6 100644
> --- a/src/compiler/nir/nir_opt_algebraic.py
> +++ b/src/compiler/nir/nir_opt_algebraic.py
> @@ -372,6 +372,7 @@ optimizations = [
>     (('bcsel at 32', a, -0.0, -1.0), ('fneg', ('b2f', ('inot', a)))),
>     (('bcsel', True, b, c), b),
>     (('bcsel', False, b, c), c),
> +   (('bcsel', a, ('b2f(is_used_once)', b), ('b2f', c)), ('b2f', ('bcsel', a, b, c))),
>     # The result of this should be hit by constant propagation and, in the
>     # next round of opt_algebraic, get picked up by one of the above two.
>     (('bcsel', '#a', b, c), ('bcsel', ('ine', 'a', 0), b, c)),

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20180227/d454973e/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: OpenPGP digital signature
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20180227/d454973e/attachment.sig>


More information about the mesa-dev mailing list