diff options
author | Alyssa Rosenzweig <[email protected]> | 2019-07-09 11:10:49 -0700 |
---|---|---|
committer | Alyssa Rosenzweig <[email protected]> | 2019-07-10 06:45:20 -0700 |
commit | 7ad6516f3b70e46683bedbe2dc22623d87e13525 (patch) | |
tree | 44ddd8e725d8f32bbb9db350d487179b8a91f720 | |
parent | 138e40d471900a0b9852b248b95955705502324d (diff) |
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 <[email protected]>
-rw-r--r-- | src/gallium/drivers/panfrost/midgard/compiler.h | 3 | ||||
-rw-r--r-- | src/gallium/drivers/panfrost/midgard/midgard_compile.c | 8 |
2 files changed, 9 insertions, 2 deletions
diff --git a/src/gallium/drivers/panfrost/midgard/compiler.h b/src/gallium/drivers/panfrost/midgard/compiler.h index 820831d35dd..5692467c565 100644 --- a/src/gallium/drivers/panfrost/midgard/compiler.h +++ b/src/gallium/drivers/panfrost/midgard/compiler.h @@ -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; diff --git a/src/gallium/drivers/panfrost/midgard/midgard_compile.c b/src/gallium/drivers/panfrost/midgard/midgard_compile.c index 43f451c79db..1e09e46218c 100644 --- a/src/gallium/drivers/panfrost/midgard/midgard_compile.c +++ b/src/gallium/drivers/panfrost/midgard/midgard_compile.c @@ -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); } |