diff --git a/src/amd/compiler/aco_optimizer.cpp b/src/amd/compiler/aco_optimizer.cpp index 211627d0854..6e519feeb96 100644 --- a/src/amd/compiler/aco_optimizer.cpp +++ b/src/amd/compiler/aco_optimizer.cpp @@ -2113,6 +2113,11 @@ follow_operand(opt_ctx& ctx, Operand op, bool ignore_uses = false) return nullptr; } + for (Operand& operand : instr->operands) { + if (fixed_to_exec(operand)) + return nullptr; + } + return instr; } @@ -2445,8 +2450,6 @@ match_op3_for_vop3(opt_ctx& ctx, aco_opcode op1, aco_opcode op2, Instruction* op Instruction* op2_instr = follow_operand(ctx, op1_instr->operands[swap]); if (!op2_instr || op2_instr->opcode != op2) return false; - if (fixed_to_exec(op2_instr->operands[0]) || fixed_to_exec(op2_instr->operands[1])) - return false; VOP3_instruction* op1_vop3 = op1_instr->isVOP3() ? &op1_instr->vop3() : NULL; VOP3_instruction* op2_vop3 = op2_instr->isVOP3() ? &op2_instr->vop3() : NULL; @@ -2707,7 +2710,7 @@ combine_salu_n2(opt_ctx& ctx, aco_ptr& instr) if (!op2_instr || (op2_instr->opcode != aco_opcode::s_not_b32 && op2_instr->opcode != aco_opcode::s_not_b64)) continue; - if (ctx.uses[op2_instr->definitions[1].tempId()] || fixed_to_exec(op2_instr->operands[0])) + if (ctx.uses[op2_instr->definitions[1].tempId()]) continue; if (instr->operands[!i].isLiteral() && op2_instr->operands[0].isLiteral() && @@ -2744,7 +2747,7 @@ combine_salu_lshl_add(opt_ctx& ctx, aco_ptr& instr) if (!op2_instr || op2_instr->opcode != aco_opcode::s_lshl_b32 || ctx.uses[op2_instr->definitions[1].tempId()]) continue; - if (!op2_instr->operands[1].isConstant() || fixed_to_exec(op2_instr->operands[0])) + if (!op2_instr->operands[1].isConstant()) continue; uint32_t shift = op2_instr->operands[1].constantValue();