From 5b140428b062ae22945d203a3ae6e51f85b68512 Mon Sep 17 00:00:00 2001 From: Iago Toral Quiroga Date: Mon, 7 Mar 2022 14:47:55 +0100 Subject: [PATCH] broadcom/compiler: adjust register threshold for 2-thread compiles MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit We have twice the registers in this case so it makes sense to double this as well. While this causes slight regressions in shader-db stats (due to additional register pressure), it helps us hide latency of memory reads better on 2-thread compiles, where the thread switch mechanism will be less effective. This shows a ~3% performance improvement on the UE4 SunTemple demo. total instructions in shared programs: 12642413 -> 12656164 (0.11%) instructions in affected programs: 2272652 -> 2286403 (0.61%) helped: 2924 HURT: 3389 total uniforms in shared programs: 3703861 -> 3704776 (0.02%) uniforms in affected programs: 213729 -> 214644 (0.43%) helped: 823 HURT: 1272 total max-temps in shared programs: 2150686 -> 2153505 (0.13%) max-temps in affected programs: 191332 -> 194151 (1.47%) helped: 1900 HURT: 1891 total spills in shared programs: 3255 -> 3274 (0.58%) spills in affected programs: 166 -> 185 (11.45%) helped: 3 HURT: 6 total fills in shared programs: 4630 -> 4656 (0.56%) fills in affected programs: 367 -> 393 (7.08%) helped: 7 HURT: 15 Reviewed-by: Alejandro Piñeiro Part-of: --- src/broadcom/compiler/vir.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/broadcom/compiler/vir.c b/src/broadcom/compiler/vir.c index 60dcc38a..4992a7f 100644 --- a/src/broadcom/compiler/vir.c +++ b/src/broadcom/compiler/vir.c @@ -1595,7 +1595,7 @@ v3d_attempt_compile(struct v3d_compile *c) /* Schedule for about half our register space, to enable more * shaders to hit 4 threads. */ - .threshold = 24, + .threshold = c->threads == 4 ? 24 : 48, /* Vertex shaders share the same memory for inputs and outputs, * fragement and geometry shaders do not. -- 2.7.4