From 28a69b72d8e77ba595aff2676ed4f520cc0a49c2 Mon Sep 17 00:00:00 2001 From: Georg Lehmann Date: Mon, 5 Sep 2022 13:10:06 +0200 Subject: [PATCH] aco: Use plain VOPC for vcmpx when possible. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Foz-DB Navi21: Totals from 66947 (49.62% of 134913) affected shaders: CodeSize: 210383024 -> 210033376 (-0.17%) Signed-off-by: Georg Lehmann Reviewed-by: Timur Kristóf Part-of: --- src/amd/compiler/aco_ssa_elimination.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/amd/compiler/aco_ssa_elimination.cpp b/src/amd/compiler/aco_ssa_elimination.cpp index 01f32337825..b6b51fe4fa9 100644 --- a/src/amd/compiler/aco_ssa_elimination.cpp +++ b/src/amd/compiler/aco_ssa_elimination.cpp @@ -461,7 +461,10 @@ try_optimize_branching_sequence(ssa_elimination_ctx& ctx, Block& block, const in *exec_val->definitions.rbegin() = Definition(exec, ctx.program->lane_mask); - /* TODO: change instruction from VOP3 to plain VOPC when possible. */ + /* Change instruction from VOP3 to plain VOPC when possible. */ + if (ctx.program->gfx_level >= GFX10 && !exec_val->usesModifiers() && + (exec_val->operands.size() < 2 || exec_val->operands[1].isOfType(RegType::vgpr))) + exec_val->format = Format::VOPC; } else { /* Reassign the instruction to write exec directly. */ exec_val->definitions[0] = Definition(exec, ctx.program->lane_mask);