From cbc42abdb3c0a4c2cb6cd618d47c59aaa021939a Mon Sep 17 00:00:00 2001 From: Mary Guillemard Date: Tue, 4 Mar 2025 10:12:40 +0100 Subject: [PATCH] pan/bi: Run bifrost_nir_lower_algebraic_late while there is progress With v11 needing specific lowering, we now need to run it multiple time to ensure every new instructions materialized aren't invalid. Signed-off-by: Mary Guillemard Reviewed-by: Benjamin Lee Part-of: --- src/panfrost/compiler/bifrost_compile.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/panfrost/compiler/bifrost_compile.c b/src/panfrost/compiler/bifrost_compile.c index 635c4de716c..d1005802b4b 100644 --- a/src/panfrost/compiler/bifrost_compile.c +++ b/src/panfrost/compiler/bifrost_compile.c @@ -5177,8 +5177,13 @@ bi_optimize_nir(nir_shader *nir, unsigned gpu_id, bool is_blend) NIR_PASS(progress, nir, nir_lower_bool_to_bitsize); /* Prepass to simplify instruction selection */ - late_algebraic = false; - NIR_PASS(late_algebraic, nir, bifrost_nir_lower_algebraic_late, pan_arch(gpu_id)); + bool late_algebraic_progress = true; + while (late_algebraic_progress) { + late_algebraic_progress = false; + NIR_PASS(late_algebraic_progress, nir, bifrost_nir_lower_algebraic_late, + pan_arch(gpu_id)); + late_algebraic |= late_algebraic_progress; + } while (late_algebraic) { late_algebraic = false;