- if (entry) {
- if (entry->data != impl)
- entry->data = NULL;
- } else {
- _mesa_hash_table_insert(var_func_table, var, impl);
- }
+static bool
+mark_global_var_uses_block(nir_block *block, nir_function_impl *impl,
+ struct hash_table *var_func_table)
+{
+ nir_foreach_instr(instr, block) {
+ if (instr->type == nir_instr_type_deref) {
+ nir_deref_instr *deref = nir_instr_as_deref(instr);
+ if (deref->deref_type == nir_deref_type_var)
+ register_var_use(deref->var, impl, var_func_table);