From dec34e880d0ce2792ecdac18d28e3e3be4dec72f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Tue, 12 Nov 2019 23:41:23 -0500 Subject: [PATCH] radeonsi/nir: call nir_lower_flrp only once per shader Reviewed-by: Timothy Arceri --- src/gallium/drivers/radeonsi/si_shader_nir.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/gallium/drivers/radeonsi/si_shader_nir.c b/src/gallium/drivers/radeonsi/si_shader_nir.c index c11032ba800..9a7bc54cad0 100644 --- a/src/gallium/drivers/radeonsi/si_shader_nir.c +++ b/src/gallium/drivers/radeonsi/si_shader_nir.c @@ -805,10 +805,6 @@ static void si_nir_opts(struct nir_shader *nir) { bool progress; - unsigned lower_flrp = - (nir->options->lower_flrp16 ? 16 : 0) | - (nir->options->lower_flrp32 ? 32 : 0) | - (nir->options->lower_flrp64 ? 64 : 0); do { progress = false; @@ -839,7 +835,12 @@ si_nir_opts(struct nir_shader *nir) NIR_PASS(progress, nir, nir_opt_algebraic); NIR_PASS(progress, nir, nir_opt_constant_folding); - if (lower_flrp != 0) { + 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); + assert(lower_flrp); bool lower_flrp_progress = false; NIR_PASS(lower_flrp_progress, nir, nir_lower_flrp, @@ -855,7 +856,7 @@ si_nir_opts(struct nir_shader *nir) /* Nothing should rematerialize any flrps, so we only * need to do this lowering once. */ - lower_flrp = 0; + nir->info.flrp_lowered = true; } NIR_PASS(progress, nir, nir_opt_undef); -- 2.30.2