From 6909cb6379874313e0f91ca3cb0cb94344bc775b Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Tue, 1 Aug 2023 08:33:13 -0400 Subject: [PATCH] agx: Use agx_replace_src Signed-off-by: Alyssa Rosenzweig Part-of: --- src/asahi/compiler/agx_register_allocate.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/asahi/compiler/agx_register_allocate.c b/src/asahi/compiler/agx_register_allocate.c index 05a6a1c..7802dfe 100644 --- a/src/asahi/compiler/agx_register_allocate.c +++ b/src/asahi/compiler/agx_register_allocate.c @@ -745,7 +745,7 @@ agx_set_sources(struct ra_ctx *rctx, agx_instr *I) assert(BITSET_TEST(rctx->visited, I->src[s].value) && "no phis"); unsigned v = rctx->ssa_to_reg[I->src[s].value]; - I->src[s] = agx_replace_index(I->src[s], agx_register(v, I->src[s].size)); + agx_replace_src(I, s, agx_register(v, I->src[s].size)); } } @@ -1026,8 +1026,9 @@ agx_ra_assign_local(struct ra_ctx *rctx) /* This source needs a fixup */ unsigned value = phi->src[pred_idx].value; - phi->src[pred_idx] = - agx_register(rctx->ssa_to_reg[value], phi->src[pred_idx].size); + agx_replace_src( + phi, pred_idx, + agx_register(rctx->ssa_to_reg[value], phi->src[pred_idx].size)); } } } -- 2.7.4