nir/algebraic: Add helpers and a rule involving wrapping
authorCaio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Wed, 12 Jun 2019 23:48:21 +0000 (16:48 -0700)
committerCaio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Wed, 26 Jun 2019 21:13:02 +0000 (14:13 -0700)
commit085c0f1f13ca14e8d91c9dec64debcd95334389d
treefb44a2094775883bc1142b1b90947390f0c65394
parent5a143965b8f4119501e973d15f7f72673b3ce416
nir/algebraic: Add helpers and a rule involving wrapping

The helpers are needed so we can use the syntax `instr(cond)` in the
algebraic rules.  Add simple rule for dropping a pair of mul-div of
the same value when wrapping is guaranteed to not happen.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
src/compiler/nir/nir_opt_algebraic.py
src/compiler/nir/nir_search_helpers.h