mesa/src/broadcom/compiler
Iago Toral Quiroga cf4b3cb563 broadcom/compiler: prefer reconstruction over TMU spills when possible
We have been reconstructing/rematerializing uniforms for a while, but we
can do this in more scenarios, namely instructions which result is
immutable along the execution of a shader across all channels.

By doing this we gain the capacity to eliminate TMU spills which not
only are slower, but can also make us drop to a fallback compilation
strategy.

Shader-db results show a small increase in instruction counts caused
by us now being able to choose preferential compiler strategies that
are intended to reduce TMU latency. In some cases, we are now also
able to avoid dropping thread counts:

total instructions in shared programs: 12658092 -> 12659245 (<.01%)
instructions in affected programs: 75812 -> 76965 (1.52%)
helped: 55
HURT: 107

total threads in shared programs: 416286 -> 416412 (0.03%)
threads in affected programs: 126 -> 252 (100.00%)
helped: 63
HURT: 0

total uniforms in shared programs: 3716916 -> 3716396 (-0.01%)
uniforms in affected programs: 19327 -> 18807 (-2.69%)
helped: 94
HURT: 50

total max-temps in shared programs: 2161796 -> 2161578 (-0.01%)
max-temps in affected programs: 3961 -> 3743 (-5.50%)
helped: 80
HURT: 24

total spills in shared programs: 3274 -> 3266 (-0.24%)
spills in affected programs: 98 -> 90 (-8.16%)
helped: 6
HURT: 0

total fills in shared programs: 4657 -> 4642 (-0.32%)
fills in affected programs: 130 -> 115 (-11.54%)
helped: 6
HURT: 0

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15710>
2022-04-08 05:37:28 +00:00
..
meson.build broadcom/compiler: add lowering pass to scalarize non 32-bit general load/store 2022-01-25 09:08:26 +00:00
nir_to_vir.c broadcom/compiler: allow ldunifa with indirect uniform loads 2022-03-28 10:44:13 +00:00
qpu_schedule.c broadcom/compiler: improve thrsw merge 2021-12-14 09:50:17 +00:00
qpu_validate.c broadcom/compiler: don't check for GFXH-1633 on V3D 4.2.x 2021-02-12 08:24:21 +00:00
v3d33_tex.c broadcom/compiler: support pipelining of tex instructions 2021-02-04 10:33:10 +00:00
v3d33_vpm_setup.c broadcom/vc5: Move V3D 3.3 VPM write setup to a separate file. 2018-01-12 21:56:24 -08:00
v3d40_tex.c broadcom/compiler: Add a v3d_compile argument to vir_set_[pu]f 2021-02-12 07:05:33 +00:00
v3d_compiler.h v3dv: implement VK_EXT_inline_uniform_block 2022-03-28 10:44:13 +00:00
v3d_nir_lower_image_load_store.c broadcom/compiler: avoid unneeded sint/unorm clamping when lowering stores 2021-12-15 11:53:20 +00:00
v3d_nir_lower_io.c v3d/compiler: Handle point_coord_upper_left 2021-09-12 21:01:11 +00:00
v3d_nir_lower_line_smooth.c v3dv/v3d: Fix copyright holder to Raspberry Pi Ltd 2022-02-18 11:50:07 +01:00
v3d_nir_lower_load_store_bitsize.c v3dv/v3d: Fix copyright holder to Raspberry Pi Ltd 2022-02-18 11:50:07 +01:00
v3d_nir_lower_logic_ops.c broadcom/compiler: consider RT component size when lowering logic ops in Vulkan 2021-05-18 11:28:17 +00:00
v3d_nir_lower_robust_buffer_access.c v3dv/v3d: Fix copyright holder to Raspberry Pi Ltd 2022-02-18 11:50:07 +01:00
v3d_nir_lower_scratch.c nir: Make nir_ssa_def_rewrite_uses take an SSA value 2021-03-08 16:59:55 +00:00
v3d_nir_lower_txf_ms.c v3d: Use nir_shader_lower_instructions() for txf_ms lowering. 2019-07-18 11:28:56 -07:00
vir.c v3dv: implement VK_EXT_inline_uniform_block 2022-03-28 10:44:13 +00:00
vir_dump.c broadcom/compiler: use signed pointers for packed condition 2021-04-12 15:22:05 +00:00
vir_live_variables.c broadcom/compiler: Fix qpu.flags.muf typo. 2021-08-24 08:30:59 +00:00
vir_opt_constant_alu.c v3dv/v3d: Fix copyright holder to Raspberry Pi Ltd 2022-02-18 11:50:07 +01:00
vir_opt_copy_propagate.c broadcom/compiler: make opt passes set current block 2021-11-02 11:17:01 +00:00
vir_opt_dead_code.c broadcom/compiler: make opt passes set current block 2021-11-02 11:17:01 +00:00
vir_opt_redundant_flags.c broadcom/compiler: make opt passes set current block 2021-11-02 11:17:01 +00:00
vir_opt_small_immediates.c v3d: Use ldunif instructions for uniforms. 2019-03-05 12:57:39 -08:00
vir_register_allocate.c broadcom/compiler: prefer reconstruction over TMU spills when possible 2022-04-08 05:37:28 +00:00
vir_to_qpu.c broadcom/compiler: remove qpu_acc helper 2021-09-24 08:46:06 +00:00