jay: improve vector affinities

Totals:
Instrs: 2807558 -> 2805545 (-0.07%); split: -0.10%, +0.02%
CodeSize: 45051504 -> 45015888 (-0.08%); split: -0.11%, +0.03%

Totals from 631 (23.84% of 2647) affected shaders:
Instrs: 736113 -> 734100 (-0.27%); split: -0.37%, +0.10%
CodeSize: 11666608 -> 11630992 (-0.31%); split: -0.42%, +0.12%

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40960>
This commit is contained in:
Alyssa Rosenzweig 2026-04-13 15:25:43 -04:00 committed by Marge Bot
parent dd6efffb47
commit 10fbfe1f65

View file

@ -1615,7 +1615,10 @@ jay_register_allocate_function(jay_function *f)
jay_foreach_inst_in_func(f, block, I) {
jay_foreach_src_index(I, s, c, index) {
if (jay_num_values(I->src[s]) > 1) {
/* We check repr==0 to try to coalesce with the first vector use, as
* the closest to the definition. This heuristic reduces shuffling.
*/
if (jay_num_values(I->src[s]) > 1 && !ra.affinities[index].repr) {
uint32_t repr = UINT_MAX, repr_c = 0;
/* Pick the representative with the smallest index, as it most