diff --git a/src/amd/compiler/aco_live_var_analysis.cpp b/src/amd/compiler/aco_live_var_analysis.cpp index 0456eb39da4..dcc93385ffc 100644 --- a/src/amd/compiler/aco_live_var_analysis.cpp +++ b/src/amd/compiler/aco_live_var_analysis.cpp @@ -67,7 +67,7 @@ RegisterDemand get_temp_reg_changes(Instruction* instr) } for (Operand op : instr->operands) { - if (op.isFirstKillBeforeDef() || op.isCopyKill()) + if (op.isFirstKillBeforeDef() || (op.isCopyKill() && !op.isLateKill())) available_def_space -= op.getTemp(); else if (op.isClobbered() && !op.isKill()) available_def_space -= op.getTemp();