From b062b92ab1a6504772a63a6b44f89b4579aef9a3 Mon Sep 17 00:00:00 2001 From: Rhys Perry Date: Mon, 11 Nov 2019 14:15:04 +0000 Subject: [PATCH] aco: don't combine literals into v_cndmask_b32/v_subb/v_addc MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit No pipeline-db changes Signed-off-by: Rhys Perry Fixes: 93c8ebfa ('aco: Initial commit of independent AMD compiler') Reviewed-by: Daniel Schürmann --- src/amd/compiler/aco_optimizer.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/amd/compiler/aco_optimizer.cpp b/src/amd/compiler/aco_optimizer.cpp index d3b35761704..5b4fcf75126 100644 --- a/src/amd/compiler/aco_optimizer.cpp +++ b/src/amd/compiler/aco_optimizer.cpp @@ -481,6 +481,12 @@ bool can_accept_constant(aco_ptr& instr, unsigned operand) bool valu_can_accept_literal(opt_ctx& ctx, aco_ptr& instr, unsigned operand) { + /* instructions like v_cndmask_b32 can't take a literal because they always + * read SGPRs */ + if (instr->operands.size() >= 3 && + instr->operands[2].isTemp() && instr->operands[2].regClass().type() == RegType::sgpr) + return false; + // TODO: VOP3 can take a literal on GFX10 return !instr->isSDWA() && !instr->isDPP() && !instr->isVOP3() && operand == 0 && can_accept_constant(instr, operand); -- 2.30.2