agx: Add and use replace_src helper
From Bifrost. Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19590>
This commit is contained in:

committed by
Marge Bot

parent
adf3cbc04c
commit
27869f6966
@@ -336,6 +336,12 @@ typedef struct {
|
|||||||
unsigned mask : 4;
|
unsigned mask : 4;
|
||||||
} agx_instr;
|
} agx_instr;
|
||||||
|
|
||||||
|
static inline void
|
||||||
|
agx_replace_src(agx_instr *I, unsigned src_index, agx_index replacement)
|
||||||
|
{
|
||||||
|
I->src[src_index] = agx_replace_index(I->src[src_index], replacement);
|
||||||
|
}
|
||||||
|
|
||||||
struct agx_block;
|
struct agx_block;
|
||||||
|
|
||||||
typedef struct agx_block {
|
typedef struct agx_block {
|
||||||
|
@@ -190,7 +190,7 @@ agx_optimizer_copyprop(agx_instr **defs, agx_instr *I)
|
|||||||
!(I->op == AGX_OPCODE_DEVICE_LOAD && s == 0))
|
!(I->op == AGX_OPCODE_DEVICE_LOAD && s == 0))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
I->src[s] = agx_replace_index(src, def->src[0]);
|
agx_replace_src(I, s, def->src[0]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -418,7 +418,7 @@ agx_ra(agx_context *ctx)
|
|||||||
agx_foreach_instr_global(ctx, ins) {
|
agx_foreach_instr_global(ctx, ins) {
|
||||||
agx_foreach_ssa_src(ins, s) {
|
agx_foreach_ssa_src(ins, s) {
|
||||||
unsigned v = ssa_to_reg[ins->src[s].value];
|
unsigned v = ssa_to_reg[ins->src[s].value];
|
||||||
ins->src[s] = agx_replace_index(ins->src[s], agx_register(v, ins->src[s].size));
|
agx_replace_src(ins, s, agx_register(v, ins->src[s].size));
|
||||||
}
|
}
|
||||||
|
|
||||||
agx_foreach_ssa_dest(ins, d) {
|
agx_foreach_ssa_dest(ins, d) {
|
||||||
|
Reference in New Issue
Block a user