Mesa (main): ir3/ra: Add missing asserts to ra_push_interval()

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Nov 19 17:23:03 UTC 2021


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

Author: Connor Abbott <cwabbott0 at gmail.com>
Date:   Mon Nov 15 12:53:01 2021 +0100

ir3/ra: Add missing asserts to ra_push_interval()

This would've caught the previous issue earlier. We checked that the
physreg made sense when inserting via ra_file_insert() but not
ra_push_interval() which is used for live-range splitting.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13818>

---

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

diff --git a/src/freedreno/ir3/ir3_ra.c b/src/freedreno/ir3/ir3_ra.c
index a282b033c5d..56a8c7d17ea 100644
--- a/src/freedreno/ir3/ir3_ra.c
+++ b/src/freedreno/ir3/ir3_ra.c
@@ -718,6 +718,10 @@ ra_push_interval(struct ra_ctx *ctx, struct ra_file *file,
    interval->physreg_start = dst;
    interval->physreg_end = dst + removed->size;
 
+   assert(interval->physreg_end <= file->size);
+   if (interval->interval.reg->flags & IR3_REG_HALF)
+      assert(interval->physreg_end <= RA_HALF_SIZE);
+
    ir3_reg_interval_reinsert(&file->reg_ctx, &interval->interval);
 }
 



More information about the mesa-commit mailing list