Module: Mesa
Branch: main
Commit: 28a69b72d8e77ba595aff2676ed4f520cc0a49c2
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=28a69b72d8e77ba595aff2676ed4f520cc0a49c2

Author: Georg Lehmann <[email protected]>
Date:   Mon Sep  5 13:10:06 2022 +0200

aco: Use plain VOPC for vcmpx when possible.

Foz-DB Navi21:
Totals from 66947 (49.62% of 134913) affected shaders:
CodeSize: 210383024 -> 210033376 (-0.17%)

Signed-off-by: Georg Lehmann <[email protected]>
Reviewed-by: Timur Kristóf <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18417>

---

 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);

Reply via email to