From 0c82b5c99cd3ad4bcfc388f5d63f5a24b08a699d Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Tue, 12 Apr 2022 18:06:01 -0400 Subject: [PATCH] agx: Note that RA proceeds in dominance-order This is an important invariant for SSA-based RA to work. Signed-off-by: Alyssa Rosenzweig Part-of: --- src/asahi/compiler/agx_register_allocate.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/asahi/compiler/agx_register_allocate.c b/src/asahi/compiler/agx_register_allocate.c index 9042f4a2a9a..7c0bbda0edd 100644 --- a/src/asahi/compiler/agx_register_allocate.c +++ b/src/asahi/compiler/agx_register_allocate.c @@ -153,8 +153,12 @@ agx_ra(agx_context *ctx) } } - agx_foreach_block(ctx, block) + /* Assign registers in dominance-order. This coincides with source-order due + * to a NIR invariant, so we do not need special handling for this. + */ + agx_foreach_block(ctx, block) { agx_ra_assign_local(block, ssa_to_reg, ncomps, ctx->max_register); + } /* TODO: Coalesce combines */