[Mesa-dev] [PATCH] glsl: Remove useless walk of the hash table

Thomas Helland thomashelland90 at gmail.com
Sat Dec 17 16:20:47 UTC 2016


We are removing the entry right beforehand, so this can never succeed.
Tested with a shader-db run. No changes in instruction count.
---
 src/compiler/glsl/opt_copy_propagation.cpp | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/src/compiler/glsl/opt_copy_propagation.cpp b/src/compiler/glsl/opt_copy_propagation.cpp
index 247c498..faed0b2 100644
--- a/src/compiler/glsl/opt_copy_propagation.cpp
+++ b/src/compiler/glsl/opt_copy_propagation.cpp
@@ -306,20 +306,14 @@ ir_copy_propagation_visitor::kill(ir_variable *var)
 
    /* Remove any entries currently in the ACP for this kill. */
    struct hash_entry *entry = _mesa_hash_table_search(acp, var);
    if (entry) {
       _mesa_hash_table_remove(acp, entry);
    }
 
-   hash_table_foreach(acp, entry) {
-      if (var == (ir_variable *) entry->data) {
-         _mesa_hash_table_remove(acp, entry);
-      }
-   }
-
    /* Add the LHS variable to the list of killed variables in this block.
     */
    this->kills->push_tail(new(this->lin_ctx) kill_entry(var));
 }
 
 /**
  * Adds an entry to the available copy list if it's a plain assignment
-- 
2.9.3



More information about the mesa-dev mailing list