From d035908550fc4d57a56cf2c7a3cbcf5f39896fed Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Tue, 1 Aug 2023 09:13:02 -0400 Subject: [PATCH] agx: Don't use ssa_to_reg across blocks This is a footgun with live range spltiting. Signed-off-by: Alyssa Rosenzweig Part-of: --- src/asahi/compiler/agx_register_allocate.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/asahi/compiler/agx_register_allocate.c b/src/asahi/compiler/agx_register_allocate.c index 2b103737979..cce2aaf8243 100644 --- a/src/asahi/compiler/agx_register_allocate.c +++ b/src/asahi/compiler/agx_register_allocate.c @@ -708,7 +708,9 @@ reserve_live_in(struct ra_ctx *rctx) set_ssa_to_reg(rctx, i, base); } else { /* If we don't emit a phi, there is already a unique register */ - base = rctx->ssa_to_reg[i]; + agx_foreach_predecessor(rctx->block, pred) { + base = (*pred)->ssa_to_reg_out[i]; + } } for (unsigned j = 0; j < rctx->ncomps[i]; ++j) {