From 5336cbff3bd0ac73cb03915bb2dad102f15d58a0 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Wed, 7 Jun 2023 10:57:47 -0700 Subject: [PATCH] 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 [v1] Reviewed-by: Kenneth Graunke Part-of: --- src/intel/compiler/brw_fs_copy_propagation.cpp | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/src/intel/compiler/brw_fs_copy_propagation.cpp b/src/intel/compiler/brw_fs_copy_propagation.cpp index 56e852a..9b14b25 100644 --- a/src/intel/compiler/brw_fs_copy_propagation.cpp +++ b/src/intel/compiler/brw_fs_copy_propagation.cpp @@ -1086,23 +1086,12 @@ fs_visitor::try_constant_propagate(fs_inst *inst, acp_entry *entry) case SHADER_OPCODE_TYPED_SURFACE_WRITE_LOGICAL: case SHADER_OPCODE_BYTE_SCATTERED_WRITE_LOGICAL: case SHADER_OPCODE_BYTE_SCATTERED_READ_LOGICAL: - inst->src[i] = val; - progress = true; - break; - case FS_OPCODE_UNIFORM_PULL_CONSTANT_LOAD: case SHADER_OPCODE_BROADCAST: - inst->src[i] = val; - progress = true; - break; - case BRW_OPCODE_MAD: case BRW_OPCODE_LRP: - inst->src[i] = val; - progress = true; - break; - case FS_OPCODE_PACK_HALF_2x16_SPLIT: + case SHADER_OPCODE_SHUFFLE: inst->src[i] = val; progress = true; break; -- 2.7.4