nir/nir_opt_copy_prop_vars: don't call memset when cloning
authorTimothy Arceri <tarceri@itsqueeze.com>
Sun, 18 Dec 2022 01:44:16 +0000 (12:44 +1100)
committerMarge Bot <emma+marge@anholt.net>
Thu, 16 Feb 2023 23:31:59 +0000 (23:31 +0000)
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 <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20381>

src/compiler/nir/nir_opt_copy_prop_vars.c

index 11e8287..d9d1f66 100644 (file)
@@ -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);
    }