From e69de0f81d69fe4405e91b7a088adb855bc66f06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timur=20Krist=C3=B3f?= Date: Wed, 23 Mar 2022 18:45:36 +0100 Subject: [PATCH] aco: Support s_cselect_b64 in SCC no-compare optimization. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This was simply left out by accident when I wrote this. Fossil DB stats on Navi 21: Totals from 70165 (52.01% of 134906) affected shaders: CodeSize: 246375656 -> 245814396 (-0.23%) Instrs: 46519773 -> 46379458 (-0.30%) Latency: 385159303 -> 385089261 (-0.02%); split: -0.02%, +0.00% InvThroughput: 66490172 -> 66487867 (-0.00%); split: -0.00%, +0.00% Signed-off-by: Timur Kristóf Reviewed-by: Rhys Perry Part-of: --- src/amd/compiler/aco_optimizer_postRA.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/amd/compiler/aco_optimizer_postRA.cpp b/src/amd/compiler/aco_optimizer_postRA.cpp index 276e619432c..a59ee83a192 100644 --- a/src/amd/compiler/aco_optimizer_postRA.cpp +++ b/src/amd/compiler/aco_optimizer_postRA.cpp @@ -327,11 +327,13 @@ try_optimize_scc_nocompare(pr_opt_ctx& ctx, aco_ptr& instr) : aco_opcode::s_cmp_lg_u32; } else if ((instr->format == Format::PSEUDO_BRANCH && instr->operands.size() == 1 && instr->operands[0].physReg() == scc) || - instr->opcode == aco_opcode::s_cselect_b32) { + instr->opcode == aco_opcode::s_cselect_b32 || + instr->opcode == aco_opcode::s_cselect_b64) { /* For cselect, operand 2 is the SCC condition */ unsigned scc_op_idx = 0; - if (instr->opcode == aco_opcode::s_cselect_b32) { + if (instr->opcode == aco_opcode::s_cselect_b32 || + instr->opcode == aco_opcode::s_cselect_b64) { scc_op_idx = 2; } @@ -359,7 +361,8 @@ try_optimize_scc_nocompare(pr_opt_ctx& ctx, aco_ptr& instr) if (instr->format == Format::PSEUDO_BRANCH) instr->opcode = instr->opcode == aco_opcode::p_cbranch_z ? aco_opcode::p_cbranch_nz : aco_opcode::p_cbranch_z; - else if (instr->opcode == aco_opcode::s_cselect_b32) + else if (instr->opcode == aco_opcode::s_cselect_b32 || + instr->opcode == aco_opcode::s_cselect_b64) std::swap(instr->operands[0], instr->operands[1]); else unreachable(