Mesa (staging/21.3): ir3/spill: Mark root as non-spillable after inserting

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Nov 9 22:03:12 UTC 2021


Module: Mesa
Branch: staging/21.3
Commit: 4cd7e081d6e489786ff177ce7a77e8c33ee65d5c
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=4cd7e081d6e489786ff177ce7a77e8c33ee65d5c

Author: Connor Abbott <cwabbott0 at gmail.com>
Date:   Sun Oct 31 16:01:02 2021 +0100

ir3/spill: Mark root as non-spillable after inserting

We have to mark the root as non-spillable in case the interval is the
child of some other interval, but we can't know whether it's the child
of some other interval until it's been inserted. Move the setting of
cant_spill below the insertion. This prevents us from using a bogus
parent value.

Fixes: 613eaac7b53 ("ir3: Initial support for spilling non-shared registers")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13650>
(cherry picked from commit db566904baa96c9f3c19aaac3e8e99bc0ebb4dc7)

---

 .pick_status.json             |  2 +-
 src/freedreno/ir3/ir3_spill.c | 12 ++++++------
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/.pick_status.json b/.pick_status.json
index 9df80e4b10d..0142e76a3d6 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -517,7 +517,7 @@
         "description": "ir3/spill: Mark root as non-spillable after inserting",
         "nominated": true,
         "nomination_type": 1,
-        "resolution": 0,
+        "resolution": 1,
         "main_sha": null,
         "because_sha": "613eaac7b53bfbfcd6ef536412be6c9c63cdea4f"
     },
diff --git a/src/freedreno/ir3/ir3_spill.c b/src/freedreno/ir3/ir3_spill.c
index 38627f4db02..43cad0a4366 100644
--- a/src/freedreno/ir3/ir3_spill.c
+++ b/src/freedreno/ir3/ir3_spill.c
@@ -520,14 +520,14 @@ insert_src(struct ra_spill_ctx *ctx, struct ir3_register *src)
 {
    struct ra_spill_interval *interval = ctx->intervals[src->def->name];
 
-   ra_spill_interval_root(interval)->cant_spill = true;
+   if (!interval->interval.inserted) {
+      ra_spill_ctx_insert(ctx, interval);
+      interval->needs_reload = true;
+      interval->already_spilled = true;
+   }
 
-   if (interval->interval.inserted)
-      return;
+   ra_spill_interval_root(interval)->cant_spill = true;
 
-   ra_spill_ctx_insert(ctx, interval);
-   interval->needs_reload = true;
-   interval->already_spilled = true;
 }
 
 static void



More information about the mesa-commit mailing list