pan/bi: Print program size in shader-db
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Sat, 6 Feb 2021 01:25:39 +0000 (20:25 -0500)
committerMarge Bot <eric+marge@anholt.net>
Mon, 8 Feb 2021 14:07:29 +0000 (14:07 +0000)
Less critical than other metrics, but still matters for instruction
cache hit rate, and worth being aware of.

And, fine, it makes the scheduler look like a bigger win on another
axis.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8354>

src/panfrost/bifrost/bifrost_compile.c

index 26961abc3b8057ca1bb2fdc2f51a4318410da870..dec62645875c02806c2adc3d553289d7adc17afa 100644 (file)
@@ -2242,7 +2242,7 @@ emit_cf_list(bi_context *ctx, struct exec_list *list)
 /* shader-db stuff */
 
 static void
-bi_print_stats(bi_context *ctx, FILE *fp)
+bi_print_stats(bi_context *ctx, unsigned size, FILE *fp)
 {
         unsigned nr_clauses = 0, nr_tuples = 0, nr_ins = 0;
 
@@ -2276,14 +2276,14 @@ bi_print_stats(bi_context *ctx, FILE *fp)
 
         fprintf(stderr, "shader%d:%s - %s shader: "
                         "%u inst, %u nops, %u clauses, "
-                        "%u threads, %u loops, "
+                        "%u quadwords, %u threads, %u loops, "
                         "%u:%u spills:fills\n",
                         SHADER_DB_COUNT++,
                         ctx->nir->info.label ?: "",
                         ctx->is_blend ? "PAN_SHADER_BLEND" :
                         gl_shader_stage_name(ctx->stage),
                         nr_ins, nr_nops, nr_clauses,
-                        nr_threads,
+                        size / 16, nr_threads,
                         ctx->loop_count,
                         ctx->spills, ctx->fills);
 }
@@ -2639,7 +2639,7 @@ bifrost_compile_shader_nir(void *mem_ctx, nir_shader *nir,
 
         if ((bifrost_debug & BIFROST_DBG_SHADERDB || inputs->shaderdb) &&
             !skip_internal) {
-                bi_print_stats(ctx, stderr);
+                bi_print_stats(ctx, program->compiled.size, stderr);
         }
 
         ralloc_free(ctx);