From: Rhys Perry Date: Mon, 18 May 2020 14:26:58 +0000 (+0100) Subject: aco: improve sub-dword check for sgpr/constant propagation X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=9b69ed0bb9503befd73e7bfa4867dc431d01e2ee;p=mesa.git aco: improve sub-dword check for sgpr/constant propagation p_create_vector can have sub-dword operands with a v1 definition. No fossil-db changes. Signed-off-by: Rhys Perry Reviewed-by: Daniel Schürmann Part-of: --- diff --git a/src/amd/compiler/aco_optimizer.cpp b/src/amd/compiler/aco_optimizer.cpp index 211f347c0ab..37564b7e993 100644 --- a/src/amd/compiler/aco_optimizer.cpp +++ b/src/amd/compiler/aco_optimizer.cpp @@ -727,11 +727,16 @@ void label_instruction(opt_ctx &ctx, Block& block, aco_ptr& instr) /* SALU / PSEUDO: propagate inline constants */ if (instr->isSALU() || instr->format == Format::PSEUDO) { - const bool is_subdword = std::any_of(instr->definitions.begin(), instr->definitions.end(), - [] (const Definition& def) { return def.regClass().is_subdword();}); + bool is_subdword = false; // TODO: optimize SGPR and constant propagation for subdword pseudo instructions on gfx9+ - if (is_subdword) - continue; + if (instr->format == Format::PSEUDO) { + 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();}); + if (is_subdword) + continue; + } if (info.is_temp() && info.temp.type() == RegType::sgpr) { instr->operands[i].setTemp(info.temp);