[Mesa-dev] [PATCH 1/4] nir: add inot algebraic opt

Matt Turner mattst88 at gmail.com
Mon Jul 16 07:24:37 UTC 2018


On Sun, Jul 15, 2018 at 7:26 PM, Timothy Arceri <tarceri at itsqueeze.com> wrote:
> Noticed in a unigine shader.
> ---
>  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 5e07d662b07..0986dde6851 100644
> --- a/src/compiler/nir/nir_opt_algebraic.py
> +++ b/src/compiler/nir/nir_opt_algebraic.py
> @@ -223,6 +223,7 @@ optimizations = [
>     (('bcsel', ('inot', a), b, c), ('bcsel', a, c, b)),
>     (('bcsel', a, ('bcsel', a, b, c), d), ('bcsel', a, b, d)),
>     (('bcsel', a, True, 'b at bool'), ('ior', a, b)),
> +   (('inot', ('bcsel', a, ('inot', b), c)), ('bcsel', a, b, ('inot', c))),

Shouldn't we have an equivalent rule for the other argument, like

+   (('inot', ('bcsel', a, b, ('inot', c))), ('bcsel', a, ('inot', b), c)),

I assume we would not benefit from a general rule that simply
propagates inot inside to both b and c unconditionally.


More information about the mesa-dev mailing list