common.opt (ftree-combine-temps): Remove.
* common.opt (ftree-combine-temps): Remove. * tree-outof-ssa.c (SSANORM_COMBINE_TEMPS): Remove. (coalesce_ssa_name): Don't check for combine-temps. (coalesce_vars): Remove. (check_replaceable): Use num_imm_uses. (remove_ssa_form, insert_backedge_copies, rewrite_out_of_ssa): Don't check for combine-temps. (rewrite_out_of_ssa): Never create a ref_count in the var_map. * tree-ssa-copyrename.c (copy_rename_partition_coalesce): Change parms to register_ssa_partition calls. * tree-ssa-live.c (register_ssa_partition): Remove prototype. (init_var_map, delete_var_map): remove refernces to ref_count. (create_ssa_var_map): Never calculate a ref count. (type_var_init): Remove. * tree-ssa-live.h (typedef struct _var_map): Remove ref_count. (SSA_VAR_MAP_REF_COUNT): Delete. (create_ssa_var_map): Change Prototype to have no parameters. (version_ref_count): Delete. (register_ssa_partition): Remove 'is_use' paramater and don't set the ref_count vector. (type_var_num, type_var, type_var_first_partition, type_var_next_partition, type_var_dump, type_var_delete, type_var_remove_partition, type_var_find, type_var_compact, type_var_decompact): Remove. * gcc.dg/max-1.c: Remove reference to -fno-tree-lrs option. From-SVN: r119409
This commit is contained in:
parent
35e3ced91a
commit
7c6a62dd39
8 changed files with 55 additions and 388 deletions
|
@ -1,3 +1,30 @@
|
|||
2006-12-01 Andrew MacLeod <amacleod@redhat.com>
|
||||
|
||||
* common.opt (ftree-combine-temps): Remove.
|
||||
* tree-outof-ssa.c (SSANORM_COMBINE_TEMPS): Remove.
|
||||
(coalesce_ssa_name): Don't check for combine-temps.
|
||||
(coalesce_vars): Remove.
|
||||
(check_replaceable): Use num_imm_uses.
|
||||
(remove_ssa_form, insert_backedge_copies, rewrite_out_of_ssa): Don't
|
||||
check for combine-temps.
|
||||
(rewrite_out_of_ssa): Never create a ref_count in the var_map.
|
||||
* tree-ssa-copyrename.c (copy_rename_partition_coalesce): Change parms
|
||||
to register_ssa_partition calls.
|
||||
* tree-ssa-live.c (register_ssa_partition): Remove prototype.
|
||||
(init_var_map, delete_var_map): remove refernces to ref_count.
|
||||
(create_ssa_var_map): Never calculate a ref count.
|
||||
(type_var_init): Remove.
|
||||
* tree-ssa-live.h (typedef struct _var_map): Remove ref_count.
|
||||
(SSA_VAR_MAP_REF_COUNT): Delete.
|
||||
(create_ssa_var_map): Change Prototype to have no parameters.
|
||||
(version_ref_count): Delete.
|
||||
(register_ssa_partition): Remove 'is_use' paramater and don't set the
|
||||
ref_count vector.
|
||||
(type_var_num, type_var, type_var_first_partition,
|
||||
type_var_next_partition, type_var_dump, type_var_delete,
|
||||
type_var_remove_partition, type_var_find, type_var_compact,
|
||||
type_var_decompact): Remove.
|
||||
|
||||
2006-12-01 Bernd Schmidt <bernd.schmidt@analog.com>
|
||||
|
||||
* config/bfin/bfin.md (pushsi_insn, popsi_insn): Set correct addrtype
|
||||
|
|
|
@ -929,10 +929,6 @@ ftree-ch
|
|||
Common Report Var(flag_tree_ch)
|
||||
Enable loop header copying on trees
|
||||
|
||||
ftree-combine-temps
|
||||
Common Report Var(flag_tree_combine_temps)
|
||||
Coalesce memory temporaries in the SSA->normal pass
|
||||
|
||||
ftree-copyrename
|
||||
Common Report Var(flag_tree_copyrename)
|
||||
Replace SSA temporaries with better names in copies
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
2006-12-01 Andrew MacLeod <amacleod@redhat.com>
|
||||
|
||||
* gcc.dg/max-1.c: Remove reference to -fno-tree-lrs option.
|
||||
|
||||
2006-12-01 Ryan Mansfield <rmansfield@qnx.com>
|
||||
|
||||
PR c++/29066
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
/* PR middle-end/18548 */
|
||||
/* Test case reduced by Andrew Pinski <pinskia@physics.uc.edu> */
|
||||
/* { dg-do run } */
|
||||
/* { dg-options "-O1 -fno-tree-lrs" } */
|
||||
/* { dg-options "-O1 " } */
|
||||
/* Option -fno-tree-lrs removed By Andrew MacLeod since it is no longer
|
||||
supported in the compiler beginning with GCC 4.3. */
|
||||
/* m32c has varying sized pointers */
|
||||
/* { dg-skip-if "" { "m32c-*-*" } { "*" } { "-mcpu=m32c" "-mcpu=m32cm" } } */
|
||||
|
||||
|
|
|
@ -51,7 +51,6 @@ Boston, MA 02110-1301, USA. */
|
|||
/* Flags to pass to remove_ssa_form. */
|
||||
|
||||
#define SSANORM_PERFORM_TER 0x1
|
||||
#define SSANORM_COMBINE_TEMPS 0x2
|
||||
#define SSANORM_COALESCE_PARTITIONS 0x4
|
||||
|
||||
/* Used to hold all the components required to do SSA PHI elimination.
|
||||
|
@ -874,11 +873,8 @@ coalesce_ssa_name (var_map map, int flags)
|
|||
SET_BIT (live, x);
|
||||
}
|
||||
|
||||
if ((flags & SSANORM_COMBINE_TEMPS) == 0)
|
||||
{
|
||||
delete_tree_live_info (liveinfo);
|
||||
liveinfo = NULL;
|
||||
}
|
||||
delete_tree_live_info (liveinfo);
|
||||
liveinfo = NULL;
|
||||
|
||||
/* Assign root variable as partition representative for each live on entry
|
||||
partition. */
|
||||
|
@ -1126,121 +1122,6 @@ eliminate_virtual_phis (void)
|
|||
}
|
||||
|
||||
|
||||
/* This routine will coalesce variables in MAP of the same type which do not
|
||||
interfere with each other. LIVEINFO is the live range info for variables
|
||||
of interest. This will both reduce the memory footprint of the stack, and
|
||||
allow us to coalesce together local copies of globals and scalarized
|
||||
component refs. */
|
||||
|
||||
static void
|
||||
coalesce_vars (var_map map, tree_live_info_p liveinfo)
|
||||
{
|
||||
basic_block bb;
|
||||
type_var_p tv;
|
||||
tree var;
|
||||
unsigned x, p, p2;
|
||||
coalesce_list_p cl;
|
||||
conflict_graph graph;
|
||||
|
||||
cl = create_coalesce_list (map);
|
||||
|
||||
/* Merge all the live on entry vectors for coalesced partitions. */
|
||||
for (x = 0; x < num_var_partitions (map); x++)
|
||||
{
|
||||
var = partition_to_var (map, x);
|
||||
p = var_to_partition (map, var);
|
||||
if (p != x)
|
||||
live_merge_and_clear (liveinfo, p, x);
|
||||
}
|
||||
|
||||
/* When PHI nodes are turned into copies, the result of each PHI node
|
||||
becomes live on entry to the block. Mark these now. */
|
||||
FOR_EACH_BB (bb)
|
||||
{
|
||||
tree phi, arg;
|
||||
unsigned p;
|
||||
|
||||
for (phi = phi_nodes (bb); phi; phi = PHI_CHAIN (phi))
|
||||
{
|
||||
p = var_to_partition (map, PHI_RESULT (phi));
|
||||
|
||||
/* Skip virtual PHI nodes. */
|
||||
if (p == (unsigned)NO_PARTITION)
|
||||
continue;
|
||||
|
||||
make_live_on_entry (liveinfo, bb, p);
|
||||
|
||||
/* Each argument is a potential copy operation. Add any arguments
|
||||
which are not coalesced to the result to the coalesce list. */
|
||||
for (x = 0; x < (unsigned)PHI_NUM_ARGS (phi); x++)
|
||||
{
|
||||
arg = PHI_ARG_DEF (phi, x);
|
||||
if (!phi_ssa_name_p (arg))
|
||||
continue;
|
||||
p2 = var_to_partition (map, arg);
|
||||
if (p2 == (unsigned)NO_PARTITION)
|
||||
continue;
|
||||
if (p != p2)
|
||||
{
|
||||
edge e = PHI_ARG_EDGE (phi, x);
|
||||
|
||||
add_coalesce (cl, p, p2,
|
||||
coalesce_cost (EDGE_FREQUENCY (e),
|
||||
maybe_hot_bb_p (bb),
|
||||
EDGE_CRITICAL_P (e)));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Re-calculate live on exit info. */
|
||||
calculate_live_on_exit (liveinfo);
|
||||
|
||||
if (dump_file && (dump_flags & TDF_DETAILS))
|
||||
{
|
||||
fprintf (dump_file, "Live range info for variable memory coalescing.\n");
|
||||
dump_live_info (dump_file, liveinfo, LIVEDUMP_ALL);
|
||||
|
||||
fprintf (dump_file, "Coalesce list from phi nodes:\n");
|
||||
dump_coalesce_list (dump_file, cl);
|
||||
}
|
||||
|
||||
|
||||
tv = type_var_init (map);
|
||||
if (dump_file)
|
||||
type_var_dump (dump_file, tv);
|
||||
type_var_compact (tv);
|
||||
if (dump_file)
|
||||
type_var_dump (dump_file, tv);
|
||||
|
||||
graph = build_tree_conflict_graph (liveinfo, tv, cl);
|
||||
|
||||
type_var_decompact (tv);
|
||||
if (dump_file && (dump_flags & TDF_DETAILS))
|
||||
{
|
||||
fprintf (dump_file, "type var list now looks like:n");
|
||||
type_var_dump (dump_file, tv);
|
||||
|
||||
fprintf (dump_file, "Coalesce list after conflict graph build:\n");
|
||||
dump_coalesce_list (dump_file, cl);
|
||||
}
|
||||
|
||||
sort_coalesce_list (cl);
|
||||
if (dump_file && (dump_flags & TDF_DETAILS))
|
||||
{
|
||||
fprintf (dump_file, "Coalesce list after sorting:\n");
|
||||
dump_coalesce_list (dump_file, cl);
|
||||
}
|
||||
|
||||
coalesce_tpa_members (tv, graph, map, cl,
|
||||
((dump_flags & TDF_DETAILS) ? dump_file : NULL));
|
||||
|
||||
type_var_delete (tv);
|
||||
delete_coalesce_list (cl);
|
||||
}
|
||||
|
||||
|
||||
/* Temporary Expression Replacement (TER)
|
||||
|
||||
Replace SSA version variables during out-of-ssa with their defining
|
||||
|
@ -1553,7 +1434,6 @@ check_replaceable (temp_expr_table_p tab, tree stmt)
|
|||
{
|
||||
tree var, def, basevar;
|
||||
int version;
|
||||
var_map map = tab->map;
|
||||
ssa_op_iter iter;
|
||||
tree call_expr;
|
||||
bitmap def_vars, use_vars;
|
||||
|
@ -1566,7 +1446,7 @@ check_replaceable (temp_expr_table_p tab, tree stmt)
|
|||
if (!def)
|
||||
return false;
|
||||
|
||||
if (version_ref_count (map, def) != 1)
|
||||
if (num_imm_uses (def) != 1)
|
||||
return false;
|
||||
|
||||
/* There must be no V_MAY_DEFS or V_MUST_DEFS. */
|
||||
|
@ -2338,10 +2218,7 @@ remove_ssa_form (var_map map, int flags)
|
|||
|
||||
/* If we are not combining temps, don't calculate live ranges for variables
|
||||
with only one SSA version. */
|
||||
if ((flags & SSANORM_COMBINE_TEMPS) == 0)
|
||||
compact_var_map (map, VARMAP_NO_SINGLE_DEFS);
|
||||
else
|
||||
compact_var_map (map, VARMAP_NORMAL);
|
||||
compact_var_map (map, VARMAP_NO_SINGLE_DEFS);
|
||||
|
||||
if (dump_file && (dump_flags & TDF_DETAILS))
|
||||
dump_var_map (dump_file, map);
|
||||
|
@ -2349,8 +2226,7 @@ remove_ssa_form (var_map map, int flags)
|
|||
liveinfo = coalesce_ssa_name (map, flags);
|
||||
|
||||
/* Make sure even single occurrence variables are in the list now. */
|
||||
if ((flags & SSANORM_COMBINE_TEMPS) == 0)
|
||||
compact_var_map (map, VARMAP_NORMAL);
|
||||
compact_var_map (map, VARMAP_NORMAL);
|
||||
|
||||
if (dump_file && (dump_flags & TDF_DETAILS))
|
||||
{
|
||||
|
@ -2374,16 +2250,6 @@ remove_ssa_form (var_map map, int flags)
|
|||
dump_var_map (dump_file, map);
|
||||
}
|
||||
|
||||
if ((flags & SSANORM_COMBINE_TEMPS) && liveinfo)
|
||||
{
|
||||
coalesce_vars (map, liveinfo);
|
||||
if (dump_file && (dump_flags & TDF_DETAILS))
|
||||
{
|
||||
fprintf (dump_file, "After variable memory coalescing:\n");
|
||||
dump_var_map (dump_file, map);
|
||||
}
|
||||
}
|
||||
|
||||
if (liveinfo)
|
||||
delete_tree_live_info (liveinfo);
|
||||
|
||||
|
@ -2449,8 +2315,7 @@ insert_backedge_copies (void)
|
|||
need a copy statement. */
|
||||
if ((e->flags & EDGE_DFS_BACK)
|
||||
&& (TREE_CODE (arg) != SSA_NAME
|
||||
|| (!flag_tree_combine_temps
|
||||
&& SSA_NAME_VAR (arg) != result_var)))
|
||||
|| SSA_NAME_VAR (arg) != result_var))
|
||||
{
|
||||
tree stmt, name, last = NULL;
|
||||
block_stmt_iterator bsi;
|
||||
|
@ -2505,7 +2370,6 @@ static unsigned int
|
|||
rewrite_out_of_ssa (void)
|
||||
{
|
||||
var_map map;
|
||||
int var_flags = 0;
|
||||
int ssa_flags = 0;
|
||||
|
||||
/* If elimination of a PHI requires inserting a copy on a backedge,
|
||||
|
@ -2524,14 +2388,8 @@ rewrite_out_of_ssa (void)
|
|||
if (dump_file && (dump_flags & TDF_DETAILS))
|
||||
dump_tree_cfg (dump_file, dump_flags & ~TDF_DETAILS);
|
||||
|
||||
/* We cannot allow unssa to un-gimplify trees before we instrument them. */
|
||||
if (flag_tree_ter && !flag_mudflap)
|
||||
var_flags = SSA_VAR_MAP_REF_COUNT;
|
||||
map = create_ssa_var_map ();
|
||||
|
||||
map = create_ssa_var_map (var_flags);
|
||||
|
||||
if (flag_tree_combine_temps)
|
||||
ssa_flags |= SSANORM_COMBINE_TEMPS;
|
||||
if (flag_tree_ter && !flag_mudflap)
|
||||
ssa_flags |= SSANORM_PERFORM_TER;
|
||||
|
||||
|
|
|
@ -121,8 +121,8 @@ copy_rename_partition_coalesce (var_map map, tree var1, tree var2, FILE *debug)
|
|||
gcc_assert (TREE_CODE (var1) == SSA_NAME);
|
||||
gcc_assert (TREE_CODE (var2) == SSA_NAME);
|
||||
|
||||
register_ssa_partition (map, var1, false);
|
||||
register_ssa_partition (map, var2, true);
|
||||
register_ssa_partition (map, var1);
|
||||
register_ssa_partition (map, var2);
|
||||
|
||||
p1 = partition_find (map->var_partition, SSA_NAME_VERSION (var1));
|
||||
p2 = partition_find (map->var_partition, SSA_NAME_VERSION (var2));
|
||||
|
|
|
@ -45,7 +45,6 @@ static tree_live_info_p new_tree_live_info (var_map);
|
|||
static inline void set_if_valid (var_map, bitmap, tree);
|
||||
static inline void add_livein_if_notdef (tree_live_info_p, bitmap,
|
||||
tree, basic_block);
|
||||
static inline void register_ssa_partition (var_map, tree, bool);
|
||||
static inline void add_conflicts_if_valid (tpa_p, conflict_graph,
|
||||
var_map, bitmap, tree);
|
||||
static partition_pair_p find_partition_pair (coalesce_list_p, int, int, bool);
|
||||
|
@ -79,7 +78,6 @@ init_var_map (int size)
|
|||
map->compact_to_partition = NULL;
|
||||
map->num_partitions = size;
|
||||
map->partition_size = size;
|
||||
map->ref_count = NULL;
|
||||
return map;
|
||||
}
|
||||
|
||||
|
@ -95,8 +93,6 @@ delete_var_map (var_map map)
|
|||
free (map->partition_to_compact);
|
||||
if (map->compact_to_partition)
|
||||
free (map->compact_to_partition);
|
||||
if (map->ref_count)
|
||||
free (map->ref_count);
|
||||
free (map);
|
||||
}
|
||||
|
||||
|
@ -402,11 +398,11 @@ remove_unused_locals (void)
|
|||
new partition map is returned. */
|
||||
|
||||
var_map
|
||||
create_ssa_var_map (int flags)
|
||||
create_ssa_var_map (void)
|
||||
{
|
||||
block_stmt_iterator bsi;
|
||||
basic_block bb;
|
||||
tree dest, use;
|
||||
tree var;
|
||||
tree stmt;
|
||||
var_map map;
|
||||
ssa_op_iter iter;
|
||||
|
@ -422,13 +418,6 @@ create_ssa_var_map (int flags)
|
|||
used_in_virtual_ops = BITMAP_ALLOC (NULL);
|
||||
#endif
|
||||
|
||||
if (flags & SSA_VAR_MAP_REF_COUNT)
|
||||
{
|
||||
map->ref_count
|
||||
= (int *)xmalloc (((num_ssa_names + 1) * sizeof (int)));
|
||||
memset (map->ref_count, 0, (num_ssa_names + 1) * sizeof (int));
|
||||
}
|
||||
|
||||
FOR_EACH_BB (bb)
|
||||
{
|
||||
tree phi, arg;
|
||||
|
@ -436,12 +425,12 @@ create_ssa_var_map (int flags)
|
|||
for (phi = phi_nodes (bb); phi; phi = PHI_CHAIN (phi))
|
||||
{
|
||||
int i;
|
||||
register_ssa_partition (map, PHI_RESULT (phi), false);
|
||||
register_ssa_partition (map, PHI_RESULT (phi));
|
||||
for (i = 0; i < PHI_NUM_ARGS (phi); i++)
|
||||
{
|
||||
arg = PHI_ARG_DEF (phi, i);
|
||||
if (TREE_CODE (arg) == SSA_NAME)
|
||||
register_ssa_partition (map, arg, true);
|
||||
register_ssa_partition (map, arg);
|
||||
|
||||
mark_all_vars_used (&PHI_ARG_DEF_TREE (phi, i));
|
||||
}
|
||||
|
@ -452,31 +441,22 @@ create_ssa_var_map (int flags)
|
|||
stmt = bsi_stmt (bsi);
|
||||
|
||||
/* Register USE and DEF operands in each statement. */
|
||||
FOR_EACH_SSA_TREE_OPERAND (use , stmt, iter, SSA_OP_USE)
|
||||
FOR_EACH_SSA_TREE_OPERAND (var, stmt, iter, (SSA_OP_DEF|SSA_OP_USE))
|
||||
{
|
||||
register_ssa_partition (map, use, true);
|
||||
register_ssa_partition (map, var);
|
||||
|
||||
#ifdef ENABLE_CHECKING
|
||||
bitmap_set_bit (used_in_real_ops, DECL_UID (SSA_NAME_VAR (use)));
|
||||
#endif
|
||||
}
|
||||
|
||||
FOR_EACH_SSA_TREE_OPERAND (dest, stmt, iter, SSA_OP_DEF)
|
||||
{
|
||||
register_ssa_partition (map, dest, false);
|
||||
|
||||
#ifdef ENABLE_CHECKING
|
||||
bitmap_set_bit (used_in_real_ops, DECL_UID (SSA_NAME_VAR (dest)));
|
||||
bitmap_set_bit (used_in_real_ops, DECL_UID (SSA_NAME_VAR (var)));
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef ENABLE_CHECKING
|
||||
/* Validate that virtual ops don't get used in funny ways. */
|
||||
FOR_EACH_SSA_TREE_OPERAND (use, stmt, iter,
|
||||
FOR_EACH_SSA_TREE_OPERAND (var, stmt, iter,
|
||||
SSA_OP_VIRTUAL_USES | SSA_OP_VMUSTDEF)
|
||||
{
|
||||
bitmap_set_bit (used_in_virtual_ops,
|
||||
DECL_UID (SSA_NAME_VAR (use)));
|
||||
DECL_UID (SSA_NAME_VAR (var)));
|
||||
}
|
||||
|
||||
#endif /* ENABLE_CHECKING */
|
||||
|
@ -1069,73 +1049,6 @@ root_var_init (var_map map)
|
|||
}
|
||||
|
||||
|
||||
/* Initialize a type_var structure which associates all the partitions in MAP
|
||||
of the same type to the type node's index. Volatiles are ignored. */
|
||||
|
||||
type_var_p
|
||||
type_var_init (var_map map)
|
||||
{
|
||||
type_var_p tv;
|
||||
int x, y, p;
|
||||
int num_partitions = num_var_partitions (map);
|
||||
tree t;
|
||||
sbitmap seen;
|
||||
|
||||
tv = tpa_init (map);
|
||||
if (!tv)
|
||||
return NULL;
|
||||
|
||||
seen = sbitmap_alloc (num_partitions);
|
||||
sbitmap_zero (seen);
|
||||
|
||||
for (x = num_partitions - 1; x >= 0; x--)
|
||||
{
|
||||
t = partition_to_var (map, x);
|
||||
|
||||
/* Disallow coalescing of these types of variables. */
|
||||
if (!t
|
||||
|| TREE_THIS_VOLATILE (t)
|
||||
|| TREE_CODE (t) == RESULT_DECL
|
||||
|| TREE_CODE (t) == PARM_DECL
|
||||
|| (DECL_P (t)
|
||||
&& (DECL_REGISTER (t)
|
||||
|| !DECL_IGNORED_P (t)
|
||||
|| DECL_RTL_SET_P (t))))
|
||||
continue;
|
||||
|
||||
p = var_to_partition (map, t);
|
||||
|
||||
gcc_assert (p != NO_PARTITION);
|
||||
|
||||
/* If partitions have been coalesced, only add the representative
|
||||
for the partition to the list once. */
|
||||
if (TEST_BIT (seen, p))
|
||||
continue;
|
||||
SET_BIT (seen, p);
|
||||
t = TREE_TYPE (t);
|
||||
|
||||
/* Find the list for this type. */
|
||||
for (y = 0; y < tv->num_trees; y++)
|
||||
if (t == VEC_index (tree, tv->trees, y))
|
||||
break;
|
||||
if (y == tv->num_trees)
|
||||
{
|
||||
tv->num_trees++;
|
||||
VEC_safe_push (tree, heap, tv->trees, t);
|
||||
VEC_safe_push (int, heap, tv->first_partition, p);
|
||||
}
|
||||
else
|
||||
{
|
||||
tv->next_partition[p] = VEC_index (int, tv->first_partition, y);
|
||||
VEC_replace (int, tv->first_partition, y, p);
|
||||
}
|
||||
tv->partition_to_tree_map[p] = y;
|
||||
}
|
||||
sbitmap_free (seen);
|
||||
return tv;
|
||||
}
|
||||
|
||||
|
||||
/* Hash function for 2 integer coalesce pairs. */
|
||||
#define COALESCE_HASH_FN(R1, R2) ((R2) * ((R2) - 1) / 2 + (R1))
|
||||
|
||||
|
|
|
@ -44,9 +44,6 @@ typedef struct _var_map
|
|||
|
||||
/* Original partition size. */
|
||||
unsigned int partition_size;
|
||||
|
||||
/* Reference count, if required. */
|
||||
int *ref_count;
|
||||
} *var_map;
|
||||
|
||||
#define VAR_ANN_PARTITION(ann) (ann->partition)
|
||||
|
@ -74,11 +71,9 @@ static inline tree var_to_partition_to_var (var_map, tree);
|
|||
static inline tree partition_to_var (var_map, int);
|
||||
static inline int var_to_partition (var_map, tree);
|
||||
static inline tree version_to_var (var_map, int);
|
||||
static inline int version_ref_count (var_map, tree);
|
||||
static inline void register_ssa_partition (var_map, tree, bool);
|
||||
static inline void register_ssa_partition (var_map, tree);
|
||||
|
||||
#define SSA_VAR_MAP_REF_COUNT 0x01
|
||||
extern var_map create_ssa_var_map (int);
|
||||
extern var_map create_ssa_var_map (void);
|
||||
|
||||
/* Number of partitions in MAP. */
|
||||
|
||||
|
@ -89,17 +84,6 @@ num_var_partitions (var_map map)
|
|||
}
|
||||
|
||||
|
||||
/* Return the reference count for SSA_VAR's partition in MAP. */
|
||||
|
||||
static inline int
|
||||
version_ref_count (var_map map, tree ssa_var)
|
||||
{
|
||||
int version = SSA_NAME_VERSION (ssa_var);
|
||||
gcc_assert (map->ref_count);
|
||||
return map->ref_count[version];
|
||||
}
|
||||
|
||||
|
||||
/* Given partition index I from MAP, return the variable which represents that
|
||||
partition. */
|
||||
|
||||
|
@ -176,7 +160,7 @@ var_to_partition_to_var (var_map map, tree var)
|
|||
later. */
|
||||
|
||||
static inline void
|
||||
register_ssa_partition (var_map map, tree ssa_var, bool is_use)
|
||||
register_ssa_partition (var_map map, tree ssa_var)
|
||||
{
|
||||
int version;
|
||||
|
||||
|
@ -185,9 +169,6 @@ register_ssa_partition (var_map map, tree ssa_var, bool is_use)
|
|||
#endif
|
||||
|
||||
version = SSA_NAME_VERSION (ssa_var);
|
||||
if (is_use && map->ref_count)
|
||||
map->ref_count[version]++;
|
||||
|
||||
if (map->partition_to_var[version] == NULL_TREE)
|
||||
map->partition_to_var[SSA_NAME_VERSION (ssa_var)] = ssa_var;
|
||||
}
|
||||
|
@ -551,120 +532,6 @@ root_var_decompact (root_var_p rv)
|
|||
}
|
||||
|
||||
|
||||
/* A TYPE_VAR object is similar to a root_var object, except this associates
|
||||
partitions with their type rather than their root variable. This is used to
|
||||
coalesce memory locations based on type. */
|
||||
|
||||
typedef tpa_p type_var_p;
|
||||
|
||||
static inline tree type_var (type_var_p, int);
|
||||
static inline int type_var_first_partition (type_var_p, int);
|
||||
static inline int type_var_next_partition (type_var_p, int);
|
||||
static inline int type_var_num (type_var_p);
|
||||
static inline void type_var_dump (FILE *, type_var_p);
|
||||
static inline void type_var_remove_partition (type_var_p, int, int);
|
||||
static inline void type_var_delete (type_var_p);
|
||||
static inline int type_var_find (type_var_p, int);
|
||||
static inline int type_var_compact (type_var_p);
|
||||
static inline void type_var_decompact (type_var_p);
|
||||
|
||||
extern type_var_p type_var_init (var_map);
|
||||
|
||||
/* Value returned when there is no partitions associated with a list. */
|
||||
#define TYPE_VAR_NONE TPA_NONE
|
||||
|
||||
|
||||
/* Return the number of distinct type lists in TV. */
|
||||
|
||||
static inline int
|
||||
type_var_num (type_var_p tv)
|
||||
{
|
||||
return tpa_num_trees (tv);
|
||||
}
|
||||
|
||||
|
||||
/* Return the type of list I in TV. */
|
||||
|
||||
static inline tree
|
||||
type_var (type_var_p tv, int i)
|
||||
{
|
||||
return tpa_tree (tv, i);
|
||||
}
|
||||
|
||||
|
||||
/* Return the first partition belonging to type list I in TV. */
|
||||
|
||||
static inline int
|
||||
type_var_first_partition (type_var_p tv, int i)
|
||||
{
|
||||
return tpa_first_partition (tv, i);
|
||||
}
|
||||
|
||||
|
||||
/* Return the next partition after partition I in a type list within TV. */
|
||||
|
||||
static inline int
|
||||
type_var_next_partition (type_var_p tv, int i)
|
||||
{
|
||||
return tpa_next_partition (tv, i);
|
||||
}
|
||||
|
||||
|
||||
/* Send debug info for type_var object TV to file F. */
|
||||
|
||||
static inline void
|
||||
type_var_dump (FILE *f, type_var_p tv)
|
||||
{
|
||||
fprintf (f, "\nType Var dump\n");
|
||||
tpa_dump (f, tv);
|
||||
fprintf (f, "\n");
|
||||
}
|
||||
|
||||
|
||||
/* Delete type_var object TV. */
|
||||
|
||||
static inline void
|
||||
type_var_delete (type_var_p tv)
|
||||
{
|
||||
tpa_delete (tv);
|
||||
}
|
||||
|
||||
|
||||
/* Remove partition PARTITION_INDEX from type list TYPE_INDEX in TV. */
|
||||
|
||||
static inline void
|
||||
type_var_remove_partition (type_var_p tv, int type_index, int partition_index)
|
||||
{
|
||||
tpa_remove_partition (tv, type_index, partition_index);
|
||||
}
|
||||
|
||||
|
||||
/* Return the type index in TV for the list partition I is in. */
|
||||
|
||||
static inline int
|
||||
type_var_find (type_var_p tv, int i)
|
||||
{
|
||||
return tpa_find_tree (tv, i);
|
||||
}
|
||||
|
||||
|
||||
/* Hide single element lists in TV. */
|
||||
|
||||
static inline int
|
||||
type_var_compact (type_var_p tv)
|
||||
{
|
||||
return tpa_compact (tv);
|
||||
}
|
||||
|
||||
|
||||
/* Expose single element lists in TV. */
|
||||
|
||||
static inline void
|
||||
type_var_decompact (type_var_p tv)
|
||||
{
|
||||
tpa_decompact (tv);
|
||||
}
|
||||
|
||||
/* This set of routines implements a coalesce_list. This is an object which
|
||||
is used to track pairs of partitions which are desirable to coalesce
|
||||
together at some point. Costs are associated with each pair, and when
|
||||
|
|
Loading…
Add table
Reference in a new issue