Commit 7c514720 by Kazu Hirata Committed by Kazu Hirata

cselib.c (hash_table): Rename to cselib_hash_table.

	* cselib.c (hash_table): Rename to cselib_hash_table.
	(cselib_clear_table, discard_useless_values,
	remove_useless_values, cselib_lookup_mem, cselib_lookup,
	cselib_init, cselib_finish): Adjust uses of hash_table.

From-SVN: r109716
parent 9e281320
2006-01-15 Kazu Hirata <kazu@codesourcery.com>
* cselib.c (hash_table): Rename to cselib_hash_table.
(cselib_clear_table, discard_useless_values,
remove_useless_values, cselib_lookup_mem, cselib_lookup,
cselib_init, cselib_finish): Adjust uses of hash_table.
2006-01-14 Kazu Hirata <kazu@codesourcery.com> 2006-01-14 Kazu Hirata <kazu@codesourcery.com>
PR tree-optimization/25485 PR tree-optimization/25485
......
...@@ -74,7 +74,7 @@ static void cselib_record_sets (rtx); ...@@ -74,7 +74,7 @@ static void cselib_record_sets (rtx);
the locations of the entries with the rtx we are looking up. */ the locations of the entries with the rtx we are looking up. */
/* A table that enables us to look up elts by their value. */ /* A table that enables us to look up elts by their value. */
static htab_t hash_table; static htab_t cselib_hash_table;
/* This is a global so we don't have to pass this through every function. /* This is a global so we don't have to pass this through every function.
It is used in new_elt_loc_list to set SETTING_INSN. */ It is used in new_elt_loc_list to set SETTING_INSN. */
...@@ -212,7 +212,7 @@ cselib_clear_table (void) ...@@ -212,7 +212,7 @@ cselib_clear_table (void)
n_used_regs = 0; n_used_regs = 0;
htab_empty (hash_table); htab_empty (cselib_hash_table);
n_useless_values = 0; n_useless_values = 0;
...@@ -332,7 +332,7 @@ discard_useless_values (void **x, void *info ATTRIBUTE_UNUSED) ...@@ -332,7 +332,7 @@ discard_useless_values (void **x, void *info ATTRIBUTE_UNUSED)
if (v->locs == 0) if (v->locs == 0)
{ {
CSELIB_VAL_PTR (v->u.val_rtx) = NULL; CSELIB_VAL_PTR (v->u.val_rtx) = NULL;
htab_clear_slot (hash_table, x); htab_clear_slot (cselib_hash_table, x);
unchain_one_value (v); unchain_one_value (v);
n_useless_values--; n_useless_values--;
} }
...@@ -352,7 +352,7 @@ remove_useless_values (void) ...@@ -352,7 +352,7 @@ remove_useless_values (void)
do do
{ {
values_became_useless = 0; values_became_useless = 0;
htab_traverse (hash_table, discard_useless_locs, 0); htab_traverse (cselib_hash_table, discard_useless_locs, 0);
} }
while (values_became_useless); while (values_became_useless);
...@@ -367,7 +367,7 @@ remove_useless_values (void) ...@@ -367,7 +367,7 @@ remove_useless_values (void)
} }
*p = &dummy_val; *p = &dummy_val;
htab_traverse (hash_table, discard_useless_values, 0); htab_traverse (cselib_hash_table, discard_useless_values, 0);
gcc_assert (!n_useless_values); gcc_assert (!n_useless_values);
} }
...@@ -803,7 +803,7 @@ cselib_lookup_mem (rtx x, int create) ...@@ -803,7 +803,7 @@ cselib_lookup_mem (rtx x, int create)
mem_elt = new_cselib_val (++next_unknown_value, mode); mem_elt = new_cselib_val (++next_unknown_value, mode);
add_mem_for_addr (addr, mem_elt, x); add_mem_for_addr (addr, mem_elt, x);
slot = htab_find_slot_with_hash (hash_table, wrap_constant (mode, x), slot = htab_find_slot_with_hash (cselib_hash_table, wrap_constant (mode, x),
mem_elt->value, INSERT); mem_elt->value, INSERT);
*slot = mem_elt; *slot = mem_elt;
return mem_elt; return mem_elt;
...@@ -954,7 +954,7 @@ cselib_lookup (rtx x, enum machine_mode mode, int create) ...@@ -954,7 +954,7 @@ cselib_lookup (rtx x, enum machine_mode mode, int create)
REG_VALUES (i) = new_elt_list (REG_VALUES (i), NULL); REG_VALUES (i) = new_elt_list (REG_VALUES (i), NULL);
} }
REG_VALUES (i)->next = new_elt_list (REG_VALUES (i)->next, e); REG_VALUES (i)->next = new_elt_list (REG_VALUES (i)->next, e);
slot = htab_find_slot_with_hash (hash_table, x, e->value, INSERT); slot = htab_find_slot_with_hash (cselib_hash_table, x, e->value, INSERT);
*slot = e; *slot = e;
return e; return e;
} }
...@@ -967,7 +967,7 @@ cselib_lookup (rtx x, enum machine_mode mode, int create) ...@@ -967,7 +967,7 @@ cselib_lookup (rtx x, enum machine_mode mode, int create)
if (! hashval) if (! hashval)
return 0; return 0;
slot = htab_find_slot_with_hash (hash_table, wrap_constant (mode, x), slot = htab_find_slot_with_hash (cselib_hash_table, wrap_constant (mode, x),
hashval, create ? INSERT : NO_INSERT); hashval, create ? INSERT : NO_INSERT);
if (slot == 0) if (slot == 0)
return 0; return 0;
...@@ -1476,7 +1476,8 @@ cselib_init (bool record_memory) ...@@ -1476,7 +1476,8 @@ cselib_init (bool record_memory)
} }
used_regs = xmalloc (sizeof (*used_regs) * cselib_nregs); used_regs = xmalloc (sizeof (*used_regs) * cselib_nregs);
n_used_regs = 0; n_used_regs = 0;
hash_table = htab_create (31, get_value_hash, entry_and_rtx_equal_p, NULL); cselib_hash_table = htab_create (31, get_value_hash,
entry_and_rtx_equal_p, NULL);
cselib_current_insn_in_libcall = false; cselib_current_insn_in_libcall = false;
} }
...@@ -1490,10 +1491,10 @@ cselib_finish (void) ...@@ -1490,10 +1491,10 @@ cselib_finish (void)
free_alloc_pool (cselib_val_pool); free_alloc_pool (cselib_val_pool);
free_alloc_pool (value_pool); free_alloc_pool (value_pool);
cselib_clear_table (); cselib_clear_table ();
htab_delete (hash_table); htab_delete (cselib_hash_table);
free (used_regs); free (used_regs);
used_regs = 0; used_regs = 0;
hash_table = 0; cselib_hash_table = 0;
n_useless_values = 0; n_useless_values = 0;
next_unknown_value = 0; next_unknown_value = 0;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment