diff --git a/src/asahi/compiler/agx_compile.c b/src/asahi/compiler/agx_compile.c index 2def3f0b8e0..207f22f133a 100644 --- a/src/asahi/compiler/agx_compile.c +++ b/src/asahi/compiler/agx_compile.c @@ -2897,6 +2897,11 @@ link_libagx(nir_shader *nir, const nir_shader *libagx) nir_link_shader_functions(nir, libagx); NIR_PASS(_, nir, nir_inline_functions); nir_remove_non_entrypoints(nir); + NIR_PASS(_, nir, nir_opt_deref); + NIR_PASS(_, nir, nir_lower_vars_to_ssa); + NIR_PASS(_, nir, nir_remove_dead_derefs); + NIR_PASS(_, nir, nir_remove_dead_variables, + nir_var_function_temp | nir_var_shader_temp, NULL); NIR_PASS(_, nir, nir_lower_vars_to_explicit_types, nir_var_shader_temp | nir_var_function_temp | nir_var_mem_shared | nir_var_mem_global, diff --git a/src/asahi/lib/agx_nir_lower_gs.c b/src/asahi/lib/agx_nir_lower_gs.c index e5edc8a5afe..13456810fd0 100644 --- a/src/asahi/lib/agx_nir_lower_gs.c +++ b/src/asahi/lib/agx_nir_lower_gs.c @@ -1021,6 +1021,7 @@ link_libagx(nir_shader *nir, const nir_shader *libagx) NIR_PASS(_, nir, nir_inline_functions); nir_remove_non_entrypoints(nir); NIR_PASS(_, nir, nir_lower_indirect_derefs, nir_var_function_temp, 64); + NIR_PASS(_, nir, nir_opt_dce); NIR_PASS(_, nir, nir_lower_vars_to_explicit_types, nir_var_shader_temp | nir_var_function_temp | nir_var_mem_shared | nir_var_mem_global,