glsl: Move flrp lowering out of the loop

Other lower_flrp Intel platforms had similar shader-db changes.

Lunar Lake
total instructions in shared programs: 17131619 -> 17131182 (<.01%)
instructions in affected programs: 59924 -> 59487 (-0.73%)
helped: 255 / HURT: 9

total loops in shared programs: 5336 -> 5334 (-0.04%)
loops in affected programs: 4 -> 2 (-50.00%)
helped: 2 / HURT: 0

total cycles in shared programs: 888274988 -> 888269628 (<.01%)
cycles in affected programs: 1753370 -> 1748010 (-0.31%)
helped: 182 / HURT: 94

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12526>
This commit is contained in:
Ian Romanick 2025-11-26 11:51:32 -08:00 committed by Marge Bot
parent 4bbc29373a
commit 92e609f4fe

View file

@ -102,23 +102,6 @@ gl_nir_opts(nir_shader *nir)
NIR_PASS(progress, nir, nir_opt_algebraic);
NIR_PASS(progress, nir, nir_opt_constant_folding);
if (!nir->info.flrp_lowered) {
unsigned lower_flrp =
(nir->options->lower_flrp16 ? 16 : 0) |
(nir->options->lower_flrp32 ? 32 : 0) |
(nir->options->lower_flrp64 ? 64 : 0);
if (lower_flrp) {
NIR_PASS(progress, nir, nir_lower_flrp,
lower_flrp, false /* always_precise */);
}
/* Nothing should rematerialize any flrps, so we only need to do this
* lowering once.
*/
nir->info.flrp_lowered = true;
}
NIR_PASS(progress, nir, nir_opt_undef);
peephole_select_options = (nir_opt_peephole_select_options){
@ -133,6 +116,16 @@ gl_nir_opts(nir_shader *nir)
}
} while (progress);
unsigned lower_flrp =
(nir->options->lower_flrp16 ? 16 : 0) |
(nir->options->lower_flrp32 ? 32 : 0) |
(nir->options->lower_flrp64 ? 64 : 0);
if (lower_flrp) {
NIR_PASS(progress, nir, nir_lower_flrp,
lower_flrp, false /* always_precise */);
}
NIR_PASS(_, nir, nir_lower_var_copies);
}