aco: fix get_temp_reg_changes with clobbered operands

The spiller might have tried to spill a live-through first or second
s_fmac_f32 operand, but this wouldn't have reduced the SGPRs if the third
operand wasn't killed

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/13038
Fixes: d6cb45dbb0 ("aco/spill: Allow spilling live-through operands")
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34699>
This commit is contained in:
Rhys Perry 2025-04-24 14:01:39 +01:00 committed by Marge Bot
parent 656d7a0f88
commit 7fe84024cb

View file

@ -67,6 +67,8 @@ RegisterDemand get_temp_reg_changes(Instruction* instr)
for (Operand op : instr->operands) {
if (op.isFirstKillBeforeDef() || op.isCopyKill())
available_def_space -= op.getTemp();
else if (op.isClobbered() && !op.isKill())
available_def_space -= op.getTemp();
}
return available_def_space;