From e772a4f3fd77c553e84417b8b8f07ccddc723ffb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Mon, 30 Dec 2024 04:15:39 -0500 Subject: [PATCH] radeonsi: use nir_opt_move MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit TOTALS FROM AFFECTED SHADERS (35064/58359) - ACO Spilled SGPRs: 446 -> 402 (-9.87 %) Code Size: 56827400 -> 56672948 (-0.27 %) bytes Max Waves: 548680 -> 549799 (0.20 %) Reviewed-by: Timur Kristóf Part-of: --- src/gallium/drivers/radeonsi/si_shader.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/gallium/drivers/radeonsi/si_shader.c b/src/gallium/drivers/radeonsi/si_shader.c index c5da53a18c5..1dae1bdcab6 100644 --- a/src/gallium/drivers/radeonsi/si_shader.c +++ b/src/gallium/drivers/radeonsi/si_shader.c @@ -2674,6 +2674,13 @@ static struct nir_shader *si_get_nir_shader(struct si_shader *shader, struct si_ NIR_PASS(progress, nir, nir_opt_sink, nir_move_const_undef | nir_move_copies | nir_move_alu | nir_move_comparisons | nir_move_load_ubo | nir_move_load_ssbo); + NIR_PASS(progress, nir, nir_opt_move, + nir_move_const_undef | nir_move_copies | nir_move_alu | nir_move_comparisons | + nir_move_load_ubo); + /* Run nir_opt_move again to make sure that comparisons are as close as possible to the first + * use to prevent SCC spilling. + */ + NIR_PASS(progress, nir, nir_opt_move, nir_move_comparisons); /* aco only accept scalar const, must be done after si_nir_late_opts() * which may generate vec const.