broadcom/compiler: use nir_opt_uub
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run

Shows performance improvement on aztec/aztec_high

fps_avg  helped:  gl_aztec.trace:       6.37 -> 6.45 (1.26%)
fps_avg  helped:  gl_aztec_high.trace:  4.29 -> 4.33 (0.93%)

And a significant instruction count reduction in the affected
shaders. But some shaders show a huge reduction.

gles_aztec/274.shader_test MESA_SHADER_COMPUTE: 1375 -> 1196 (-13.02%)
gles_aztec_high/499.shader_test MESA_SHADER_COMPUTE: 1375 -> 1196 (-13.02%)
master-of-orion/1253.shader_test MESA_SHADER_FRAGMENT: 305 -> 262 (-14.10%)
blender/7.shader_test MESA_SHADER_FRAGMENT: 12389 -> 10455 (-15.61%)
master-of-orion/1256.shader_test MESA_SHADER_VERTEX: 170 -> 131 (-22.94%)

total instructions in shared programs: 14679696 -> 14675496 (-0.03%)
instructions in affected programs: 196683 -> 192483 (-2.14%)
helped: 430
HURT: 8
Instructions are helped.

total uniforms in shared programs: 6775582 -> 6775495 (<.01%)
uniforms in affected programs: 21155 -> 21068 (-0.41%)
helped: 48
HURT: 2
Uniforms are helped.

total max-temps in shared programs: 2709673 -> 2709710 (<.01%)
max-temps in affected programs: 403 -> 440 (9.18%)
helped: 2
HURT: 16
Max-temps are HURT.

Signed-off-by: Jose Maria Casanova Crespo <jmcasanova@igalia.com>
Reviewed-by: Jose Maria Casanova Crespo <jmcasanova@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38642>
This commit is contained in:
Iago Toral Quiroga 2025-11-13 09:48:01 +01:00 committed by Marge Bot
parent 4234e7eed0
commit a643681dd5

View file

@ -2269,6 +2269,9 @@ v3d_optimize_nir(struct v3d_compile *c, struct nir_shader *s)
NIR_PASS(progress, s, v3d_nir_lower_algebraic, c);
NIR_PASS(progress, s, nir_opt_cse);
nir_opt_uub_options uub_options = {.opt_imul = true};
NIR_PASS(progress, s, nir_opt_uub, &uub_options);
nir_move_options sink_opts =
nir_move_const_undef | nir_move_comparisons | nir_move_copies |
nir_move_load_ubo | nir_move_load_ssbo | nir_move_load_uniform;