From 54ce78c4e1233e83656e5743ad4c637981737db3 Mon Sep 17 00:00:00 2001 From: Mary Guillemard Date: Tue, 4 Mar 2025 10:12:39 +0100 Subject: [PATCH] pan/bi: Run nir_lower_bit_size after algebraic nir_opt_algebraic can possibly materialize instructions with a bit_size that need to be lowerd. Signed-off-by: Mary Guillemard Reviewed-by: Benjamin Lee Part-of: --- src/panfrost/compiler/bifrost_compile.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/panfrost/compiler/bifrost_compile.c b/src/panfrost/compiler/bifrost_compile.c index a770b4dde04..635c4de716c 100644 --- a/src/panfrost/compiler/bifrost_compile.c +++ b/src/panfrost/compiler/bifrost_compile.c @@ -5152,6 +5152,9 @@ bi_optimize_nir(nir_shader *nir, unsigned gpu_id, bool is_blend) * KHR-GLES31.core.shader_image_load_store.basic-allTargets-atomicFS */ NIR_PASS(progress, nir, nir_lower_int64); + /* Algebraic can materialize instructions with a bit_size that we need to lower */ + NIR_PASS(progress, nir, nir_lower_bit_size, bi_lower_bit_size, &gpu_id); + /* We need to cleanup after each iteration of late algebraic * optimizations, since otherwise NIR can produce weird edge cases * (like fneg of a constant) which we don't handle */