Mesa (master): ir3, tu: Run optimization loop twice

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Sep 29 16:35:33 UTC 2020


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

Author: Connor Abbott <cwabbott0 at gmail.com>
Date:   Mon Jul  6 18:26:14 2020 +0200

ir3, tu: Run optimization loop twice

This call to ir3_optimize_nir() mirrors what st/mesa does for us in
Gallium, and will be necessary for cross-stage linking and the multiview
lowering.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6515>

---

 src/freedreno/ir3/ir3_nir.c      | 2 +-
 src/freedreno/ir3/ir3_nir.h      | 1 +
 src/freedreno/vulkan/tu_shader.c | 2 ++
 3 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/freedreno/ir3/ir3_nir.c b/src/freedreno/ir3/ir3_nir.c
index f33f048a505..9b406166007 100644
--- a/src/freedreno/ir3/ir3_nir.c
+++ b/src/freedreno/ir3/ir3_nir.c
@@ -153,7 +153,7 @@ ir3_get_compiler_options(struct ir3_compiler *compiler)
 
 #define OPT_V(nir, pass, ...) NIR_PASS_V(nir, pass, ##__VA_ARGS__)
 
-static void
+void
 ir3_optimize_loop(nir_shader *s)
 {
 	bool progress;
diff --git a/src/freedreno/ir3/ir3_nir.h b/src/freedreno/ir3/ir3_nir.h
index 4126d4e4868..e9fe495767b 100644
--- a/src/freedreno/ir3/ir3_nir.h
+++ b/src/freedreno/ir3/ir3_nir.h
@@ -52,6 +52,7 @@ void ir3_nir_lower_tess_eval(nir_shader *shader, unsigned topology);
 void ir3_nir_lower_gs(nir_shader *shader);
 
 const nir_shader_compiler_options * ir3_get_compiler_options(struct ir3_compiler *compiler);
+void ir3_optimize_loop(nir_shader *s);
 void ir3_finalize_nir(struct ir3_compiler *compiler, nir_shader *s);
 void ir3_nir_post_finalize(struct ir3_compiler *compiler, nir_shader *s);
 void ir3_nir_lower_variant(struct ir3_shader_variant *so, nir_shader *s);
diff --git a/src/freedreno/vulkan/tu_shader.c b/src/freedreno/vulkan/tu_shader.c
index 7c671de0138..f0d2e50d8a6 100644
--- a/src/freedreno/vulkan/tu_shader.c
+++ b/src/freedreno/vulkan/tu_shader.c
@@ -175,6 +175,8 @@ tu_spirv_to_nir(struct tu_device *dev,
 
    NIR_PASS_V(nir, nir_lower_frexp);
 
+   ir3_optimize_loop(nir);
+
    return nir;
 }
 



More information about the mesa-commit mailing list