From d4b3e869ee164d7beabef43193d4453290f243e0 Mon Sep 17 00:00:00 2001 From: Rhys Perry Date: Tue, 13 Oct 2020 13:33:57 +0100 Subject: [PATCH] aco: propagate literals into sub-dword pseudo instructions on GFX9+ MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Rhys Perry Reviewed-by: Daniel Schürmann Part-of: --- src/amd/compiler/aco_optimizer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/amd/compiler/aco_optimizer.cpp b/src/amd/compiler/aco_optimizer.cpp index 463e473..a21fb21 100644 --- a/src/amd/compiler/aco_optimizer.cpp +++ b/src/amd/compiler/aco_optimizer.cpp @@ -836,7 +836,7 @@ void label_instruction(opt_ctx &ctx, Block& block, aco_ptr& instr) is_subdword = std::any_of(instr->definitions.begin(), instr->definitions.end(), [] (const Definition& def) { return def.regClass().is_subdword();}); is_subdword = is_subdword || std::any_of(instr->operands.begin(), instr->operands.end(), - [] (const Operand& op) { return op.hasRegClass() && op.regClass().is_subdword();}); + [] (const Operand& op) { return op.bytes() % 4;}); if (is_subdword && ctx.program->chip_class < GFX9) continue; } @@ -864,7 +864,7 @@ void label_instruction(opt_ctx &ctx, Block& block, aco_ptr& instr) } } unsigned bits = get_operand_size(instr, i); - if ((info.is_constant(bits) || (!is_subdword && info.is_literal(bits) && instr->format == Format::PSEUDO)) && + if ((info.is_constant(bits) || (info.is_literal(bits) && instr->format == Format::PSEUDO)) && !instr->operands[i].isFixed() && alu_can_accept_constant(instr->opcode, i)) { instr->operands[i] = get_constant_op(ctx, info, bits); continue; -- 2.7.4