From 171d76ded1fac18bf02abcdd506ebe5e91339162 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timur=20Krist=C3=B3f?= Date: Mon, 9 Jan 2023 20:57:05 +0100 Subject: [PATCH] aco/optimizer: Add missing v_lshlrev condition to can_apply_extract. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This was already handled by apply_extract but missing from can_apply_extract, therefore may not be properly applied everywhere. Signed-off-by: Timur Kristóf Reviewed-by: Georg Lehmann Part-of: --- src/amd/compiler/aco_optimizer.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/amd/compiler/aco_optimizer.cpp b/src/amd/compiler/aco_optimizer.cpp index 54d6a333686..e73ea603346 100644 --- a/src/amd/compiler/aco_optimizer.cpp +++ b/src/amd/compiler/aco_optimizer.cpp @@ -1101,6 +1101,11 @@ can_apply_extract(opt_ctx& ctx, aco_ptr& instr, unsigned idx, ssa_i return true; } else if (instr->opcode == aco_opcode::v_cvt_f32_u32 && sel.size() == 1 && !sel.sign_extend()) { return true; + } else if (instr->opcode == aco_opcode::v_lshlrev_b32 && instr->operands[0].isConstant() && + sel.offset() == 0 && + ((sel.size() == 2 && instr->operands[0].constantValue() >= 16u) || + (sel.size() == 1 && instr->operands[0].constantValue() >= 24u))) { + return true; } else if (idx < 2 && can_use_SDWA(ctx.program->gfx_level, instr, true) && (tmp.type() == RegType::vgpr || ctx.program->gfx_level >= GFX9)) { if (instr->isSDWA() && instr->sdwa().sel[idx] != SubdwordSel::dword)