asahi: optimize more when linking libagx

Otherwise we get spurious scratch from lower_vars_to_explicit_types on dead
vars.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27616>
This commit is contained in:
Alyssa Rosenzweig
2024-01-08 16:58:11 -04:00
committed by Marge Bot
parent 9287bec892
commit 1ee9b8b668
2 changed files with 6 additions and 0 deletions
+5
View File
@@ -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,
+1
View File
@@ -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,