diff options
author | Daniel Schürmann <daniel@schuermann.dev> | 2019-10-30 12:32:32 +0100 |
---|---|---|
committer | Daniel Schürmann <daniel@schuermann.dev> | 2019-10-30 19:48:33 +0000 |
commit | 93b42a190762dee01bd2b95be105add2d1bd529a (patch) | |
tree | f3921349495016523b370d3207ab7d325b58d6fa | |
parent | fdf8ad0256da38991e391bb08c8d0b5b351f86ec (diff) |
aco: don't add interferences between spilled phi operands
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
-rw-r--r-- | src/amd/compiler/aco_spill.cpp | 16 |
1 files 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<unsigned> 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<Temp, uint32_t> 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<Temp, uint32_t>::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<Temp, uint32_t> 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; |