Really, we should have some kind of function for copying the whole
table, but this will work for now.
---
 src/compiler/glsl/opt_copy_propagation.cpp | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/compiler/glsl/opt_copy_propagation.cpp 
b/src/compiler/glsl/opt_copy_propagation.cpp
index 247c4988ed..e9f82e0644 100644
--- a/src/compiler/glsl/opt_copy_propagation.cpp
+++ b/src/compiler/glsl/opt_copy_propagation.cpp
@@ -210,7 +210,8 @@ ir_copy_propagation_visitor::handle_if_block(exec_list 
*instructions)
    /* Populate the initial acp with a copy of the original */
    struct hash_entry *entry;
    hash_table_foreach(orig_acp, entry) {
-      _mesa_hash_table_insert(acp, entry->key, entry->data);
+      _mesa_hash_table_insert_pre_hashed(acp, entry->hash,
+                                         entry->key, entry->data);
    }
 
    visit_list_elements(this, instructions);
@@ -259,7 +260,8 @@ ir_copy_propagation_visitor::handle_loop(ir_loop *ir, bool 
keep_acp)
    if (keep_acp) {
       struct hash_entry *entry;
       hash_table_foreach(orig_acp, entry) {
-         _mesa_hash_table_insert(acp, entry->key, entry->data);
+         _mesa_hash_table_insert_pre_hashed(acp, entry->hash,
+                                            entry->key, entry->data);
       }
    }
 
-- 
2.11.0

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to