This should reduce overhead since we can hash only once. --- src/compiler/glsl/opt_constant_propagation.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/src/compiler/glsl/opt_constant_propagation.cpp b/src/compiler/glsl/opt_constant_propagation.cpp index 4039512097..553de9c803 100644 --- a/src/compiler/glsl/opt_constant_propagation.cpp +++ b/src/compiler/glsl/opt_constant_propagation.cpp @@ -454,15 +454,17 @@ ir_constant_propagation_visitor::kill(ir_variable *var, unsigned write_mask) /* Add this writemask of the variable to the hash table of killed * variables in this block. */ - hash_entry *kill_hash_entry = _mesa_hash_table_search(this->kills, var); + uint32_t hash = this->kills->key_hash_function(var); + hash_entry *kill_hash_entry = + _mesa_hash_table_search_pre_hashed(this->kills, hash, var); if (kill_hash_entry) { kill_entry *entry = (kill_entry *) kill_hash_entry->data; entry->write_mask |= write_mask; return; } /* Not already in the hash table. Make new entry. */ - _mesa_hash_table_insert(this->kills, var, - new(this->lin_ctx) kill_entry(var, write_mask)); + _mesa_hash_table_insert_pre_hashed(this->kills, hash, var, + new(this->lin_ctx) kill_entry(var, write_mask)); } /** -- 2.13.0 _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev