From c436743b0c43f73b205b8845453fdbaada63f0d8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Daniel=20Sch=C3=BCrmann?= Date: Fri, 21 Feb 2020 17:06:32 +0100 Subject: [PATCH] aco: don't propagate SGPRs into subdword PSEUDO instructions MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Reviewed-by: Rhys Perry Reviewed-By: Timur Kristóf Part-of: --- src/amd/compiler/aco_optimizer.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/amd/compiler/aco_optimizer.cpp b/src/amd/compiler/aco_optimizer.cpp index a6b68dd5448..f3819676df9 100644 --- a/src/amd/compiler/aco_optimizer.cpp +++ b/src/amd/compiler/aco_optimizer.cpp @@ -698,8 +698,12 @@ void label_instruction(opt_ctx &ctx, Block& block, aco_ptr& instr) /* SALU / PSEUDO: propagate inline constants */ if (instr->isSALU() || instr->format == Format::PSEUDO) { if (info.is_temp() && info.temp.type() == RegType::sgpr) { - instr->operands[i].setTemp(info.temp); - info = ctx.info[info.temp.id()]; + const bool is_subdword = std::any_of(instr->definitions.begin(), instr->definitions.end(), + [] (const Definition& def) { return def.regClass().is_subdword();}); + if (instr->isSALU() || !is_subdword) { + instr->operands[i].setTemp(info.temp); + info = ctx.info[info.temp.id()]; + } } else if (info.is_temp() && info.temp.type() == RegType::vgpr) { /* propagate vgpr if it can take it */ switch (instr->opcode) { -- 2.30.2