From 93b42a190762dee01bd2b95be105add2d1bd529a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Daniel=20Sch=C3=BCrmann?= Date: Wed, 30 Oct 2019 12:32:32 +0100 Subject: [PATCH] aco: don't add interferences between spilled phi operands Reviewed-by: Rhys Perry --- src/amd/compiler/aco_spill.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/amd/compiler/aco_spill.cpp b/src/amd/compiler/aco_spill.cpp index 4c7a45ad6df..6959895d858 100644 --- a/src/amd/compiler/aco_spill.cpp +++ b/src/amd/compiler/aco_spill.cpp @@ -797,14 +797,6 @@ void add_coupling_code(spill_ctx& ctx, Block* block, unsigned block_idx) std::vector preds = pair.first.type() == RegType::vgpr ? block->logical_preds : block->linear_preds; for (unsigned pred_idx : preds) { - /* add interferences between spilled variable and predecessors exit spills */ - for (std::pair exit_spill : ctx.spills_exit[pred_idx]) { - if (exit_spill.first == pair.first) - continue; - ctx.interferences[exit_spill.second].second.emplace(pair.second); - ctx.interferences[pair.second].second.emplace(exit_spill.second); - } - /* variable is already spilled at predecessor */ std::map::iterator spilled = ctx.spills_exit[pred_idx].find(pair.first); if (spilled != ctx.spills_exit[pred_idx].end()) { @@ -817,6 +809,14 @@ void add_coupling_code(spill_ctx& ctx, Block* block, unsigned block_idx) if (ctx.next_use_distances_end[pred_idx].find(pair.first) == ctx.next_use_distances_end[pred_idx].end()) continue; + /* add interferences between spilled variable and predecessors exit spills */ + for (std::pair exit_spill : ctx.spills_exit[pred_idx]) { + if (exit_spill.first == pair.first) + continue; + ctx.interferences[exit_spill.second].second.emplace(pair.second); + ctx.interferences[pair.second].second.emplace(exit_spill.second); + } + /* variable is in register at predecessor and has to be spilled */ /* rename if necessary */ Temp var = pair.first; -- 2.30.2