nir/algebraic: Optimize some extract forms resulting from 8-bit lowering
authorIan Romanick <ian.d.romanick@intel.com>
Wed, 27 Jan 2021 03:51:57 +0000 (19:51 -0800)
committerMarge Bot <eric+marge@anholt.net>
Wed, 18 Aug 2021 22:03:37 +0000 (22:03 +0000)
commita147717a93d912df7aa25cde2bdfd869eb67843d
treeb74bee97dd4f0b17334c4944707ee4754de69fc2
parentf9665040f19d826f7932a2996ac46c69aea7e624
nir/algebraic: Optimize some extract forms resulting from 8-bit lowering

This eliminates some spurious, size-converting moves.  For example, on
Ice Lake this helps dEQP-VK.spirv_assembly.type.vec3.i8.bitwise_xor_frag:

SIMD8 shader: 56 instructions. 1 loops. 4444 cycles. 0:0 spills:fills, 5 sends
SIMD8 shader: 52 instructions. 1 loops. 4164 cycles. 0:0 spills:fills, 5 sends

v2: Condition two of the patterns on !options->lower_extract_byte.
Suggested by Lionel.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9025>
src/compiler/nir/nir_opt_algebraic.py