ir3: Don't count (nopX) towards the wrong category

Prior to this commit

   (nop3) mad.f32 r0.y, c0.x, r1.w, c0.y

was counted as 4 cat3 instructions (and still 3 cat0/nops) in shader-db
results. With this change, it is counted as only 1 cat3 instruction.

Probably never going to have better shader-db results than this in my
career:

total cat2 in shared programs: 1214667 -> 732058 (-39.73%)
cat2 in affected programs: 1194729 -> 712120 (-40.39%)
helped: 8551
HURT: 0

total cat3 in shared programs: 376448 -> 274745 (-27.02%)
cat3 in affected programs: 344918 -> 243215 (-29.49%)
helped: 7222
HURT: 0

Reviewed-by: Rob Clark <robdclark@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10116>
This commit is contained in:
Matt Turner 2021-04-08 20:31:14 +00:00 committed by Marge Bot
parent 0dfc076743
commit 4251e9cddf

View file

@ -261,7 +261,7 @@ ir3_collect_info(struct ir3_shader_variant *v)
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[opc_cat(instr->opc)] += 1 + instr->repeat;
info->instrs_per_cat[0] += nops_count;
}