aco: allow an extra SGPR with multiple uses to be applied to VOP3
This is in a separate patch from the apply_sgprs() rewrite so that the rewrite can be more easily tested. pipeline-db (Navi): Totals from affected shaders: SGPRS: 3056 -> 3056 (0.00 %) VGPRS: 1632 -> 1632 (0.00 %) Spilled SGPRs: 0 -> 0 (0.00 %) Spilled VGPRs: 0 -> 0 (0.00 %) Code Size: 156468 -> 156304 (-0.10 %) bytes Max Waves: 288 -> 288 (0.00 %) Instructions: 29510 -> 29469 (-0.14 %) pipeline-db (Vega): Totals from affected shaders: SGPRS: 2984 -> 2984 (0.00 %) VGPRS: 1616 -> 1616 (0.00 %) Spilled SGPRs: 0 -> 0 (0.00 %) Spilled VGPRs: 0 -> 0 (0.00 %) Code Size: 156132 -> 155968 (-0.11 %) bytes Max Waves: 289 -> 289 (0.00 %) Instructions: 29426 -> 29385 (-0.14 %) 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/2883>
This commit is contained in:
@@ -1937,7 +1937,7 @@ void apply_sgprs(opt_ctx &ctx, aco_ptr<Instruction>& instr)
|
||||
/* Applying two sgprs require making it VOP3, so don't do it unless it's
|
||||
* definitively beneficial.
|
||||
* TODO: this is too conservative because later the use count could be reduced to 1 */
|
||||
if (num_sgprs && ctx.uses[sgpr_info_id] > 1)
|
||||
if (num_sgprs && ctx.uses[sgpr_info_id] > 1 && !instr->isVOP3())
|
||||
break;
|
||||
|
||||
Temp sgpr = ctx.info[sgpr_info_id].temp;
|
||||
|
||||
Reference in New Issue
Block a user