nir/algebraic: Add more extract_[iu](8|16) optimizations
authorJason Ekstrand <jason.ekstrand@intel.com>
Tue, 14 Aug 2018 19:37:39 +0000 (14:37 -0500)
committerJason Ekstrand <jason.ekstrand@intel.com>
Wed, 29 Aug 2018 19:04:02 +0000 (14:04 -0500)
commit4dd5263663585b55119e49c8dfade015c86aff1a
tree9b88bd636f74f3fe7c536dbed1248ec7d1d604f5
parent116b47fe3c0395e95b67c6bd3506ab7d6a83393e
nir/algebraic: Add more extract_[iu](8|16) optimizations

This adds the "(a << N) >> M" family of mask or sign-extensions.  Not a
huge win right now but this pattern will soon be generated by NIR format
lowering code.

Shader-db results on Kaby Lake:

    total instructions in shared programs: 15166918 -> 15166916 (<.01%)
    instructions in affected programs: 36 -> 34 (-5.56%)
    helped: 2
    HURT: 0

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/compiler/nir/nir_opt_algebraic.py