freedreno/ir3: add last-baryf shaderdb stat
authorRob Clark <robdclark@chromium.org>
Wed, 11 Dec 2019 23:52:32 +0000 (15:52 -0800)
committerRob Clark <robdclark@chromium.org>
Fri, 13 Dec 2019 17:25:40 +0000 (09:25 -0800)
Sometimes sched changes that are a win in terms of instruction count
and/or register pressure, are worse in real life, due to keeping varying
storage locked for too long.  Add a shader-db stat to give this more
visibility.

Signed-off-by: Rob Clark <robdclark@chromium.org>
src/freedreno/ir3/ir3.c
src/freedreno/ir3/ir3.h
src/gallium/drivers/freedreno/ir3/ir3_gallium.c

index b89e9b316a59cef1e1f600f0977bb5a90551c38c..af3d51527248d6a887ab440aaab49c6195982b8c 100644 (file)
@@ -915,6 +915,10 @@ void * ir3_assemble(struct ir3 *shader, struct ir3_info *info,
                        int ret = emit[opc_cat(instr->opc)](instr, dwords, info);
                        if (ret)
                                goto fail;
+
+                       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)
index aa89e765bef158eb91f1d261c997a6fa1785aa40..888cf5fcbed7252bc1ee2e90b0f2ddbcd27a54cd 100644 (file)
@@ -58,6 +58,8 @@ struct ir3_info {
 
        /* number of sync bits: */
        uint16_t ss, sy;
+
+       uint16_t last_baryf;     /* instruction # of last varying fetch */
 };
 
 struct ir3_register {
index e5c44521af67bccc99546a78247f67fd84d4a3a4..5a47376c14eb054b18ccad1a4c30ec50dee959c2 100644 (file)
@@ -52,13 +52,14 @@ dump_shader_info(struct ir3_shader_variant *v, bool binning_pass,
 
        pipe_debug_message(debug, SHADER_INFO,
                        "%s shader: %u inst, %u nops, %u non-nops, %u dwords, "
-                       "%u half, %u full, %u constlen, "
+                       "%u last-baryf, %u half, %u full, %u constlen, "
                        "%u (ss), %u (sy), %d max_sun, %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.sizedwords,
+                       v->info.last_baryf,
                        v->info.max_half_reg + 1,
                        v->info.max_reg + 1,
                        v->constlen,