agx: implement get_sr remat
wanderer/386.shader_test - MESA_SHADER_FRAGMENT shader: 16268 inst, 110728 bytes, 255 halfregs, 384 threads, 5 loops, 436:720 spills:fills wanderer/386.shader_test - MESA_SHADER_FRAGMENT shader: 16255 inst, 110670 bytes, 255 halfregs, 384 threads, 5 loops, 435:719 spills:fills Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28483>
This commit is contained in:
committed by
Marge Bot
parent
03000030d0
commit
55d7267d6c
@@ -275,14 +275,29 @@ reconstruct_index(struct spill_ctx *ctx, unsigned node)
|
||||
static bool
|
||||
can_remat(agx_instr *I)
|
||||
{
|
||||
return I->op == AGX_OPCODE_MOV_IMM;
|
||||
switch (I->op) {
|
||||
case AGX_OPCODE_MOV_IMM:
|
||||
case AGX_OPCODE_GET_SR:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
static agx_instr *
|
||||
remat_to(agx_builder *b, agx_index dst, struct spill_ctx *ctx, unsigned node)
|
||||
{
|
||||
assert(can_remat(ctx->remat[node]));
|
||||
agx_mov_imm_to(b, dst, ctx->remat[node]->imm);
|
||||
agx_instr *I = ctx->remat[node];
|
||||
assert(can_remat(I));
|
||||
|
||||
switch (I->op) {
|
||||
case AGX_OPCODE_MOV_IMM:
|
||||
return agx_mov_imm_to(b, dst, I->imm);
|
||||
case AGX_OPCODE_GET_SR:
|
||||
return agx_get_sr_to(b, dst, I->sr);
|
||||
default:
|
||||
unreachable("invalid remat");
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
Reference in New Issue
Block a user