From 0109cfc760e48b0f19e7c7ab01bace403c545ce3 Mon Sep 17 00:00:00 2001 From: Faith Ekstrand Date: Fri, 6 Feb 2026 00:26:04 -0500 Subject: [PATCH] pan/bi: Run lower_alu_width after opt_algebraic_late It can generate extract instructions which we expect to be scalar. Cc: mesa-stable Reviewed-by: Christoph Pillmayer (cherry picked from commit deb9244436995070b25954f2e1d09c1114dc79b4) Part-of: --- .pick_status.json | 2 +- src/panfrost/compiler/bifrost_compile.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.pick_status.json b/.pick_status.json index a81f8591b51..aff15c2a801 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -874,7 +874,7 @@ "description": "pan/bi: Run lower_alu_width after opt_algebraic_late", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null, "notes": null diff --git a/src/panfrost/compiler/bifrost_compile.c b/src/panfrost/compiler/bifrost_compile.c index e29708c9ec1..bd6c5f849a3 100644 --- a/src/panfrost/compiler/bifrost_compile.c +++ b/src/panfrost/compiler/bifrost_compile.c @@ -5544,6 +5544,7 @@ bi_optimize_nir(nir_shader *nir, unsigned gpu_id, nir_variable_mode robust2_mode while (late_algebraic) { late_algebraic = false; NIR_PASS(late_algebraic, nir, nir_opt_algebraic_late); + NIR_PASS(_, nir, nir_lower_alu_width, bi_vectorize_filter, &gpu_id); NIR_PASS(_, nir, nir_opt_constant_folding); NIR_PASS(_, nir, nir_copy_prop); NIR_PASS(_, nir, nir_opt_dce); @@ -5570,6 +5571,7 @@ bi_optimize_nir(nir_shader *nir, unsigned gpu_id, nir_variable_mode robust2_mode while (late_algebraic) { late_algebraic = false; NIR_PASS(late_algebraic, nir, nir_opt_algebraic_late); + NIR_PASS(_, nir, nir_lower_alu_width, bi_vectorize_filter, &gpu_id); NIR_PASS(_, nir, nir_opt_constant_folding); NIR_PASS(_, nir, nir_copy_prop); NIR_PASS(_, nir, nir_opt_dce);