intel/fs: Constant propagate into SHADER_OPCODE_SHUFFLE
authorIan Romanick <ian.d.romanick@intel.com>
Wed, 7 Jun 2023 17:57:47 +0000 (10:57 -0700)
committerMarge Bot <emma+marge@anholt.net>
Wed, 21 Jun 2023 17:16:57 +0000 (17:16 +0000)
commit5336cbff3bd0ac73cb03915bb2dad102f15d58a0
tree9a76cb661b4559f207cbbce54042069de79cf5de
parentb902fb2e14e56bdf914eb175489d3b53ff6fcda0
intel/fs: Constant propagate into SHADER_OPCODE_SHUFFLE

Code already exists to convert SHADER_OPCODE_SHUFFLE into a simple MOV
when either source is constant. However... the constants have to
actually get into those sources!

On a shader that I'm working on that multiplies very large matrices using
lots of subgroup operations,

-SIMD8 shader: 1378 instructions. 3 loops. 793896 cycles. 0:0 spills:fills, 23 sends, scheduled with mode non-lifo. Promoted 0 constants. Compacted 22048 to 21664 bytes (2%)
+SIMD8 shader: 346 instructions. 3 loops. 61742 cycles. 0:0 spills:fills, 23 sends, scheduled with mode top-down. Promoted 0 constants. Compacted 5536 to 5216 bytes (6%)

No changes in shader-db or fossil-db on any Intel platform.

v2: Merge a bunch of identical cases. Suggested by Ken.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com> [v1]
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23609>
src/intel/compiler/brw_fs_copy_propagation.cpp