broadcom/compiler: skip small immediates optimization on vpm instructions

total instructions in shared programs: 11164938 -> 10890641 (-2.46%)
instructions in affected programs: 6557250 -> 6282953 (-4.18%)
helped: 59134
HURT: 9752
Instructions are helped.

total threads in shared programs: 431068 -> 431034 (<.01%)
threads in affected programs: 68 -> 34 (-50.00%)
helped: 0
Threads are HURT.

total uniforms in shared programs: 3880437 -> 5308006 (36.79%)
uniforms in affected programs: 2669367 -> 4096936 (53.48%)
helped: 2
HURT: 74046
Uniforms are HURT.

total max-temps in shared programs: 2244298 -> 2226555 (-0.79%)
max-temps in affected programs: 463611 -> 445868 (-3.83%)
helped: 17473
HURT: 8040
Max-temps are helped.

total spills in shared programs: 4312 -> 4318 (0.14%)
spills in affected programs: 0 -> 6
helped: 0
HURT: 2

total fills in shared programs: 6508 -> 6514 (0.09%)
fills in affected programs: 0 -> 6
helped: 0
HURT: 2

total sfu-stalls in shared programs: 14794 -> 15143 (2.36%)
sfu-stalls in affected programs: 1261 -> 1610 (27.68%)
helped: 238
HURT: 586
Inconclusive result (value mean confidence interval and %-change mean confidence interval disagree).

total inst-and-stalls in shared programs: 11179732 -> 10905784 (-2.45%)
inst-and-stalls in affected programs: 6570407 -> 6296459 (-4.17%)
helped: 59126
HURT: 9786
Inst-and-stalls are helped.

total nops in shared programs: 273422 -> 183945 (-32.72%)
nops in affected programs: 139446 -> 49969 (-64.17%)
helped: 60679
HURT: 2277
Nops are helped.

Reviewed-by: Jose Maria Casanova Crespo <jmcasanova@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31259>
This commit is contained in:
Iago Toral Quiroga 2024-09-19 13:27:04 +02:00 committed by Marge Bot
parent fd11bbbb90
commit 68014b0d9b

View file

@ -32,13 +32,36 @@
static bool debug;
static bool
skip_inst(struct qinst *inst)
{
if (inst->qpu.type != V3D_QPU_INSTR_TYPE_ALU)
return true;
if (!vir_is_add(inst))
return false;
switch (inst->qpu.alu.add.op) {
case V3D_QPU_A_LDVPMV_IN:
case V3D_QPU_A_LDVPMG_IN:
case V3D_QPU_A_LDVPMD_IN:
case V3D_QPU_A_LDVPMP:
case V3D_QPU_A_STVPMV:
case V3D_QPU_A_STVPMD:
case V3D_QPU_A_STVPMP:
return true;
default:
return false;
}
}
bool
vir_opt_small_immediates(struct v3d_compile *c)
{
bool progress = false;
vir_for_each_inst_inorder(inst, c) {
if (inst->qpu.type != V3D_QPU_INSTR_TYPE_ALU)
if (skip_inst(inst))
continue;
/* The small immediate value sits in the raddr B field, so we