broadcom/compiler: call nir_opt_gcm with a custom strategy

nir_opt_gcm get us worse shader-db stats, but that is expected. But we
want to prevent to get worse values on spill/fills. Analyzing the
outcome with shader-db, this mostly happen with shaders that are
already complex, and are already spilling/filling.

So the best option here is adding a new strategy, that fall backs if
we get spill/fill using nir_opt_gcm.

It is not clear in which order we should disable gcm. For now we
disable it before loop unrolling.

We get a slight performance gain (in average) using nir_opt_gcm.

We don't show the shaderdb stats, as they are worse, but as mentioned,
this is expected.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17185>
This commit is contained in:
Alejandro Piñeiro
2022-10-18 14:25:14 +02:00
committed by Marge Bot
parent afc6de356a
commit 019529aa11
3 changed files with 42 additions and 20 deletions

View File

@@ -721,6 +721,14 @@ struct v3d_compile {
bool disable_loop_unrolling;
bool unrolled_any_loops;
/* Disables nir_opt_gcm to reduce register pressure. */
bool disable_gcm;
/* If calling nir_opt_gcm made any progress. Used to skip new rebuilds
* if possible
*/
bool gcm_progress;
/* Disables scheduling of general TMU loads (and unfiltered image load).
*/
bool disable_general_tmu_sched;