mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 02:48:06 +02:00
broadcom/compiler: use nir_lower_undef_to_zero
total instructions in shared programs: 13731663 -> 13721549 (-0.07%) instructions in affected programs: 98242 -> 88128 (-10.29%) helped: 191 HURT: 131 Instructions are helped. total threads in shared programs: 412272 -> 412296 (<.01%) threads in affected programs: 24 -> 48 (100.00%) helped: 12 HURT: 0 Threads are helped. total uniforms in shared programs: 3780693 -> 3779137 (-0.04%) uniforms in affected programs: 10564 -> 9008 (-14.73%) helped: 114 HURT: 7 Uniforms are helped. total max-temps in shared programs: 2319942 -> 2319528 (-0.02%) max-temps in affected programs: 4191 -> 3777 (-9.88%) helped: 113 HURT: 22 Max-temps are helped. total sfu-stalls in shared programs: 31584 -> 31616 (0.10%) sfu-stalls in affected programs: 217 -> 249 (14.75%) helped: 51 HURT: 54 Inconclusive result (value mean confidence interval includes 0). total inst-and-stalls in shared programs: 13763247 -> 13753165 (-0.07%) inst-and-stalls in affected programs: 98719 -> 88637 (-10.21%) helped: 187 HURT: 134 Inst-and-stalls are helped. Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9681>
This commit is contained in:
parent
1c987f5db3
commit
cbe24a0e9c
1 changed files with 2 additions and 13 deletions
|
|
@ -1824,6 +1824,7 @@ v3d_optimize_nir(struct nir_shader *s)
|
||||||
}
|
}
|
||||||
|
|
||||||
NIR_PASS(progress, s, nir_opt_undef);
|
NIR_PASS(progress, s, nir_opt_undef);
|
||||||
|
NIR_PASS(progress, s, nir_lower_undef_to_zero);
|
||||||
} while (progress);
|
} while (progress);
|
||||||
|
|
||||||
nir_move_options sink_opts =
|
nir_move_options sink_opts =
|
||||||
|
|
@ -2158,18 +2159,6 @@ ntq_emit_load_const(struct v3d_compile *c, nir_load_const_instr *instr)
|
||||||
_mesa_hash_table_insert(c->def_ht, &instr->def, qregs);
|
_mesa_hash_table_insert(c->def_ht, &instr->def, qregs);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
ntq_emit_ssa_undef(struct v3d_compile *c, nir_ssa_undef_instr *instr)
|
|
||||||
{
|
|
||||||
struct qreg *qregs = ntq_init_ssa_def(c, &instr->def);
|
|
||||||
|
|
||||||
/* VIR needs there to be *some* value, so pick 0 (same as for
|
|
||||||
* ntq_setup_registers().
|
|
||||||
*/
|
|
||||||
for (int i = 0; i < instr->def.num_components; i++)
|
|
||||||
qregs[i] = vir_uniform_ui(c, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
ntq_emit_image_size(struct v3d_compile *c, nir_intrinsic_instr *instr)
|
ntq_emit_image_size(struct v3d_compile *c, nir_intrinsic_instr *instr)
|
||||||
{
|
{
|
||||||
|
|
@ -3384,7 +3373,7 @@ ntq_emit_instr(struct v3d_compile *c, nir_instr *instr)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case nir_instr_type_ssa_undef:
|
case nir_instr_type_ssa_undef:
|
||||||
ntq_emit_ssa_undef(c, nir_instr_as_ssa_undef(instr));
|
unreachable("Should've been lowered by nir_lower_undef_to_zero");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case nir_instr_type_tex:
|
case nir_instr_type_tex:
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue