From e228642cf50ef850c94cab2efb69aa0b5f9dba7c Mon Sep 17 00:00:00 2001 From: Iago Toral Quiroga Date: Mon, 21 Feb 2022 13:03:54 +0100 Subject: [PATCH] broadcom/compiler: move constants before their first user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit For us they are basically uniforms too so we want to make their lifespans short to facilitate allocating them to accumulators. total instructions in shared programs: 13043585 -> 13015385 (-0.22%) instructions in affected programs: 8326040 -> 8297840 (-0.34%) helped: 24939 HURT: 19894 total threads in shared programs: 415860 -> 415858 (<.01%) threads in affected programs: 4 -> 2 (-50.00%) helped: 0 HURT: 1 total uniforms in shared programs: 3721953 -> 3720451 (-0.04%) uniforms in affected programs: 96134 -> 94632 (-1.56%) helped: 744 HURT: 435 total max-temps in shared programs: 2173431 -> 2154260 (-0.88%) max-temps in affected programs: 264598 -> 245427 (-7.25%) helped: 10858 HURT: 841 total spills in shared programs: 4005 -> 4010 (0.12%) spills in affected programs: 700 -> 705 (0.71%) helped: 5 HURT: 10 total fills in shared programs: 5801 -> 5817 (0.28%) fills in affected programs: 1346 -> 1362 (1.19%) helped: 6 HURT: 11 Reviewed-by: Alejandro PiƱeiro Part-of: --- src/broadcom/compiler/vir.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/broadcom/compiler/vir.c b/src/broadcom/compiler/vir.c index b11fdf9b095..d649989230e 100644 --- a/src/broadcom/compiler/vir.c +++ b/src/broadcom/compiler/vir.c @@ -1568,7 +1568,8 @@ v3d_attempt_compile(struct v3d_compile *c) if (!c->disable_constant_ubo_load_sorting) NIR_PASS_V(c->s, v3d_nir_sort_constant_ubo_loads, c); - NIR_PASS_V(c->s, nir_opt_move, nir_move_load_uniform); + NIR_PASS_V(c->s, nir_opt_move, nir_move_load_uniform | + nir_move_const_undef); v3d_nir_to_vir(c); }