Mesa (master): pan/bi: Enable all nir_opt_move/sink optimizations

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Sat Apr 3 19:35:54 UTC 2021


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

Author: Alyssa Rosenzweig <alyssa at collabora.com>
Date:   Tue Mar  2 16:54:33 2021 +0000

pan/bi: Enable all nir_opt_move/sink optimizations

total instructions in shared programs: 116716 -> 116716 (0.00%)

total nops in shared programs: 86280 -> 84996 (-1.49%)
nops in affected programs: 50485 -> 49201 (-2.54%)
Nops are helped.

total clauses in shared programs: 20993 -> 20732 (-1.24%)
clauses in affected programs: 7737 -> 7476 (-3.37%)
Clauses are helped.

total quadwords in shared programs: 91697 -> 91155 (-0.59%)
quadwords in affected programs: 52123 -> 51581 (-1.04%)
Quadwords are helped.

total spills in shared programs: 0 -> 0
total fills in shared programs: 0 -> 0

Signed-off-by: Alyssa Rosenzweig <alyssa at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10020>

---

 src/panfrost/bifrost/bifrost_compile.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/panfrost/bifrost/bifrost_compile.c b/src/panfrost/bifrost/bifrost_compile.c
index e76fe4cd8a9..d41c17f3c42 100644
--- a/src/panfrost/bifrost/bifrost_compile.c
+++ b/src/panfrost/bifrost/bifrost_compile.c
@@ -2864,8 +2864,12 @@ bi_optimize_nir(nir_shader *nir)
 
         /* Backend scheduler is purely local, so do some global optimizations
          * to reduce register pressure */
-        NIR_PASS_V(nir, nir_opt_sink, nir_move_const_undef);
-        NIR_PASS_V(nir, nir_opt_move, nir_move_const_undef);
+        nir_move_options move_all =
+                nir_move_const_undef | nir_move_load_ubo | nir_move_load_input |
+                nir_move_comparisons | nir_move_copies | nir_move_load_ssbo;
+
+        NIR_PASS_V(nir, nir_opt_sink, move_all);
+        NIR_PASS_V(nir, nir_opt_move, move_all);
 
         NIR_PASS(progress, nir, nir_lower_load_const_to_scalar);
 



More information about the mesa-commit mailing list