freedreno/ir3: add tracking for # of instructions per category

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6243>
This commit is contained in:
Rob Clark 2020-08-06 09:24:50 -07:00 committed by Marge Bot
parent 2cd0c8d8ea
commit 7aa74ab792
4 changed files with 38 additions and 4 deletions

View file

@ -954,10 +954,17 @@ void * ir3_assemble(struct ir3_shader_variant *v)
if ((instr->opc == OPC_BARY_F) && (instr->regs[0]->flags & IR3_REG_EI))
info->last_baryf = info->instrs_count;
info->instrs_count += 1 + instr->repeat + instr->nop;
info->nops_count += instr->nop;
if (instr->opc == OPC_NOP)
info->nops_count += 1 + instr->repeat;
unsigned instrs_count = 1 + instr->repeat + instr->nop;
unsigned nops_count = instr->nop;
if (instr->opc == OPC_NOP) {
nops_count = 1 + instr->repeat;
info->instrs_per_cat[0] += nops_count;
} else {
info->instrs_per_cat[opc_cat(instr->opc)] += instrs_count;
info->instrs_per_cat[0] += nops_count;
}
if (instr->opc == OPC_MOV) {
if (instr->cat1.src_type == instr->cat1.dst_type) {
info->mov_count += 1 + instr->repeat;
@ -965,6 +972,10 @@ void * ir3_assemble(struct ir3_shader_variant *v)
info->cov_count += 1 + instr->repeat;
}
}
info->instrs_count += instrs_count;
info->nops_count += nops_count;
dwords += 2;
if (instr->flags & IR3_INSTR_SS) {

View file

@ -65,6 +65,9 @@ struct ir3_info {
uint16_t sstall;
uint16_t last_baryf; /* instruction # of last varying fetch */
/* Number of instructions of a given category: */
uint16_t instrs_per_cat[8];
};
struct ir3_register {

View file

@ -615,6 +615,17 @@ ir3_shader_disasm(struct ir3_shader_variant *so, uint32_t *bin, FILE *out)
so->info.max_reg + 1,
so->constlen);
fprintf(out, "; %s prog %d/%d: %u cat0, %u cat1, %u cat2, %u cat3, %u cat4, %u cat5, %u cat6, %u cat7, \n",
type, so->shader->id, so->id,
so->info.instrs_per_cat[0],
so->info.instrs_per_cat[1],
so->info.instrs_per_cat[2],
so->info.instrs_per_cat[3],
so->info.instrs_per_cat[4],
so->info.instrs_per_cat[5],
so->info.instrs_per_cat[6],
so->info.instrs_per_cat[7]);
fprintf(out, "; %s prog %d/%d: %u sstall, %u (ss), %u (sy), %d max_sun, %d loops\n",
type, so->shader->id, so->id,
so->info.sstall,

View file

@ -52,6 +52,7 @@ dump_shader_info(struct ir3_shader_variant *v, struct pipe_debug_callback *debug
pipe_debug_message(debug, SHADER_INFO,
"%s shader: %u inst, %u nops, %u non-nops, %u mov, %u cov, "
"%u dwords, %u last-baryf, %u half, %u full, %u constlen, "
"%u cat0, %u cat1, %u cat2, %u cat3, %u cat4, %u cat5, %u cat6, %u cat7, "
"%u sstall, %u (ss), %u (sy), %d max_sun, %d loops\n",
ir3_shader_stage(v),
v->info.instrs_count,
@ -64,6 +65,14 @@ dump_shader_info(struct ir3_shader_variant *v, struct pipe_debug_callback *debug
v->info.max_half_reg + 1,
v->info.max_reg + 1,
v->constlen,
v->info.instrs_per_cat[0],
v->info.instrs_per_cat[1],
v->info.instrs_per_cat[2],
v->info.instrs_per_cat[3],
v->info.instrs_per_cat[4],
v->info.instrs_per_cat[5],
v->info.instrs_per_cat[6],
v->info.instrs_per_cat[7],
v->info.sstall,
v->info.ss, v->info.sy,
v->max_sun, v->loops);