diff --git a/src/amd/compiler/aco_live_var_analysis.cpp b/src/amd/compiler/aco_live_var_analysis.cpp index 25933bfe8d6..6dd81398b9d 100644 --- a/src/amd/compiler/aco_live_var_analysis.cpp +++ b/src/amd/compiler/aco_live_var_analysis.cpp @@ -226,11 +226,13 @@ void process_live_temps_per_block(Program *program, live& lives, Block* block, /* check if we changed an already processed block */ const bool inserted = lives.live_out[preds[i]].insert(operand.tempId()).second; if (inserted) { - operand.setKill(true); worklist.insert(preds[i]); if (insn->opcode == aco_opcode::p_phi && operand.getTemp().type() == RegType::sgpr) phi_sgpr_ops[preds[i]] += operand.size(); } + + /* set if the operand is killed by this (or another) phi instruction */ + operand.setKill(!live.count(operand.tempId())); } phi_idx--; }