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 (¤t_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
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);
}
}