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

Author: Connor Abbott <[email protected]>
Date:   Wed Dec 22 18:51:25 2021 +0100

ir3/ra: Fix logic bug in compress_regs_left

If we're allocating a source then we force is_killed to false, not to
true. Fixes a regression in
dEQP-GLES31.functional.synchronization.in_invocation.image_atomic_write_read
later.

Fixes: 0ffcb19b9d9 ("ir3: Rewrite register allocation")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14246>

---

 src/freedreno/ir3/ir3_ra.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/freedreno/ir3/ir3_ra.c b/src/freedreno/ir3/ir3_ra.c
index 56a8c7d17ea..8bb91a5c938 100644
--- a/src/freedreno/ir3/ir3_ra.c
+++ b/src/freedreno/ir3/ir3_ra.c
@@ -972,9 +972,9 @@ compress_regs_left(struct ra_ctx *ctx, struct ra_file 
*file, unsigned size,
       assert(!interval->frozen);
 
       /* Killed sources don't count because they go at the end and can
-       * overlap the register we're trying to add.
+       * overlap the register we're trying to add, unless it's a source.
        */
-      if (!interval->is_killed && !is_source) {
+      if (!interval->is_killed || is_source) {
          removed_size += interval->physreg_end - interval->physreg_start;
          if (interval->interval.reg->flags & IR3_REG_HALF) {
             removed_half_size += interval->physreg_end -

Reply via email to