panfrost/midgard: Include loop count for shader-db

We have to emit it anyway for the report to be happy (with respect to
unrolling), so return an actual count rather than dummy numbers.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
This commit is contained in:
Alyssa Rosenzweig 2019-07-09 11:10:49 -07:00
parent 138e40d471
commit 7ad6516f3b
2 changed files with 9 additions and 2 deletions

View file

@ -212,6 +212,9 @@ typedef struct compiler_context {
* when using nested loops */
int current_loop_depth;
/* Total number of loops for shader-db */
unsigned loop_count;
/* Constants which have been loaded, for later inlining */
struct hash_table_u64 *ssa_constants;

View file

@ -2479,6 +2479,9 @@ emit_loop(struct compiler_context *ctx, nir_loop *nloop)
/* Now that we've finished emitting the loop, free up the depth again
* so we play nice with recursion amid nested loops */
--ctx->current_loop_depth;
/* Dump loop stats */
++ctx->loop_count;
}
static midgard_block *
@ -2883,11 +2886,12 @@ midgard_compile_shader_nir(nir_shader *nir, midgard_program *program, bool is_bl
fprintf(stderr, "shader%d - %s shader: "
"%u inst, %u bundles, "
"%u registers, %u threads, 0 loops\n",
"%u registers, %u threads, %u loops\n",
SHADER_DB_COUNT++,
gl_shader_stage_name(ctx->stage),
nr_ins, nr_bundles,
nr_registers, nr_threads);
nr_registers, nr_threads,
ctx->loop_count);
}