broadcom/compiler: call nir_opt_gcm with a custom strategy
authorAlejandro Piñeiro <apinheiro@igalia.com>
Tue, 18 Oct 2022 12:25:14 +0000 (14:25 +0200)
committerMarge Bot <emma+marge@anholt.net>
Wed, 26 Oct 2022 12:29:30 +0000 (12:29 +0000)
commit019529aa118bf31413f6c76ee72586c1721d1396
tree97a9d49e5873481bc2e6ca94d8e242d0e03f9b07
parentafc6de356a5f7e15121e970d47f80c2d4c5ab9df
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>
src/broadcom/compiler/nir_to_vir.c
src/broadcom/compiler/v3d_compiler.h
src/broadcom/compiler/vir.c