From edc8ef741205284d6905e5b4484c2e559be9c15b Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Tue, 24 Sep 2024 10:41:09 -0400 Subject: [PATCH] agx: use reserved_size Signed-off-by: Alyssa Rosenzweig Part-of: --- src/asahi/compiler/agx_register_allocate.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/asahi/compiler/agx_register_allocate.c b/src/asahi/compiler/agx_register_allocate.c index 52eec9814de..76aff8b7a09 100644 --- a/src/asahi/compiler/agx_register_allocate.c +++ b/src/asahi/compiler/agx_register_allocate.c @@ -372,12 +372,6 @@ find_best_region_to_evict(struct ra_ctx *rctx, enum ra_class cls, unsigned size, unsigned best_base = ~0; unsigned best_moves = ~0; - /* Beginning region evictability condition */ - bool r0_evictable = - !rctx->shader->any_cf && !rctx->shader->has_spill_pcopy_reserved; - - assert(!(r0_evictable && rctx->shader->any_quad_divergent_shuffle)); - for (unsigned base = 0; base + size <= rctx->bound[cls]; base += size) { /* The first k registers are preallocated and unevictable, so must be * skipped. By itself, this does not pose a problem. We are allocating n @@ -393,7 +387,7 @@ find_best_region_to_evict(struct ra_ctx *rctx, enum ra_class cls, unsigned size, * descending. So, we do not need extra registers to handle "single * region" unevictability. */ - if (base == 0 && !r0_evictable) + if (base == 0 && reserved_size(rctx->shader) > 0) continue; /* Do not evict the same register multiple times. It's not necessary since