mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 05:18:08 +02:00
pan/bi: Run CSE after lowering FAU
Lowering FAU can add moves from uniforms. If a uniform is moved out to a register mulitple times in a basic block, these moves can be CSE'd, saving instructions at the cost of register pressure. 854 shaders in my shader-db are helped on cycle count (average 2.94% reduction in cycles). Only 9 shaders have hurt thread count, and there is no change in spills or fills. Overall, this seems to be a win. Prevents instruction count regressions from the next commit. total instructions in shared programs: 2454423 -> 2444690 (-0.40%) instructions in affected programs: 386274 -> 376541 (-2.52%) helped: 2105 HURT: 0 helped stats (abs) min: 1.0 max: 116.0 x̄: 4.62 x̃: 2 helped stats (rel) min: 0.04% max: 27.27% x̄: 3.64% x̃: 1.92% 95% mean confidence interval for instructions value: -4.91 -4.33 95% mean confidence interval for instructions %-change: -3.83% -3.45% Instructions are helped. total tuples in shared programs: 1963534 -> 1957106 (-0.33%) tuples in affected programs: 233562 -> 227134 (-2.75%) helped: 1491 HURT: 117 helped stats (abs) min: 1.0 max: 63.0 x̄: 4.44 x̃: 2 helped stats (rel) min: 0.04% max: 24.53% x̄: 4.39% x̃: 2.59% HURT stats (abs) min: 1.0 max: 5.0 x̄: 1.61 x̃: 1 HURT stats (rel) min: 0.18% max: 8.33% x̄: 1.44% x̃: 1.05% 95% mean confidence interval for tuples value: -4.28 -3.71 95% mean confidence interval for tuples %-change: -4.20% -3.73% Tuples are helped. total clauses in shared programs: 387848 -> 387079 (-0.20%) clauses in affected programs: 13718 -> 12949 (-5.61%) helped: 583 HURT: 60 helped stats (abs) min: 1.0 max: 16.0 x̄: 1.42 x̃: 1 helped stats (rel) min: 1.11% max: 25.00% x̄: 8.28% x̃: 6.67% HURT stats (abs) min: 1.0 max: 1.0 x̄: 1.00 x̃: 1 HURT stats (rel) min: 0.86% max: 20.00% x̄: 4.58% x̃: 4.00% 95% mean confidence interval for clauses value: -1.29 -1.10 95% mean confidence interval for clauses %-change: -7.57% -6.58% Clauses are helped. total cycles in shared programs: 201866.21 -> 201682.92 (-0.09%) cycles in affected programs: 6241.79 -> 6058.50 (-2.94%) helped: 952 HURT: 98 helped stats (abs) min: 0.04166399999999726 max: 2.625 x̄: 0.20 x̃: 0 helped stats (rel) min: 0.12% max: 26.00% x̄: 4.05% x̃: 2.38% HURT stats (abs) min: 0.041665999999999315 max: 0.16666700000000034 x̄: 0.07 x̃: 0 HURT stats (rel) min: 0.18% max: 8.70% x̄: 1.60% x̃: 1.43% 95% mean confidence interval for cycles value: -0.19 -0.16 95% mean confidence interval for cycles %-change: -3.80% -3.24% Cycles are helped. total arith in shared programs: 74924.00 -> 74660.12 (-0.35%) arith in affected programs: 9303.67 -> 9039.79 (-2.84%) helped: 1513 HURT: 118 helped stats (abs) min: 0.04166399999999726 max: 2.625 x̄: 0.18 x̃: 0 helped stats (rel) min: 0.07% max: 33.33% x̄: 4.68% x̃: 2.67% HURT stats (abs) min: 0.041665999999999315 max: 0.16666800000000137 x̄: 0.07 x̃: 0 HURT stats (rel) min: 0.18% max: 8.70% x̄: 1.55% x̃: 1.37% 95% mean confidence interval for arith value: -0.17 -0.15 95% mean confidence interval for arith %-change: -4.48% -3.98% Arith are helped. total quadwords in shared programs: 1757254 -> 1751978 (-0.30%) quadwords in affected programs: 197399 -> 192123 (-2.67%) helped: 1464 HURT: 110 helped stats (abs) min: 1.0 max: 51.0 x̄: 3.73 x̃: 2 helped stats (rel) min: 0.04% max: 21.95% x̄: 4.16% x̃: 2.52% HURT stats (abs) min: 1.0 max: 7.0 x̄: 1.71 x̃: 1 HURT stats (rel) min: 0.21% max: 13.04% x̄: 1.65% x̃: 0.93% 95% mean confidence interval for quadwords value: -3.58 -3.13 95% mean confidence interval for quadwords %-change: -3.97% -3.53% Quadwords are helped. total threads in shared programs: 52899 -> 52890 (-0.02%) threads in affected programs: 18 -> 9 (-50.00%) helped: 0 HURT: 9 HURT stats (abs) min: 1.0 max: 1.0 x̄: 1.00 x̃: 1 HURT stats (rel) min: 50.00% max: 50.00% x̄: 50.00% x̃: 50.00% 95% mean confidence interval for threads value: -1.00 -1.00 95% mean confidence interval for threads %-change: -50.00% -50.00% Threads are HURT. Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15239>
This commit is contained in:
parent
c8f644ec44
commit
e7cfe18099
1 changed files with 4 additions and 0 deletions
|
|
@ -4068,6 +4068,10 @@ bi_compile_variant_nir(nir_shader *nir,
|
|||
bi_print_shader(ctx, stdout);
|
||||
bi_lower_fau(ctx);
|
||||
|
||||
/* Lowering FAU can create redundant moves. Run CSE+DCE to clean up. */
|
||||
bi_opt_cse(ctx);
|
||||
bi_opt_dead_code_eliminate(ctx);
|
||||
|
||||
/* Analyze before register allocation to avoid false dependencies. The
|
||||
* skip bit is a function of only the data flow graph and is invariant
|
||||
* under valid scheduling. */
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue