From: Rhys Perry Date: Fri, 22 Nov 2019 13:47:54 +0000 (+0000) Subject: aco: allow an extra SGPR with multiple uses to be applied to VOP3 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=9c2d37308fdd50586e746235b8c6a8e08cf6ffa3;p=mesa.git 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 Reviewed-by: Daniel Schürmann Part-of: --- diff --git a/src/amd/compiler/aco_optimizer.cpp b/src/amd/compiler/aco_optimizer.cpp index 70b8f24ea1a..88075fabfb2 100644 --- a/src/amd/compiler/aco_optimizer.cpp +++ b/src/amd/compiler/aco_optimizer.cpp @@ -1937,7 +1937,7 @@ void apply_sgprs(opt_ctx &ctx, aco_ptr& 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;