Module: Mesa
Branch: staging/23.3
Commit: 30135c2a89aeb430adc92939e5b6f985193c05ff
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=30135c2a89aeb430adc92939e5b6f985193c05ff

Author: Connor Abbott <[email protected]>
Date:   Thu Nov  2 12:03:35 2023 +0100

ir3/ra: Don't swap killed sources for early-clobber destination

We have an optimization to try to swap regular live intervals with
killed sources when evicting them fails in order to make a contiguous
space for the destination to fit in, but this doesn't work when the
destination is early-clobber.

Fixes
dEQP-GLES31.functional.synchronization.inter_invocation.image_atomic_read_write
on a650+.

Fixes: d4b5d2a ("ir3/ra: Use killed sources in register eviction")
Closes: #8886
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26004>
(cherry picked from commit 04ffef15da1903c7f2497e24d96f742e476b3e8d)

---

 .pick_status.json                         | 2 +-
 src/freedreno/ci/freedreno-a660-fails.txt | 4 ----
 src/freedreno/ir3/ir3_ra.c                | 8 ++++++--
 3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/.pick_status.json b/.pick_status.json
index c796fc086ed..48fb97fdf8a 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -64,7 +64,7 @@
         "description": "ir3/ra: Don't swap killed sources for early-clobber 
destination",
         "nominated": true,
         "nomination_type": 1,
-        "resolution": 0,
+        "resolution": 1,
         "main_sha": null,
         "because_sha": "d4b5d2a0204f8c09a2e8c4dc022f0f05adafa50b",
         "notes": null
diff --git a/src/freedreno/ci/freedreno-a660-fails.txt 
b/src/freedreno/ci/freedreno-a660-fails.txt
index 1b9f84e05c8..975102e9cee 100644
--- a/src/freedreno/ci/freedreno-a660-fails.txt
+++ b/src/freedreno/ci/freedreno-a660-fails.txt
@@ -5,10 +5,6 @@ KHR-GL46.shader_image_load_store.basic-allTargets-store,Fail
 
KHR-GL46.shader_subroutine.control_flow_and_returned_subroutine_values_used_as_subroutine_input,Fail
 KHR-GL46.tessellation_shader.single.max_patch_vertices,Fail
 
-# https://gitlab.freedesktop.org/mesa/mesa/-/issues/8886
-dEQP-GLES31.functional.synchronization.inter_invocation.image_atomic_read_write,Crash
-
-
 # Fails when TU_DEBUG=forcebin is set
 
gmem-dEQP-VK.spirv_assembly.instruction.graphics.variable_pointers.graphics.writes_two_buffers_vert,Fail
 
diff --git a/src/freedreno/ir3/ir3_ra.c b/src/freedreno/ir3/ir3_ra.c
index 0ec4530d48e..6ad5b8c1902 100644
--- a/src/freedreno/ir3/ir3_ra.c
+++ b/src/freedreno/ir3/ir3_ra.c
@@ -879,9 +879,13 @@ try_evict_regs(struct ra_ctx *ctx, struct ra_file *file,
       if (evicted)
          continue;
 
-      /* If we couldn't evict this range, we may be able to swap it with a
-       * killed range to acheive the same effect.
+      /* If we couldn't evict this range, but the register we're allocating is
+       * allowed to overlap with a killed range, then we may be able to swap it
+       * with a killed range to acheive the same effect.
        */
+      if (is_early_clobber(reg) || is_source)
+         return false;
+
       foreach_interval (killed, file) {
          if (!killed->is_killed)
             continue;

Reply via email to