Module: Mesa
Branch: main
Commit: 04ffef15da1903c7f2497e24d96f742e476b3e8d
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=04ffef15da1903c7f2497e24d96f742e476b3e8d

Author: Connor Abbott <cwabbo...@gmail.com>
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>

---

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

diff --git a/src/freedreno/ci/freedreno-a660-fails.txt 
b/src/freedreno/ci/freedreno-a660-fails.txt
index 382e97d2138..ef106528a08 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