agx/opt_cse: alloc less
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
114f858440
commit
9ca5778f3e
@@ -104,9 +104,10 @@ void
|
||||
agx_opt_cse(agx_context *ctx)
|
||||
{
|
||||
struct set *instr_set = _mesa_set_create(NULL, hash_instr, instrs_equal);
|
||||
agx_index *replacement = malloc(sizeof(agx_index) * ctx->alloc);
|
||||
|
||||
agx_foreach_block(ctx, block) {
|
||||
agx_index *replacement = calloc(sizeof(agx_index), ctx->alloc);
|
||||
memset(replacement, 0, sizeof(agx_index) * ctx->alloc);
|
||||
_mesa_set_clear(instr_set, NULL);
|
||||
|
||||
agx_foreach_instr_in_block(block, instr) {
|
||||
@@ -131,9 +132,8 @@ agx_opt_cse(agx_context *ctx)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
free(replacement);
|
||||
}
|
||||
|
||||
free(replacement);
|
||||
_mesa_set_destroy(instr_set, NULL);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user