[Mesa-dev] [PATCH V2 4/4] nir: add a couple of ior opts to nir_opt_algebraic

Jason Ekstrand jason at jlekstrand.net
Mon Jul 16 14:27:34 UTC 2018


Reviewed-by: Jason Ekstrand <jason at jlekstrand.net>

On Sun, Jul 15, 2018 at 10:19 PM Timothy Arceri <tarceri at itsqueeze.com>
wrote:

> One of these was seen in a Deus Ex shader.
>
> V2: make opts more generic.
>
> Cc: Jason Ekstrand <jason at jlekstrand.net>
> ---
>  src/compiler/nir/nir_opt_algebraic.py | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/src/compiler/nir/nir_opt_algebraic.py
> b/src/compiler/nir/nir_opt_algebraic.py
> index 0986dde6851..a9c2d821d7d 100644
> --- a/src/compiler/nir/nir_opt_algebraic.py
> +++ b/src/compiler/nir/nir_opt_algebraic.py
> @@ -286,6 +286,9 @@ optimizations = [
>     (('iand', ('uge(is_used_once)', a, b), ('uge', a, c)), ('uge', a,
> ('umax', b, c))),
>     (('iand', ('uge(is_used_once)', a, c), ('uge', b, c)), ('uge',
> ('umin', a, b), c)),
>
> +   (('ior', 'a at bool', ('ieq', a, False)), True),
> +   (('ior', 'a at bool', ('inot', a)), True),
> +
>     (('iand', ('ieq', 'a at 32', 0), ('ieq', 'b at 32', 0)), ('ieq', ('ior',
> 'a at 32', 'b at 32'), 0)),
>
>     # These patterns can result when (a < b || a < c) => (a < min(b, c))
> --
> 2.17.1
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20180716/4ddf2201/attachment.html>


More information about the mesa-dev mailing list