intel/compiler: Don't use SIMD larger than needed for workgroup

Unless we are combining multiple workgroups in the same HW thread,
there's no advantage of using SIMD16 when SIMD8 already fits the
entire workgroup.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13249>
This commit is contained in:
Caio Marcelo de Oliveira Filho
2021-10-07 20:18:39 -07:00
committed by Marge Bot
parent 4e7b71e00c
commit 3072e6e0da
2 changed files with 12 additions and 8 deletions

View File

@@ -93,7 +93,13 @@ brw_simd_should_compile(void *mem_ctx,
return false;
}
/* TODO: Ignore SIMD larger than workgroup if previous SIMD already passed. */
if (simd > 0 && test_bit(prog_data->prog_mask, simd - 1) &&
workgroup_size <= (width / 2)) {
*error = ralloc_asprintf(
mem_ctx, "SIMD%u skipped because workgroup size %u already fits in SIMD%u",
width, workgroup_size, width / 2);
return false;
}
if (DIV_ROUND_UP(workgroup_size, width) > max_threads) {
*error = ralloc_asprintf(