From 4c2f231cc0c6a7c62cfc2dc852bdcdc71d49b051 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Sch=C3=BCrmann?= Date: Thu, 20 Jun 2024 12:21:53 +0200 Subject: [PATCH] aco/spill: Unconditionally add 2 SGPRs to live-in demand Due to undefined Operands, it might not be enough to check the predecessors' register demand. Cc: mesa-stable Part-of: --- src/amd/compiler/aco_spill.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/amd/compiler/aco_spill.cpp b/src/amd/compiler/aco_spill.cpp index d05a588163a..65951058f8d 100644 --- a/src/amd/compiler/aco_spill.cpp +++ b/src/amd/compiler/aco_spill.cpp @@ -330,11 +330,8 @@ get_live_in_demand(spill_ctx& ctx, unsigned block_idx) reg_pressure += get_demand_before(ctx, block_idx, idx); - /* Consider register pressure from linear predecessors. This can affect - * reg_pressure if the branch instructions define sgprs. */ - for (unsigned pred : block.linear_preds) - reg_pressure.sgpr = - std::max(reg_pressure.sgpr, ctx.program->live.register_demand[pred].back().sgpr); + /* In order to create long jumps, we might need an empty SGPR pair. */ + reg_pressure.sgpr += 2; return reg_pressure; }