Skip to content

intel/compiler: Avoid copy propagating large registers into EOT messages

Kenneth Graunke requested to merge kwg/mesa:split-send-eot-fix into main

EOT messages need to use g112-g127 for their sources. With the new opt_split_sends pass, we may be constructing an EOT message from two different registers, and be able to copy propagate the original values into those SENDs.

This can cause problems if we copy propagate from a large register (say an RGBA value which is 4 GRFs in SIMD8 or 8 GRFs in SIMD16), in a situation where the SEND only read a subset of that (say the alpha value out of an RGBA texturing result). g112-127 can only hold 16 registers worth of data, and sometimes we can only use g112-126. So, we can't propagate if the GRFs in question are larger than 15 GRFs.

Fixes a shader validation failure in Alan Wake.

shader-db on Icelake shows that only SIMD32 programs are affected, and the results are pretty negligable:

total instructions in shared programs: 19615228 -> 19615269 (<.01%) instructions in affected programs: 10702 -> 10743 (0.38%) helped: 1 / HURT: 43 / largest change: +/- 2 instructions

total cycles in shared programs: 852001706 -> 852001566 (<.01%) cycles in affected programs: 767098 -> 766958 (-0.02%) helped: 68 / HURT: 64 / largest change: +/- 774 cycles

GAINED: 2 / LOST: 0

Fixes: 589b03d0 ("intel/fs: Opportunistically split SEND message payloads")

Merge request reports