diff options
author | Rob Clark <[email protected]> | 2018-01-29 15:28:10 -0500 |
---|---|---|
committer | Rob Clark <[email protected]> | 2018-02-10 14:54:58 -0500 |
commit | 069c0ac62520ef06ec6b8c8f67f364d5be9cbc9a (patch) | |
tree | 4ae4fbd231347d18ed13a3e42f6c00c85e4850c7 /src/gallium | |
parent | 7d45e2e39f3a6fd9afa7bd7c25be58c80b2f44ab (diff) |
freedreno/ir3: print # of sync bits for shaderdb
When trying to optimize to reduce stalls, it is nice to see this info.
Signed-off-by: Rob Clark <[email protected]>
Diffstat (limited to 'src/gallium')
-rw-r--r-- | src/gallium/drivers/freedreno/ir3/ir3.c | 7 | ||||
-rw-r--r-- | src/gallium/drivers/freedreno/ir3/ir3.h | 3 | ||||
-rw-r--r-- | src/gallium/drivers/freedreno/ir3/ir3_shader.c | 10 |
3 files changed, 18 insertions, 2 deletions
diff --git a/src/gallium/drivers/freedreno/ir3/ir3.c b/src/gallium/drivers/freedreno/ir3/ir3.c index 01a7bbc7dc6..e59f10dab93 100644 --- a/src/gallium/drivers/freedreno/ir3/ir3.c +++ b/src/gallium/drivers/freedreno/ir3/ir3.c @@ -683,6 +683,7 @@ void * ir3_assemble(struct ir3 *shader, struct ir3_info *info, info->max_const = -1; info->instrs_count = 0; info->sizedwords = 0; + info->ss = info->sy = 0; list_for_each_entry (struct ir3_block, block, &shader->block_list, node) { list_for_each_entry (struct ir3_instruction, instr, &block->instr_list, node) { @@ -709,6 +710,12 @@ void * ir3_assemble(struct ir3 *shader, struct ir3_info *info, goto fail; info->instrs_count += 1 + instr->repeat; dwords += 2; + + if (instr->flags & IR3_INSTR_SS) + info->ss++; + + if (instr->flags & IR3_INSTR_SY) + info->sy++; } } diff --git a/src/gallium/drivers/freedreno/ir3/ir3.h b/src/gallium/drivers/freedreno/ir3/ir3.h index 6ef0683ab00..b8e41718da4 100644 --- a/src/gallium/drivers/freedreno/ir3/ir3.h +++ b/src/gallium/drivers/freedreno/ir3/ir3.h @@ -51,6 +51,9 @@ struct ir3_info { int8_t max_reg; /* highest GPR # used by shader */ int8_t max_half_reg; int16_t max_const; + + /* number of sync bits: */ + uint16_t ss, sy; }; struct ir3_register { diff --git a/src/gallium/drivers/freedreno/ir3/ir3_shader.c b/src/gallium/drivers/freedreno/ir3/ir3_shader.c index 5d67d4877f5..3d6cae9f80e 100644 --- a/src/gallium/drivers/freedreno/ir3/ir3_shader.c +++ b/src/gallium/drivers/freedreno/ir3/ir3_shader.c @@ -169,7 +169,8 @@ dump_shader_info(struct ir3_shader_variant *v, struct pipe_debug_callback *debug pipe_debug_message(debug, SHADER_INFO, "\n" "SHADER-DB: %s prog %d/%d: %u instructions, %u dwords\n" "SHADER-DB: %s prog %d/%d: %u half, %u full\n" - "SHADER-DB: %s prog %d/%d: %u const, %u constlen\n", + "SHADER-DB: %s prog %d/%d: %u const, %u constlen\n" + "SHADER-DB: %s prog %d/%d: %u (ss), %u (sy)\n", ir3_shader_stage(v->shader), v->shader->id, v->id, v->info.instrs_count, @@ -181,7 +182,10 @@ dump_shader_info(struct ir3_shader_variant *v, struct pipe_debug_callback *debug ir3_shader_stage(v->shader), v->shader->id, v->id, v->info.max_const + 1, - v->constlen); + v->constlen, + ir3_shader_stage(v->shader), + v->shader->id, v->id, + v->info.ss, v->info.sy); } static struct ir3_shader_variant * @@ -486,6 +490,8 @@ ir3_shader_disasm(struct ir3_shader_variant *so, uint32_t *bin) so->info.max_const + 1, so->constlen); + debug_printf("; %u (ss), %u (sy)\n", so->info.ss, so->info.sy); + /* print shader type specific info: */ switch (so->type) { case SHADER_VERTEX: |