diff --git a/.pick_status.json b/.pick_status.json index 17937b1f22c..7fc56db986f 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -834,7 +834,7 @@ "description": "pan/bi: Run nir_lower_all_phis_to_scalar() 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 98a33b3784d..cdf7cc33522 100644 --- a/src/panfrost/compiler/bifrost_compile.c +++ b/src/panfrost/compiler/bifrost_compile.c @@ -6083,7 +6083,6 @@ bifrost_postprocess_nir(nir_shader *nir, unsigned gpu_id) NIR_PASS(_, nir, nir_lower_alu_width, bi_vectorize_filter, &gpu_id); NIR_PASS(_, nir, nir_lower_load_const_to_scalar); - NIR_PASS(_, nir, nir_lower_all_phis_to_scalar); NIR_PASS(_, nir, nir_lower_flrp, 16 | 32 | 64, false /* always_precise */); NIR_PASS(_, nir, nir_lower_var_copies); NIR_PASS(_, nir, nir_lower_alu); @@ -6587,6 +6586,17 @@ bifrost_compile_shader_nir(nir_shader *nir, bi_optimize_nir(nir, inputs->gpu_id, inputs->robust2_modes); + { + bool scalar_phis_pass = false; + unsigned gpu_id = inputs->gpu_id; + NIR_PASS(scalar_phis_pass, nir, nir_lower_phis_to_scalar, + bi_vectorize_filter, &gpu_id); + if (scalar_phis_pass) { + NIR_PASS(_, nir, nir_copy_prop); + NIR_PASS(_, nir, nir_opt_dce); + } + } + info->tls_size = nir->scratch_size; pan_nir_collect_varyings(nir, info, PAN_MEDIUMP_VARY_32BIT);