radv: call nir_lower_vars_to_ssa later
authorDaniel Schürmann <daniel@schuermann.dev>
Tue, 4 Jan 2022 09:59:07 +0000 (09:59 +0000)
committerMarge Bot <emma+marge@anholt.net>
Tue, 10 May 2022 22:20:54 +0000 (22:20 +0000)
Totals from 599 (0.44% of 134913) affected shaders: (GFX10.3)
CodeSize: 1243732 -> 1240512 (-0.26%); split: -0.26%, +0.00%
Instrs: 223370 -> 222702 (-0.30%); split: -0.30%, +0.00%
Latency: 901762 -> 885446 (-1.81%); split: -1.81%, +0.00%
InvThroughput: 305546 -> 305536 (-0.00%)
SClause: 12690 -> 12554 (-1.07%); split: -1.13%, +0.06%
Copies: 23779 -> 23778 (-0.00%)
PreSGPRs: 17781 -> 17829 (+0.27%)

Acked-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5668>

src/amd/vulkan/radv_shader.c

index 6d446e3..707d8d7 100644 (file)
@@ -153,8 +153,6 @@ radv_optimize_nir(struct nir_shader *shader, bool optimize_conservatively, bool
       NIR_PASS(progress, shader, nir_split_array_vars, nir_var_function_temp);
       NIR_PASS(progress, shader, nir_shrink_vec_array_vars, nir_var_function_temp);
 
-      NIR_PASS_V(shader, nir_lower_vars_to_ssa);
-
       if (allow_copies) {
          /* Only run this pass in the first call to
           * radv_optimize_nir.  Later calls assume that we've
@@ -166,6 +164,7 @@ radv_optimize_nir(struct nir_shader *shader, bool optimize_conservatively, bool
 
       NIR_PASS(progress, shader, nir_opt_copy_prop_vars);
       NIR_PASS(progress, shader, nir_opt_dead_write_vars);
+      NIR_PASS_V(shader, nir_lower_vars_to_ssa);
 
       NIR_PASS_V(shader, nir_lower_alu_to_scalar, NULL, NULL);
       NIR_PASS_V(shader, nir_lower_phis_to_scalar, true);