nir: Lower !f2b(x) to x == 0.0
authorIan Romanick <ian.d.romanick@intel.com>
Thu, 31 May 2018 19:56:00 +0000 (12:56 -0700)
committerIan Romanick <ian.d.romanick@intel.com>
Fri, 1 Jun 2018 17:14:53 +0000 (10:14 -0700)
commitf00fcfb7a2e137c7c0064b5e4167bb7fb49537a9
tree2d04722071db6e10a9c8f16da9389adfc52f96b1
parent619c51722b7978366f15a03bec6751327f2b4b65
nir: Lower !f2b(x) to x == 0.0

Some trivial help now, but it also prevents ~40 regressions caused by
Samuel's "nir: implement the GLSL equivalent of if simplication in
nir_opt_if" patch.

All Gen4+ platforms had similar results. (Skylake shown)
total instructions in shared programs: 14369557 -> 14369555 (<.01%)
instructions in affected programs: 442 -> 440 (-0.45%)
helped: 2
HURT: 0

total cycles in shared programs: 532425772 -> 532425743 (<.01%)
cycles in affected programs: 6086 -> 6057 (-0.48%)
helped: 2
HURT: 0

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
src/compiler/nir/nir_opt_algebraic.py