radv: move a few passes to after load/store vectorization

load/store vectorization can create 8/16-bit alu to do packing/unpacking,
which would make shader_info::bit_sizes_used out of date.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4791>
diff --git a/src/amd/vulkan/radv_pipeline.c b/src/amd/vulkan/radv_pipeline.c
index fdeeffd..7585829 100644
--- a/src/amd/vulkan/radv_pipeline.c
+++ b/src/amd/vulkan/radv_pipeline.c
@@ -3101,9 +3101,6 @@
 		if (nir[i]) {
 			radv_start_feedback(stage_feedbacks[i]);
 
-			/* do this again since information such as outputs_read can be out-of-date */
-			nir_shader_gather_info(nir[i], nir_shader_get_entrypoint(nir[i]));
-
 			if (!radv_use_llvm_for_stage(device, i)) {
 				NIR_PASS_V(nir[i], nir_lower_non_uniform_access,
 				           nir_lower_non_uniform_ubo_access |
@@ -3113,8 +3110,6 @@
 			}
 			NIR_PASS_V(nir[i], nir_lower_memory_model);
 
-			radv_lower_io(device, nir[i]);
-
 			bool lower_to_scalar = false;
 			bool lower_pack = false;
 			nir_variable_mode robust_modes = (nir_variable_mode)0;
@@ -3135,6 +3130,11 @@
 				lower_pack = true;
 			}
 
+			/* do this again since information such as outputs_read can be out-of-date */
+			nir_shader_gather_info(nir[i], nir_shader_get_entrypoint(nir[i]));
+
+			radv_lower_io(device, nir[i]);
+
 			lower_to_scalar |= nir_opt_shrink_vectors(nir[i]);
 
 			if (lower_to_scalar)