broadcom/compiler: move constants before their first user

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 <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15168>
This commit is contained in:
Iago Toral Quiroga 2022-02-21 13:03:54 +01:00 committed by Marge Bot
parent a1998a9f43
commit e228642cf5
1 changed files with 2 additions and 1 deletions

View File

@ -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);
}