Mesa (master): aco: fix new_demand calculation for first instructions

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


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

Author: Rhys Perry <pendingchaos02 at gmail.com>
Date:   Wed Oct 30 18:00:36 2019 +0000

aco: fix new_demand calculation for first instructions

Reviewed-by: Daniel Schürmann <daniel at schuermann.dev>

---

 src/amd/compiler/aco_spill.cpp | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/src/amd/compiler/aco_spill.cpp b/src/amd/compiler/aco_spill.cpp
index 6959895d858..60a99aa9247 100644
--- a/src/amd/compiler/aco_spill.cpp
+++ b/src/amd/compiler/aco_spill.cpp
@@ -1033,11 +1033,14 @@ void process_block(spill_ctx& ctx, unsigned block_idx, Block* block,
 
          RegisterDemand new_demand = ctx.register_demand[block_idx][idx];
          if (idx == 0) {
-            for (const Definition& def : instr->definitions) {
-               if (!def.isTemp())
-                  continue;
-               new_demand += def.getTemp();
+            RegisterDemand demand_before = new_demand;
+            for (const Definition& def : instr->definitions)
+               demand_before -= def.getTemp();
+            for (const Operand& op : instr->operands) {
+               if (op.isFirstKill())
+                  demand_before += op.getTemp();
             }
+            new_demand.update(demand_before);
          } else {
             new_demand.update(ctx.register_demand[block_idx][idx - 1]);
          }




More information about the mesa-commit mailing list