From 994ad351f7cb7557732876db16896b4579cd2912 Mon Sep 17 00:00:00 2001 From: Iago Toral Quiroga Date: Thu, 4 May 2023 13:23:28 +0200 Subject: [PATCH] broadcom/compiler: increase peephole limit to 24 instructions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This helps by reducing the number of branches with their corresponding delay slots, at the expense of additional register pressure. It also helps a lot with SFU stalls, probably because removing control-flow blocks gives us more QPU scheduling flexibility to hide them. Shader-db results below correspond to the "closed shaders" set, since the full set is very dominated by the massive impact this change has on Skia's shaders (for the better), so this is probably more representative of real impact: total instructions in shared programs: 11887255 -> 11854898 (-0.27%) instructions in affected programs: 538170 -> 505813 (-6.01%) helped: 1653 HURT: 43 Instructions are helped. total threads in shared programs: 385924 -> 385872 (-0.01%) threads in affected programs: 236 -> 184 (-22.03%) helped: 22 HURT: 48 Inconclusive result (%-change mean confidence interval includes 0). total uniforms in shared programs: 3552808 -> 3547894 (-0.14%) uniforms in affected programs: 157486 -> 152572 (-3.12%) helped: 1673 HURT: 35 Uniforms are helped. total max-temps in shared programs: 2062403 -> 2064720 (0.11%) max-temps in affected programs: 18209 -> 20526 (12.72%) helped: 168 HURT: 369 Max-temps are HURT. total spills in shared programs: 1937 -> 1994 (2.94%) spills in affected programs: 79 -> 136 (72.15%) helped: 0 HURT: 1 total fills in shared programs: 2652 -> 2717 (2.45%) fills in affected programs: 115 -> 180 (56.52%) helped: 0 HURT: 1 total sfu-stalls in shared programs: 19349 -> 18010 (-6.92%) sfu-stalls in affected programs: 2321 -> 982 (-57.69%) helped: 674 HURT: 74 Sfu-stalls are helped. total inst-and-stalls in shared programs: 11906604 -> 11872908 (-0.28%) inst-and-stalls in affected programs: 541339 -> 507643 (-6.22%) helped: 1656 HURT: 43 Inst-and-stalls are helped. total nops in shared programs: 245740 -> 238085 (-3.12%) nops in affected programs: 19282 -> 11627 (-39.70%) helped: 1335 HURT: 76 Nops are helped. Reviewed-by: Alejandro PiƱeiro Part-of: --- src/broadcom/ci/broadcom-rpi4-skips.txt | 1 + src/broadcom/compiler/nir_to_vir.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/broadcom/ci/broadcom-rpi4-skips.txt b/src/broadcom/ci/broadcom-rpi4-skips.txt index 8c905e5835f..b86d056019a 100644 --- a/src/broadcom/ci/broadcom-rpi4-skips.txt +++ b/src/broadcom/ci/broadcom-rpi4-skips.txt @@ -105,3 +105,4 @@ dEQP-VK.texture.explicit_lod.2d.sizes.128x128_linear_linear_mipmap_linear_repeat dEQP-VK.texture.explicit_lod.2d.sizes.128x128_nearest_linear_mipmap_linear_clamp dEQP-VK.texture.explicit_lod.2d.sizes.128x128_nearest_linear_mipmap_linear_repeat dEQP-VK.ubo.random.all_out_of_order_offsets.45 +dEQP-VK.ssbo.layout.3_level_unsized_array.std430.row_major_mat4 diff --git a/src/broadcom/compiler/nir_to_vir.c b/src/broadcom/compiler/nir_to_vir.c index 6ba8bf92bfd..d2badf0a74a 100644 --- a/src/broadcom/compiler/nir_to_vir.c +++ b/src/broadcom/compiler/nir_to_vir.c @@ -2097,7 +2097,7 @@ v3d_optimize_nir(struct v3d_compile *c, struct nir_shader *s) NIR_PASS(progress, s, nir_opt_dead_cf); NIR_PASS(progress, s, nir_opt_cse); NIR_PASS(progress, s, nir_opt_peephole_select, 0, false, false); - NIR_PASS(progress, s, nir_opt_peephole_select, 8, true, true); + NIR_PASS(progress, s, nir_opt_peephole_select, 24, true, true); NIR_PASS(progress, s, nir_opt_algebraic); NIR_PASS(progress, s, nir_opt_constant_folding);