Mesa (master): radv: Move nir_opt_shrink_vectors() into the opt loop.

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Aug 20 17:16:03 UTC 2020


Module: Mesa
Branch: master
Commit: b3c822a0a8665ae84452208e94006f7df802f196
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=b3c822a0a8665ae84452208e94006f7df802f196

Author: Eric Anholt <eric at anholt.net>
Date:   Wed Aug 19 09:16:15 2020 -0700

radv: Move nir_opt_shrink_vectors() into the opt loop.

Upcoming changes to opt_undef will result in this pass doing more work and
generating vector MOVs that need re-scalarizing (which is inside of the
main opt loop).

Reviewed-by: Rhys Perry <pendingchaos02 at gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6054>

---

 src/amd/vulkan/radv_shader.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/amd/vulkan/radv_shader.c b/src/amd/vulkan/radv_shader.c
index 16253979b08..03cfe993beb 100644
--- a/src/amd/vulkan/radv_shader.c
+++ b/src/amd/vulkan/radv_shader.c
@@ -278,13 +278,13 @@ radv_optimize_nir(struct nir_shader *shader, bool optimize_conservatively,
                 }
 
                 NIR_PASS(progress, shader, nir_opt_undef);
+                NIR_PASS(progress, shader, nir_opt_shrink_vectors);
                 if (shader->options->max_unroll_iterations) {
                         NIR_PASS(progress, shader, nir_opt_loop_unroll, 0);
                 }
         } while (progress && !optimize_conservatively);
 
 	NIR_PASS(progress, shader, nir_opt_conditional_discard);
-        NIR_PASS(progress, shader, nir_opt_shrink_vectors);
         NIR_PASS(progress, shader, nir_opt_move, nir_move_load_ubo);
 }
 



More information about the mesa-commit mailing list