/* Coalesce SSA_NAMES together for the out-of-ssa pass.
- Copyright (C) 2004, 2005, 2006 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
Contributed by Andrew MacLeod <amacleod@redhat.com>
This file is part of GCC.
/* Equality function for coalesce list hash table. Compare PAIR1 and PAIR2,
- returning TRUE if the two pairs are equivilent. */
+ returning TRUE if the two pairs are equivalent. */
static int
coalesce_pair_map_eq (const void *pair1, const void *pair2)
if (create && !pair)
{
gcc_assert (cl->sorted == NULL);
- pair = xmalloc (sizeof (struct coalesce_pair));
+ pair = XNEW (struct coalesce_pair);
pair->first_element = p.first_element;
pair->second_element = p.second_element;
pair->cost = 0;
{
cost_one_pair_p pair;
- pair = xmalloc (sizeof (struct cost_one_pair_d));
+ pair = XNEW (struct cost_one_pair_d);
pair->first_element = p1;
pair->second_element = p2;
pair->next = cl->cost_one_list;
}
-/* Comparison function to allow qsort to sort P1 and P2 in Ascendiong order. */
+/* Comparison function to allow qsort to sort P1 and P2 in Ascending order. */
static int
compare_pairs (const void *p1, const void *p2)
}
-/* Return the next parttition pair to be visited by ITER. */
+/* Return the next partition pair to be visited by ITER. */
static inline coalesce_pair_p
next_coalesce_pair (coalesce_pair_iterator *iter)
/* This represents a conflict graph. Implemented as an array of bitmaps.
- A full matrix isused for conflicts rather than just upper triangular form.
+ A full matrix is used for conflicts rather than just upper triangular form.
this make sit much simpler and faster to perform conflict merges. */
typedef struct ssa_conflicts_d
} * ssa_conflicts_p;
-/* Return a empty new conflict graph for SIZE elements. */
+/* Return an empty new conflict graph for SIZE elements. */
static inline ssa_conflicts_p
ssa_conflicts_new (unsigned size)
/* Build a conflict graph based on LIVEINFO. Any partitions which are in the
- partition view of the var_map liveinfo is based on get entires in the
+ partition view of the var_map liveinfo is based on get entries in the
conflict graph. Only conflicts between ssa_name partitions with the same
- base variableare added. */
+ base variable are added. */
static ssa_conflicts_p
build_ssa_conflict_graph (tree_live_info_p liveinfo)
static inline void
fail_abnormal_edge_coalesce (int x, int y)
{
- fprintf (stderr, "\nUnable to coalesce ssa_names %d and %d ",x, y);
+ fprintf (stderr, "\nUnable to coalesce ssa_names %d and %d",x, y);
fprintf (stderr, " which are marked as MUST COALESCE.\n");
print_generic_expr (stderr, ssa_name (x), TDF_SLIM);
fprintf (stderr, " and ");
if ((e->flags & EDGE_ABNORMAL) == 0)
{
int cost = coalesce_cost_edge (e);
- if (cost == 1 && single_imm_use_p (arg))
+ if (cost == 1 && has_single_use (arg))
add_cost_one_coalesce (cl, ver, SSA_NAME_VERSION (arg));
else
add_coalesce (cl, ver, SSA_NAME_VERSION (arg), cost);
char *end;
unsigned long match;
- if (TREE_CODE (input) != SSA_NAME && !DECL_P (input))
+ if (TREE_CODE (input) != SSA_NAME)
continue;
match = strtoul (constraint, &end, 10);
}
-/* Attempt to coalesce ssa verisons X and Y together using the partition
+/* Attempt to coalesce ssa versions X and Y together using the partition
mapping in MAP and checking conflicts in GRAPH. Output any debug info to
DEBUG, if it is nun-NULL. */
edge e;
edge_iterator ei;
- /* First, coalece all the copie across abnormal edges. These are not placed
- in the coalesce list becase they do not need to be sorted, and simply
+ /* First, coalesce all the copies across abnormal edges. These are not placed
+ in the coalesce list because they do not need to be sorted, and simply
consume extra memory/compilation time in large programs. */
FOR_EACH_BB (bb)