From c240c1aecfdf46f6bb9b0956df6f4ab8a609dfdf Mon Sep 17 00:00:00 2001 From: Rhys Perry Date: Wed, 20 Nov 2019 19:09:25 +0000 Subject: [PATCH] aco: apply literals to split mads MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Removing the return is also needed to apply literals to mads (which can be done on GFX10). pipeline-db (Navi): Totals from affected shaders: SGPRS: 368787 -> 367555 (-0.33 %) VGPRS: 312436 -> 312448 (0.00 %) Spilled SGPRs: 461 -> 461 (0.00 %) Spilled VGPRs: 0 -> 0 (0.00 %) Code Size: 26113388 -> 26098260 (-0.06 %) bytes Max Waves: 35982 -> 35982 (0.00 %) Instructions: 5038670 -> 5028941 (-0.19 %) pipeline-db (Vega): Totals from affected shaders: SGPRS: 369843 -> 368659 (-0.32 %) VGPRS: 317224 -> 317196 (-0.01 %) Spilled SGPRs: 629 -> 629 (0.00 %) Spilled VGPRs: 0 -> 0 (0.00 %) Code Size: 26310540 -> 26295156 (-0.06 %) bytes Max Waves: 36324 -> 36326 (0.01 %) Instructions: 5073957 -> 5064164 (-0.19 %) Signed-off-by: Rhys Perry Reviewed-by: Daniel Schürmann Part-of: --- src/amd/compiler/aco_optimizer.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/amd/compiler/aco_optimizer.cpp b/src/amd/compiler/aco_optimizer.cpp index 8e4d4d6d9c0..e7a2da1bcb1 100644 --- a/src/amd/compiler/aco_optimizer.cpp +++ b/src/amd/compiler/aco_optimizer.cpp @@ -2301,6 +2301,10 @@ void select_instruction(opt_ctx &ctx, aco_ptr& instr) /* first, check profitability */ if (ctx.uses[info->mul_temp_id]) { ctx.uses[info->mul_temp_id]++; + if (instr->operands[0].isTemp()) + ctx.uses[instr->operands[0].tempId()]--; + if (instr->operands[1].isTemp()) + ctx.uses[instr->operands[1].tempId()]--; instr.swap(info->add_instr); /* second, check possible literals */ @@ -2333,7 +2337,6 @@ void select_instruction(opt_ctx &ctx, aco_ptr& instr) info->literal_idx = literal_idx; } } - return; } /* check for literals */ -- 2.30.2