nir/algebraic: Add a couple optimizations for iabs and ishr
authorJason Ekstrand <jason.ekstrand@intel.com>
Sun, 10 Mar 2019 15:06:56 +0000 (10:06 -0500)
committerJason Ekstrand <jason@jlekstrand.net>
Fri, 15 Mar 2019 01:02:19 +0000 (01:02 +0000)
commit2b76de9b5dd58c444c194d4c77ef9d9643ae5ca6
tree05a96c9a8ec208860e57d5b140e4960311aec4bc
parent0803bef00675ddd90ca9365b733b222dbb58c373
nir/algebraic: Add a couple optimizations for iabs and ishr

Shader-db results on Kaby Lake:

    total instructions in shared programs: 15225213 -> 15222365 (-0.02%)
    instructions in affected programs: 43524 -> 40676 (-6.54%)
    helped: 203
    HURT: 0

Lots of shaders in Shadow Warrior had this pattern along with Deus Ex,
Civ, Shadow of Mordor, and several others.

Reviewed-by: Kristian H. Kristensen <hoegsberg@chromium.org>
src/compiler/nir/nir_opt_algebraic.py