r600/sfn: run cleanup passes after late algebraic opt

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18970>
This commit is contained in:
Gert Wollny 2022-10-09 18:08:18 +02:00 committed by Marge Bot
parent cfc6bdb760
commit aea311dbef

View file

@ -795,8 +795,18 @@ int r600_shader_from_nir(struct r600_context *rctx,
while (optimize_once(sh));
NIR_PASS_V(sh, nir_lower_bool_to_int32);
NIR_PASS_V(sh, nir_opt_algebraic_late);
bool late_algebraic_progress;
do
{
late_algebraic_progress = false;
NIR_PASS(late_algebraic_progress, sh, nir_opt_algebraic_late);
NIR_PASS(late_algebraic_progress, sh, nir_opt_constant_folding);
NIR_PASS(late_algebraic_progress, sh, nir_copy_prop);
NIR_PASS(late_algebraic_progress, sh, nir_opt_dce);
NIR_PASS(late_algebraic_progress, sh, nir_opt_cse);
} while (late_algebraic_progress);
NIR_PASS_V(sh, nir_lower_bool_to_int32);
if (sh->info.stage == MESA_SHADER_FRAGMENT)
r600::sort_fsoutput(sh);