broadcom/compiler: choose compile strategy with lowest spilling
authorIago Toral Quiroga <itoral@igalia.com>
Fri, 4 Feb 2022 10:54:53 +0000 (11:54 +0100)
committerMarge Bot <emma+marge@anholt.net>
Fri, 18 Feb 2022 08:38:19 +0000 (08:38 +0000)
commit919aedbfecff1ed3bf48784b6650e23f82e566eb
tree961019a3a6bef3e5f05d90d7aa60bdd747952f3c
parent294a357b3368a28ee753045222adda408e9c2a0d
broadcom/compiler: choose compile strategy with lowest spilling

Until now we would only allow spilling as a last resort in the
last 2 strategies, however, it is possible that in some cases
earlier strategies may produce less spills if we allowed spilling
on them.

Likewise, the fallback scheduler can sometimes produce less spills
than 2 threads with optimizations disabled.

With this change, we start allowing all our 2-thread strategies to
spill, and instead of choosing the first strategy that is successful,
we choose the one that doesn't spill or the one with the least amount
of spilling.

It should be noted that this may incur in a significant increase
of compile times. We will address this in a follow-up patch.

Reviewed-by: Alejandro PiƱeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15041>
src/broadcom/compiler/nir_to_vir.c
src/broadcom/compiler/vir.c