/* Routines for liveness in SSA trees.
- Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
Contributed by Andrew MacLeod <amacleod@redhat.com>
This file is part of GCC.
GCC is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
+the Free Software Foundation; either version 3, or (at your option)
any later version.
GCC is distributed in the hope that it will be useful,
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
-along with GCC; see the file COPYING. If not, write to
-the Free Software Foundation, 51 Franklin Street, Fifth Floor,
-Boston, MA 02110-1301, USA. */
+along with GCC; see the file COPYING3. If not see
+<http://www.gnu.org/licenses/>. */
#ifndef _TREE_SSA_LIVE_H
int *partition_to_view;
int *view_to_partition;
- /* Mapping of partition numbers to variables. */
- tree *partition_to_var;
-
/* Current number of partitions in var_map based on the current view. */
unsigned int num_partitions;
} *var_map;
-/* Partition number of a non ssa-name variable. */
-#define VAR_ANN_PARTITION(ann) (ann->partition)
-/* Index iot the basevar table of a non ssa-name variable. */
+/* Index to the basevar table of a non ssa-name variable. */
#define VAR_ANN_BASE_INDEX(ann) (ann->base_index)
extern void delete_var_map (var_map);
extern void dump_var_map (FILE *, var_map);
extern int var_union (var_map, tree, tree);
-extern void change_partition_var (var_map, tree, int);
extern void partition_view_normal (var_map, bool);
extern void partition_view_bitmap (var_map, bitmap, bool);
#ifdef ENABLE_CHECKING
static inline tree
partition_to_var (var_map map, int i)
{
+ tree name;
if (map->view_to_partition)
i = map->view_to_partition[i];
i = partition_find (map->var_partition, i);
- return map->partition_to_var[i];
+ name = ssa_name (i);
+ return name;
}
static inline int
var_to_partition (var_map map, tree var)
{
- var_ann_t ann;
int part;
- if (TREE_CODE (var) == SSA_NAME)
- {
- part = partition_find (map->var_partition, SSA_NAME_VERSION (var));
- if (map->partition_to_view)
- part = map->partition_to_view[part];
- }
- else
- {
- ann = var_ann (var);
- if (ann && ann->out_of_ssa_tag)
- part = VAR_ANN_PARTITION (ann);
- else
- part = NO_PARTITION;
- }
+ gcc_assert (TREE_CODE (var) == SSA_NAME);
+ part = partition_find (map->var_partition, SSA_NAME_VERSION (var));
+ if (map->partition_to_view)
+ part = map->partition_to_view[part];
return part;
}
partitions may be filtered out by a view later. */
static inline void
-register_ssa_partition (var_map map, tree ssa_var)
+register_ssa_partition (var_map map ATTRIBUTE_UNUSED,
+ tree ssa_var ATTRIBUTE_UNUSED)
{
- int version;
-
#if defined ENABLE_CHECKING
register_ssa_partition_check (ssa_var);
#endif
-
- version = SSA_NAME_VERSION (ssa_var);
- if (map->partition_to_var[version] == NULL_TREE)
- map->partition_to_var[version] = ssa_var;
}
/* From tree-ssa-ter.c */
-extern tree *find_replaceable_exprs (var_map);
-extern void dump_replaceable_exprs (FILE *, tree *);
+extern bitmap find_replaceable_exprs (var_map);
+extern void dump_replaceable_exprs (FILE *, bitmap);
#endif /* _TREE_SSA_LIVE_H */