From cb58d75224c72f9e6ff3e2eb71ba101c9ae8436a Mon Sep 17 00:00:00 2001 From: Timothy Arceri Date: Sun, 18 Dec 2022 12:44:16 +1100 Subject: [PATCH] nir/nir_opt_copy_prop_vars: don't call memset when cloning This makes the pass significantly faster cutting execution time by around 30% in the cts test dEQP-GLES31.functional.ubo.random.all_per_block_buffers.20 This 30% improvement is in addition to all the improvements from the proceeding patches. Reviewed-by: Faith Ekstrand Part-of: --- src/compiler/nir/nir_opt_copy_prop_vars.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/compiler/nir/nir_opt_copy_prop_vars.c b/src/compiler/nir/nir_opt_copy_prop_vars.c index 11e82875900..d9d1f66e694 100644 --- a/src/compiler/nir/nir_opt_copy_prop_vars.c +++ b/src/compiler/nir/nir_opt_copy_prop_vars.c @@ -1365,8 +1365,8 @@ clone_copies(struct copy_prop_var_state *state, struct copies *clones, { hash_table_foreach(&copies->ht, entry) { struct copies_dynarray *cloned_copies = get_copies_dynarray(state); - util_dynarray_clone(&cloned_copies->arr, state->mem_ctx, - &((struct copies_dynarray *) entry->data)->arr); + util_dynarray_append_dynarray(&cloned_copies->arr, + &((struct copies_dynarray *) entry->data)->arr); _mesa_hash_table_insert(&clones->ht, entry->key, cloned_copies); }