Mesa (staging/21.1): aco/ra: initialize temp_in_scc earlier

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon May 17 19:00:37 UTC 2021


Module: Mesa
Branch: staging/21.1
Commit: c624c0c6ccebe1a9ce1bafcb65c1affd8a52e0ce
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=c624c0c6ccebe1a9ce1bafcb65c1affd8a52e0ce

Author: Rhys Perry <pendingchaos02 at gmail.com>
Date:   Mon May  3 14:21:59 2021 +0100

aco/ra: initialize temp_in_scc earlier

We need to know if there's a temporary in SCC before the instruction, not
after.

Signed-off-by: Rhys Perry <pendingchaos02 at gmail.com>
Reviewed-by: Daniel Schürmann <daniel at schuermann.dev>
Fixes: 93c8ebfa780 ("aco: Initial commit of independent AMD compiler")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10459>
(cherry picked from commit 4e459df0fcb42cfb7223e15ffd7e20bcc9b16e75)

---

 .pick_status.json                            | 2 +-
 src/amd/compiler/aco_register_allocation.cpp | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/.pick_status.json b/.pick_status.json
index fd460507f98..63d730df310 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -76,7 +76,7 @@
         "description": "aco/ra: initialize temp_in_scc earlier",
         "nominated": true,
         "nomination_type": 1,
-        "resolution": 0,
+        "resolution": 1,
         "master_sha": null,
         "because_sha": "93c8ebfa780ebd1495095e794731881aef29e7d3"
     },
diff --git a/src/amd/compiler/aco_register_allocation.cpp b/src/amd/compiler/aco_register_allocation.cpp
index 2923f7465f5..3b71c39e438 100644
--- a/src/amd/compiler/aco_register_allocation.cpp
+++ b/src/amd/compiler/aco_register_allocation.cpp
@@ -2270,6 +2270,8 @@ void register_allocation(Program *program, std::vector<IDSet>& live_out_per_bloc
 
          assert(!is_phi(instr));
 
+         bool temp_in_scc = register_file[scc];
+
          /* handle operands */
          for (unsigned i = 0; i < instr->operands.size(); ++i) {
             auto& operand = instr->operands[i];
@@ -2484,7 +2486,6 @@ void register_allocation(Program *program, std::vector<IDSet>& live_out_per_bloc
          if (!parallelcopy.empty()) {
             aco_ptr<Pseudo_instruction> pc;
             pc.reset(create_instruction<Pseudo_instruction>(aco_opcode::p_parallelcopy, Format::PSEUDO, parallelcopy.size(), parallelcopy.size()));
-            bool temp_in_scc = register_file[scc];
             bool sgpr_operands_alias_defs = false;
             uint64_t sgpr_operands[4] = {0, 0, 0, 0};
             for (unsigned i = 0; i < parallelcopy.size(); i++) {



More information about the mesa-commit mailing list