Mesa (master): aco: don't add interferences between spilled phi operands

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Oct 30 19:48:52 UTC 2019


Module: Mesa
Branch: master
Commit: 93b42a190762dee01bd2b95be105add2d1bd529a
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=93b42a190762dee01bd2b95be105add2d1bd529a

Author: Daniel Schürmann <daniel at schuermann.dev>
Date:   Wed Oct 30 12:32:32 2019 +0100

aco: don't add interferences between spilled phi operands

Reviewed-by: Rhys Perry <pendingchaos02 at gmail.com>

---

 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<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;




More information about the mesa-commit mailing list