i915/corm: add shrink_vectors to reduce cross-register vec construction

nir_opt_shrink_vectors narrows vector widths when only a subset of
components are consumed, which eliminates unnecessary cross-register
vec constructions. Follow with copy_prop + dce to clean up.

shader-db (I915_FS=nir): 272/403 compiled, 4388 alu
shader-db (I915_FS=both): nir won 272 (26 identical, 1 tied, 239 better, 6 only),
  18 TGSI, 113 neither

Assisted-by: Claude
This commit is contained in:
Adam Jackson 2026-05-07 14:51:48 -04:00
parent 6e38f519e0
commit ca9f95f783

View file

@ -765,6 +765,9 @@ i915_create_fs_state(struct pipe_context *pipe,
NIR_PASS(_, nir_s, nir_opt_algebraic);
NIR_PASS(_, nir_s, nir_opt_algebraic_late);
NIR_PASS(_, nir_s, nir_opt_dce);
NIR_PASS(_, nir_s, nir_opt_shrink_vectors, false);
NIR_PASS(_, nir_s, nir_opt_copy_prop);
NIR_PASS(_, nir_s, nir_opt_dce);
nir_index_ssa_defs(nir_shader_get_entrypoint(nir_s));
for (unsigned v = 0; v < ARRAY_SIZE(corm_variants); v++) {