nir: recombine nir_op_*sub when lower_sub = false
authorDaniel Schürmann <daniel@schuermann.dev>
Wed, 25 Sep 2019 14:20:09 +0000 (16:20 +0200)
committerDaniel Schürmann <daniel@schuermann.dev>
Mon, 30 Sep 2019 09:44:10 +0000 (09:44 +0000)
commit99848a57b7563c988f58ddcdf1fd040980d0bfe3
tree3f99e406c599a2bf2144d2fe9c9c7a1cf2ecbd1f
parent10e508c8156785e6481bff37b3446c347aa56fea
nir: recombine nir_op_*sub when lower_sub = false

There are some optimizations which are only implemented for additions
and some optimizations which assume that subtractions have been lowered.
By lowering all subtractions first and later recombine for backends
which prefer this option, we don't have to implement them twice.

This patch also moves lower_negate to nir_opt_algebraic_late() to enable
these optimizations for backends which make use of it.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
src/compiler/nir/nir_opt_algebraic.py