nir: Switch from ralloc to malloc for NIR instructions.
By replacing the 48-byte ralloc header with our exec_node gc_node (16 bytes), runtime of shader-db on my system across this series drops -4.21738% +/- 1.47757% (n=5). Inspired by discussion on #5034. Reviewed-by: Matt Turner <mattst88@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11776>
This commit is contained in:
@@ -550,7 +550,7 @@ read_src(read_ctx *ctx, nir_src *src, void *mem_ctx)
|
||||
src->reg.reg = read_lookup_object(ctx, header.any.object_idx);
|
||||
src->reg.base_offset = blob_read_uint32(ctx->blob);
|
||||
if (header.any.is_indirect) {
|
||||
src->reg.indirect = ralloc(mem_ctx, nir_src);
|
||||
src->reg.indirect = malloc(sizeof(nir_src));
|
||||
read_src(ctx, src->reg.indirect, mem_ctx);
|
||||
} else {
|
||||
src->reg.indirect = NULL;
|
||||
@@ -770,7 +770,7 @@ read_dest(read_ctx *ctx, nir_dest *dst, nir_instr *instr,
|
||||
dst->reg.reg = read_object(ctx);
|
||||
dst->reg.base_offset = blob_read_uint32(ctx->blob);
|
||||
if (dest.reg.is_indirect) {
|
||||
dst->reg.indirect = ralloc(instr, nir_src);
|
||||
dst->reg.indirect = malloc(sizeof(nir_src));
|
||||
read_src(ctx, dst->reg.indirect, instr);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user