diff --git a/.pick_status.json b/.pick_status.json index c5b9dba8260..964610bd4fc 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -714,7 +714,7 @@ "description": "aco: give spiller more room to assign spilled SGPRs to VGPRs", "nominated": true, "nomination_type": 0, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null, "notes": null diff --git a/src/amd/compiler/aco_spill.cpp b/src/amd/compiler/aco_spill.cpp index 67fb00a8d8e..8da3d49202b 100644 --- a/src/amd/compiler/aco_spill.cpp +++ b/src/amd/compiler/aco_spill.cpp @@ -1938,7 +1938,7 @@ spill(Program* program, live& live_vars) /* calculate extra VGPRs required for spilling SGPRs */ if (demand.sgpr > sgpr_limit) { unsigned sgpr_spills = demand.sgpr - sgpr_limit; - extra_vgprs = DIV_ROUND_UP(sgpr_spills, program->wave_size) + 1; + extra_vgprs = DIV_ROUND_UP(sgpr_spills * 2, program->wave_size) + 1; } /* add extra SGPRs required for spilling VGPRs */ if (demand.vgpr + extra_vgprs > vgpr_limit) { @@ -1949,7 +1949,7 @@ spill(Program* program, live& live_vars) if (demand.sgpr + extra_sgprs > sgpr_limit) { /* re-calculate in case something has changed */ unsigned sgpr_spills = demand.sgpr + extra_sgprs - sgpr_limit; - extra_vgprs = DIV_ROUND_UP(sgpr_spills, program->wave_size) + 1; + extra_vgprs = DIV_ROUND_UP(sgpr_spills * 2, program->wave_size) + 1; } } /* the spiller has to target the following register demand */