aco: fix waves calculation for wave32

fossil-db (GFX10.3, wave32):
Totals from 176 (0.13% of 139391) affected shaders:
SGPRs: 16648 -> 16640 (-0.05%)
VGPRs: 18920 -> 19076 (+0.82%); split: -0.30%, +1.12%
CodeSize: 2354172 -> 2354288 (+0.00%); split: -0.01%, +0.01%
MaxWaves: 1618 -> 1627 (+0.56%); split: +0.68%, -0.12%
Instrs: 435756 -> 435761 (+0.00%); split: -0.02%, +0.02%
Cycles: 8858360 -> 8869960 (+0.13%); split: -0.01%, +0.14%
VMEM: 55899 -> 57220 (+2.36%); split: +2.53%, -0.17%
SMEM: 10323 -> 10374 (+0.49%); split: +0.73%, -0.23%
VClause: 8307 -> 8290 (-0.20%); split: -0.24%, +0.04%
SClause: 16573 -> 16577 (+0.02%); split: -0.01%, +0.03%
Copies: 24641 -> 24652 (+0.04%); split: -0.24%, +0.28%

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8761>
This commit is contained in:
Rhys Perry 2021-01-28 11:04:02 +00:00
parent 6a770cae4b
commit 592d64611c
2 changed files with 5 additions and 5 deletions

View file

@ -103,8 +103,8 @@ void init_program(Program *program, Stage stage, struct radv_shader_info *info,
program->vgpr_alloc_granule = 4;
if (chip_class >= GFX10) {
program->physical_sgprs = 2560; /* doesn't matter as long as it's at least 128 * 20 */
program->physical_vgprs = 512;
program->physical_sgprs = 5120; /* doesn't matter as long as it's at least 128 * 40 */
program->physical_vgprs = program->wave_size == 32 ? 1024 : 512;
program->sgpr_alloc_granule = 128;
program->sgpr_limit = 108; /* includes VCC, which can be treated as s[106-107] on GFX10+ */
if (chip_class >= GFX10_3)

View file

@ -313,9 +313,6 @@ uint16_t get_addr_vgpr_from_waves(Program *program, uint16_t waves)
void calc_min_waves(Program* program)
{
unsigned waves_per_workgroup = calc_waves_per_workgroup(program);
/* currently min_waves is in wave64 waves */
if (program->wave_size == 32)
waves_per_workgroup = DIV_ROUND_UP(waves_per_workgroup, 2);
unsigned simd_per_cu = program->chip_class >= GFX10 ? 2 : 4;
bool wgp = program->chip_class >= GFX10; /* assume WGP is used on Navi */
@ -331,6 +328,9 @@ void update_vgpr_sgpr_demand(Program* program, const RegisterDemand new_demand)
max_waves_per_simd = 16;
else if (program->family >= CHIP_POLARIS10 && program->family <= CHIP_VEGAM)
max_waves_per_simd = 8;
if (program->wave_size == 32)
max_waves_per_simd *= 2;
unsigned simd_per_cu = program->chip_class >= GFX10 ? 2 : 4;
bool wgp = program->chip_class >= GFX10; /* assume WGP is used on Navi */