From 1c14013b9effccd0d2d82aee511c98c34b3ec850 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Sch=C3=BCrmann?= Date: Thu, 22 Aug 2024 11:09:46 +0200 Subject: [PATCH] aco/live_var_analysis: Don't attempt to re-insert the same temporary twice into live set Part-of: --- src/amd/compiler/aco_live_var_analysis.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/amd/compiler/aco_live_var_analysis.cpp b/src/amd/compiler/aco_live_var_analysis.cpp index c33fd4c0609..c5c3660c9af 100644 --- a/src/amd/compiler/aco_live_var_analysis.cpp +++ b/src/amd/compiler/aco_live_var_analysis.cpp @@ -259,14 +259,15 @@ process_live_temps_per_block(live_ctx& ctx, Block* block) if (operand.isFixed() && operand.physReg() == vcc) ctx.program->needs_vcc = true; const Temp temp = operand.getTemp(); - const bool inserted = live.insert(temp.id()).second; - if (inserted) { + + if (operand.isKill()) + continue; + + if (live.insert(temp.id()).second) { operand.setFirstKill(true); for (unsigned j = i + 1; j < insn->operands.size(); ++j) { - if (insn->operands[j].isTemp() && insn->operands[j].tempId() == operand.tempId()) { - insn->operands[j].setFirstKill(false); + if (insn->operands[j].isTemp() && insn->operands[j].getTemp() == temp) insn->operands[j].setKill(true); - } } if (operand.isLateKill()) insn->register_demand += temp;