From 9c2d37308fdd50586e746235b8c6a8e08cf6ffa3 Mon Sep 17 00:00:00 2001 From: Rhys Perry Date: Fri, 22 Nov 2019 13:47:54 +0000 Subject: [PATCH] aco: allow an extra SGPR with multiple uses to be applied to VOP3 MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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: --- src/amd/compiler/aco_optimizer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; -- 2.30.2