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:
parent
7d45e2e39f
commit
069c0ac625
|
@ -683,6 +683,7 @@ void * ir3_assemble(struct ir3 *shader, struct ir3_info *info,
|
||||||
info->max_const = -1;
|
info->max_const = -1;
|
||||||
info->instrs_count = 0;
|
info->instrs_count = 0;
|
||||||
info->sizedwords = 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_block, block, &shader->block_list, node) {
|
||||||
list_for_each_entry (struct ir3_instruction, instr, &block->instr_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;
|
goto fail;
|
||||||
info->instrs_count += 1 + instr->repeat;
|
info->instrs_count += 1 + instr->repeat;
|
||||||
dwords += 2;
|
dwords += 2;
|
||||||
|
|
||||||
|
if (instr->flags & IR3_INSTR_SS)
|
||||||
|
info->ss++;
|
||||||
|
|
||||||
|
if (instr->flags & IR3_INSTR_SY)
|
||||||
|
info->sy++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -51,6 +51,9 @@ struct ir3_info {
|
||||||
int8_t max_reg; /* highest GPR # used by shader */
|
int8_t max_reg; /* highest GPR # used by shader */
|
||||||
int8_t max_half_reg;
|
int8_t max_half_reg;
|
||||||
int16_t max_const;
|
int16_t max_const;
|
||||||
|
|
||||||
|
/* number of sync bits: */
|
||||||
|
uint16_t ss, sy;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct ir3_register {
|
struct ir3_register {
|
||||||
|
|
|
@ -169,7 +169,8 @@ dump_shader_info(struct ir3_shader_variant *v, struct pipe_debug_callback *debug
|
||||||
pipe_debug_message(debug, SHADER_INFO, "\n"
|
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 instructions, %u dwords\n"
|
||||||
"SHADER-DB: %s prog %d/%d: %u half, %u full\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),
|
ir3_shader_stage(v->shader),
|
||||||
v->shader->id, v->id,
|
v->shader->id, v->id,
|
||||||
v->info.instrs_count,
|
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),
|
ir3_shader_stage(v->shader),
|
||||||
v->shader->id, v->id,
|
v->shader->id, v->id,
|
||||||
v->info.max_const + 1,
|
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 *
|
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->info.max_const + 1,
|
||||||
so->constlen);
|
so->constlen);
|
||||||
|
|
||||||
|
debug_printf("; %u (ss), %u (sy)\n", so->info.ss, so->info.sy);
|
||||||
|
|
||||||
/* print shader type specific info: */
|
/* print shader type specific info: */
|
||||||
switch (so->type) {
|
switch (so->type) {
|
||||||
case SHADER_VERTEX:
|
case SHADER_VERTEX:
|
||||||
|
|
Loading…
Reference in New Issue