From 178b33c87089ddec0df1e7adac9bf4630974439f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Sch=C3=BCrmann?= Date: Fri, 8 Jan 2021 23:14:16 +0100 Subject: [PATCH] aco: allow SGPRs on every src position for VOP3P Reviewed-by: Rhys Perry Part-of: --- src/amd/compiler/aco_optimizer.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/amd/compiler/aco_optimizer.cpp b/src/amd/compiler/aco_optimizer.cpp index deebff042f4..c986c6f69e7 100644 --- a/src/amd/compiler/aco_optimizer.cpp +++ b/src/amd/compiler/aco_optimizer.cpp @@ -2524,7 +2524,8 @@ 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 && !instr->isVOP3() && !instr->isSDWA()) + if (num_sgprs && ctx.uses[sgpr_info_id] > 1 && + !instr->isVOP3() && !instr->isSDWA() && instr->format != Format::VOP3P) break; Temp sgpr = ctx.info[sgpr_info_id].temp; @@ -2532,7 +2533,8 @@ void apply_sgprs(opt_ctx &ctx, aco_ptr& instr) if (new_sgpr && num_sgprs >= max_sgprs) continue; - if (sgpr_idx == 0 || instr->isVOP3() || instr->isSDWA()) { + if (sgpr_idx == 0 || instr->isVOP3() || + instr->isSDWA() || instr->format == Format::VOP3P) { instr->operands[sgpr_idx] = Operand(sgpr); } else if (can_swap_operands(instr)) { instr->operands[sgpr_idx] = instr->operands[0];