Commit c82e0b3b by Richard Guenther Committed by Richard Biener

tree-ssa-sccvn.c (copy_nary): New function.

2009-12-18  Richard Guenther  <rguenther@suse.de>

	* tree-ssa-sccvn.c (copy_nary): New function.
	(copy_phis): Likewise.
	(copy_references): Likewise.
	(process_scc): Avoid last iteration by copying the
	optimistic table to the valid table.

From-SVN: r155346
parent d88cf0ce
2009-12-18 Richard Guenther <rguenther@suse.de>
* tree-ssa-sccvn.c (copy_nary): New function.
(copy_phis): Likewise.
(copy_references): Likewise.
(process_scc): Avoid last iteration by copying the
optimistic table to the valid table.
2009-12-17 Jakub Jelinek <jakub@redhat.com>
* dwarf2out.c (loc_descriptor): For SYMBOL_REFs and LABEL_REFs
......@@ -2737,6 +2737,60 @@ sort_scc (VEC (tree, heap) *scc)
compare_ops);
}
/* Insert the no longer used nary *ENTRY to the current hash. */
static int
copy_nary (void **entry, void *data ATTRIBUTE_UNUSED)
{
vn_nary_op_t onary = (vn_nary_op_t) *entry;
size_t size = (sizeof (struct vn_nary_op_s)
- sizeof (tree) * (4 - onary->length));
vn_nary_op_t nary = (vn_nary_op_t) obstack_alloc (&current_info->nary_obstack,
size);
void **slot;
memcpy (nary, onary, size);
slot = htab_find_slot_with_hash (current_info->nary, nary, nary->hashcode,
INSERT);
gcc_assert (!*slot);
*slot = nary;
return 1;
}
/* Insert the no longer used phi *ENTRY to the current hash. */
static int
copy_phis (void **entry, void *data ATTRIBUTE_UNUSED)
{
vn_phi_t ophi = (vn_phi_t) *entry;
vn_phi_t phi = (vn_phi_t) pool_alloc (current_info->phis_pool);
void **slot;
memcpy (phi, ophi, sizeof (*phi));
ophi->phiargs = NULL;
slot = htab_find_slot_with_hash (current_info->phis, phi, phi->hashcode,
INSERT);
*slot = phi;
return 1;
}
/* Insert the no longer used reference *ENTRY to the current hash. */
static int
copy_references (void **entry, void *data ATTRIBUTE_UNUSED)
{
vn_reference_t oref = (vn_reference_t) *entry;
vn_reference_t ref;
void **slot;
ref = (vn_reference_t) pool_alloc (current_info->references_pool);
memcpy (ref, oref, sizeof (*ref));
oref->operands = NULL;
slot = htab_find_slot_with_hash (current_info->references, ref, ref->hashcode,
INSERT);
if (*slot)
free_reference (*slot);
*slot = ref;
return 1;
}
/* Process a strongly connected component in the SSA graph. */
static void
......@@ -2782,10 +2836,12 @@ process_scc (VEC (tree, heap) *scc)
statistics_histogram_event (cfun, "SCC iterations", iterations);
/* Finally, visit the SCC once using the valid table. */
/* Finally, copy the contents of the no longer used optimistic
table to the valid table. */
current_info = valid_info;
for (i = 0; VEC_iterate (tree, scc, i, var); i++)
visit_use (var);
htab_traverse (optimistic_info->nary, copy_nary, NULL);
htab_traverse (optimistic_info->phis, copy_phis, NULL);
htab_traverse (optimistic_info->references, copy_references, NULL);
}
}
......
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