diff --git a/src/amd/compiler/aco_optimizer.cpp b/src/amd/compiler/aco_optimizer.cpp index 2f78631cde8..46746aea4e0 100644 --- a/src/amd/compiler/aco_optimizer.cpp +++ b/src/amd/compiler/aco_optimizer.cpp @@ -4979,6 +4979,9 @@ select_instruction(opt_ctx& ctx, aco_ptr& instr) for (unsigned i = 0; i < input_info.operands.size(); i++) { if (!input_info.operands[i].op.isTemp()) continue; + /* Applying DPP with many uses is unlikely to be profitable. */ + if (ctx.uses[input_info.operands[i].op.tempId()] > 3) + continue; Instruction* parent = ctx.info[input_info.operands[i].op.tempId()].parent_instr; if (!parent->isDPP() || parent->opcode != aco_opcode::v_mov_b32 || diff --git a/src/amd/compiler/aco_optimizer_postRA.cpp b/src/amd/compiler/aco_optimizer_postRA.cpp index c5e45e0ea0e..77d04c6ccd4 100644 --- a/src/amd/compiler/aco_optimizer_postRA.cpp +++ b/src/amd/compiler/aco_optimizer_postRA.cpp @@ -612,6 +612,10 @@ try_combine_dpp(pr_opt_ctx& ctx, aco_ptr& instr) if (mov->opcode != aco_opcode::v_mov_b32 || !mov->isDPP()) continue; + /* Applying DPP with many uses is unlikely to be profitable. */ + if (ctx.uses[mov->definitions[0].tempId()] > 3) + continue; + /* If we aren't going to remove the v_mov_b32, we have to ensure that it doesn't overwrite * it's own operand before we use it. */