Mesa (master): panfrost/midgard: Include shader size for shader-db

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Jul 10 13:47:53 UTC 2019


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

Author: Alyssa Rosenzweig <alyssa.rosenzweig at collabora.com>
Date:   Tue Jul  9 11:16:57 2019 -0700

panfrost/midgard: Include shader size for shader-db

It's easy to forget about, but shader size does matter for things like
i-cache, so let's include it in the analysis.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig at collabora.com>

---

 src/gallium/drivers/panfrost/midgard/midgard_compile.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/gallium/drivers/panfrost/midgard/midgard_compile.c b/src/gallium/drivers/panfrost/midgard/midgard_compile.c
index 1e09e46218c..a06318a5d93 100644
--- a/src/gallium/drivers/panfrost/midgard/midgard_compile.c
+++ b/src/gallium/drivers/panfrost/midgard/midgard_compile.c
@@ -2859,7 +2859,7 @@ midgard_compile_shader_nir(nir_shader *nir, midgard_program *program, bool is_bl
 		disassemble_midgard(program->compiled.data, program->compiled.size);
 
         if (midgard_debug & MIDGARD_DBG_SHADERDB) {
-                unsigned nr_bundles = 0, nr_ins = 0;
+                unsigned nr_bundles = 0, nr_ins = 0, nr_quadwords = 0;
 
                 /* Count instructions and bundles */
 
@@ -2870,6 +2870,8 @@ midgard_compile_shader_nir(nir_shader *nir, midgard_program *program, bool is_bl
                 mir_foreach_block(ctx, block) {
                         nr_bundles += util_dynarray_num_elements(
                                         &block->bundles, midgard_bundle);
+
+                        nr_quadwords += block->quadword_count;
                 }
 
                 /* Calculate thread count. There are certain cutoffs by
@@ -2885,11 +2887,11 @@ midgard_compile_shader_nir(nir_shader *nir, midgard_program *program, bool is_bl
                 /* Dump stats */
 
                 fprintf(stderr, "shader%d - %s shader: "
-                                "%u inst, %u bundles, "
+                                "%u inst, %u bundles, %u quadwords, "
                                 "%u registers, %u threads, %u loops\n",
                                 SHADER_DB_COUNT++,
                                 gl_shader_stage_name(ctx->stage),
-                                nr_ins, nr_bundles,
+                                nr_ins, nr_bundles, nr_quadwords,
                                 nr_registers, nr_threads,
                                 ctx->loop_count);
         }




More information about the mesa-commit mailing list