mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-22 20:00:10 +01:00
ir3: Use a linear allocation context for ir3_instructions.
Again, instrs don't get freed as we go, so the linear gc context saves us 5 pointers per instr. Fossil replay time for deadspace3 on a debugoptimized build -4.85258% +/- 3.04009% (n=10) Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37316>
This commit is contained in:
parent
12fae29ec2
commit
114e6a3104
2 changed files with 4 additions and 4 deletions
|
|
@ -883,7 +883,7 @@ instr_create(struct ir3_block *block, opc_t opc, int ndst, int nsrc)
|
|||
struct ir3_instruction *instr;
|
||||
unsigned sz = sizeof(*instr) + (ndst * sizeof(instr->dsts[0])) +
|
||||
(nsrc * sizeof(instr->srcs[0]));
|
||||
char *ptr = ir3_alloc(block->shader, sz);
|
||||
char *ptr = linear_zalloc_child(block->shader->lin_ctx, sz);
|
||||
|
||||
instr = (struct ir3_instruction *)ptr;
|
||||
ptr += sizeof(*instr);
|
||||
|
|
@ -1012,7 +1012,7 @@ ir3_instr_add_dep(struct ir3_instruction *instr, struct ir3_instruction *dep)
|
|||
return;
|
||||
}
|
||||
|
||||
array_insert(instr, instr->deps, dep);
|
||||
array_insert(instr->block->shader, instr->deps, dep);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
|||
|
|
@ -5725,7 +5725,7 @@ ir3_compile_shader_nir(struct ir3_compiler *compiler,
|
|||
for (unsigned i = 0; i < outputs_count; i++)
|
||||
__ssa_src(chmask, outputs[i], 0)->num = regids[i];
|
||||
|
||||
chmask->end.outidxs = ralloc_array(chmask, unsigned, outputs_count);
|
||||
chmask->end.outidxs = linear_alloc_array(ir->lin_ctx, unsigned, outputs_count);
|
||||
memcpy(chmask->end.outidxs, outidxs, sizeof(unsigned) * outputs_count);
|
||||
|
||||
array_insert(ctx->block, ctx->block->keeps, chmask);
|
||||
|
|
@ -5816,7 +5816,7 @@ ir3_compile_shader_nir(struct ir3_compiler *compiler,
|
|||
__ssa_src(end, outputs[i], 0);
|
||||
}
|
||||
|
||||
end->end.outidxs = ralloc_array(end, unsigned, outputs_count);
|
||||
end->end.outidxs = linear_alloc_array(ir->lin_ctx, unsigned, outputs_count);
|
||||
memcpy(end->end.outidxs, outidxs, sizeof(unsigned) * outputs_count);
|
||||
|
||||
array_insert(ctx->block, ctx->block->keeps, end);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue