freedreno, tu, ir3: Add last_helper statistic

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24433>
This commit is contained in:
Connor Abbott
2023-08-01 18:34:24 +02:00
committed by Marge Bot
parent 1f44d8d51d
commit 5411f01f93
5 changed files with 26 additions and 4 deletions
+10
View File
@@ -293,6 +293,7 @@ ir3_collect_info(struct ir3_shader_variant *v)
info->sizedwords = info->size / 4;
bool in_preamble = false;
bool has_eq = false;
foreach_block (block, &shader->block_list) {
int sfu_delay = 0, mem_delay = 0;
@@ -325,6 +326,15 @@ ir3_collect_info(struct ir3_shader_variant *v)
(instr->dsts[0]->flags & IR3_REG_EI))
info->last_baryf = info->instrs_count;
if ((instr->opc == OPC_NOP) && (instr->flags & IR3_INSTR_EQ)) {
info->last_helper = info->instrs_count;
has_eq = true;
}
if (v->type == MESA_SHADER_FRAGMENT && v->need_pixlod &&
instr->opc == OPC_END && !v->prefetch_end_of_quad && !has_eq)
info->last_helper = info->instrs_count;
if (instr->opc == OPC_SHPS)
in_preamble = true;
+2
View File
@@ -86,6 +86,8 @@ struct ir3_info {
uint16_t last_baryf; /* instruction # of last varying fetch */
uint16_t last_helper; /* last instruction to use helper invocations */
/* Number of instructions of a given category: */
uint16_t instrs_per_cat[8];
};
+3 -2
View File
@@ -872,9 +872,10 @@ ir3_shader_disasm(struct ir3_shader_variant *so, uint32_t *bin, FILE *out)
so->info.cov_count, so->info.sizedwords);
fprintf(out,
"; %s prog %d/%d: %u last-baryf, %d half, %d full, %u constlen\n",
"; %s prog %d/%d: %u last-baryf, %u last-helper, %d half, %d full, %u constlen\n",
type, so->shader_id, so->id, so->info.last_baryf,
so->info.max_half_reg + 1, so->info.max_reg + 1, so->constlen);
so->info.last_helper, so->info.max_half_reg + 1,
so->info.max_reg + 1, so->constlen);
fprintf(
out,
+8
View File
@@ -5722,6 +5722,14 @@ tu_GetPipelineExecutableStatisticsKHR(
stat->value.u64 = exe->stats.last_baryf;
}
vk_outarray_append_typed(VkPipelineExecutableStatisticKHR, &out, stat) {
WRITE_STR(stat->name, "Last helper instruction");
WRITE_STR(stat->description,
"The instruction where helper invocations are killed");
stat->format = VK_PIPELINE_EXECUTABLE_STATISTIC_FORMAT_UINT64_KHR;
stat->value.u64 = exe->stats.last_helper;
}
vk_outarray_append_typed(VkPipelineExecutableStatisticKHR, &out, stat) {
WRITE_STR(stat->name, "Instructions with SS sync bit");
WRITE_STR(stat->description,
@@ -83,14 +83,15 @@ dump_shader_info(struct ir3_shader_variant *v,
util_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 dwords, %u last-baryf, %u last-helper, %u half, %u full, %u constlen, "
"%u cat0, %u cat1, %u cat2, %u cat3, %u cat4, %u cat5, %u cat6, %u cat7, "
"%u stp, %u ldp, %u sstall, %u (ss), %u systall, %u (sy), %d waves, "
"%d loops\n",
ir3_shader_stage(v), v->info.instrs_count, v->info.nops_count,
v->info.instrs_count - v->info.nops_count, v->info.mov_count,
v->info.cov_count, v->info.sizedwords, v->info.last_baryf,
v->info.max_half_reg + 1, v->info.max_reg + 1, v->constlen,
v->info.last_helper, 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],