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 <robdclark@gmail.com>
This commit is contained in:
Rob Clark 2018-01-29 15:28:10 -05:00
parent 7d45e2e39f
commit 069c0ac625
3 changed files with 18 additions and 2 deletions

View File

@ -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++;
}
}

View File

@ -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 {

View File

@ -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: