aboutsummaryrefslogtreecommitdiff
path: root/gcc/cfgexpand.c
diff options
context:
space:
mode:
authorKugan Vivekanandarajah <kuganv@linaro.org>2016-09-15 02:03:51 +0000
committerKugan Vivekanandarajah <kugan@gcc.gnu.org>2016-09-15 02:03:51 +0000
commit46aa019a01e8278b12961c63fb457306e09cf13f (patch)
tree39c6eda48c393bf21246adc888f27ba357e13f17 /gcc/cfgexpand.c
parent7332afeab41a577291ea7bc20a353bcab0bd7476 (diff)
downloadgcc-46aa019a01e8278b12961c63fb457306e09cf13f.zip
gcc-46aa019a01e8278b12961c63fb457306e09cf13f.tar.gz
gcc-46aa019a01e8278b12961c63fb457306e09cf13f.tar.bz2
Iterator to visit SSA
Iterator to visit SSA gcc/ChangeLog: 2016-09-15 Kugan Vivekanandarajah <kuganv@linaro.org> * tree-ssanames.h (FOR_EACH_SSA_NAME): New. * cfgexpand.c (update_alias_info_with_stack_vars): Use FOR_EACH_SSA_NAME to iterate over SSA variables. (pass_expand::execute): Likewise. * omp-simd-clone.c (ipa_simd_modify_function_body): Likewise. * tree-cfg.c (dump_function_to_file): Likewise. * tree-into-ssa.c (pass_build_ssa::execute): Likewise. (update_ssa): Likewise. * tree-ssa-alias.c (dump_alias_info): Likewise. * tree-ssa-ccp.c (ccp_finalize): Likewise. * tree-ssa-coalesce.c (build_ssa_conflict_graph): Likewise. (create_outofssa_var_map): Likewise. (coalesce_ssa_name): Likewise. * tree-ssa-operands.c (dump_immediate_uses): Likewise. * tree-ssa-pre.c (compute_avail): Likewise. * tree-ssa-sccvn.c (init_scc_vn): Likewise. (scc_vn_restore_ssa_info): Likewise. (free_scc_vn): Likwise. (run_scc_vn): Likewise. * tree-ssa-structalias.c (compute_points_to_sets): Likewise. * tree-ssa-ter.c (new_temp_expr_table): Likewise. * tree-ssa-copy.c (fini_copy_prop): Likewise. * tree-ssa.c (verify_ssa): Likewise. From-SVN: r240152
Diffstat (limited to 'gcc/cfgexpand.c')
-rw-r--r--gcc/cfgexpand.c38
1 files changed, 17 insertions, 21 deletions
diff --git a/gcc/cfgexpand.c b/gcc/cfgexpand.c
index 130a16b..dfa301d 100644
--- a/gcc/cfgexpand.c
+++ b/gcc/cfgexpand.c
@@ -815,16 +815,15 @@ update_alias_info_with_stack_vars (void)
if (decls_to_partitions)
{
unsigned i;
+ tree name;
hash_set<bitmap> visited;
bitmap temp = BITMAP_ALLOC (&stack_var_bitmap_obstack);
- for (i = 1; i < num_ssa_names; i++)
+ FOR_EACH_SSA_NAME (i, name, cfun)
{
- tree name = ssa_name (i);
struct ptr_info_def *pi;
- if (name
- && POINTER_TYPE_P (TREE_TYPE (name))
+ if (POINTER_TYPE_P (TREE_TYPE (name))
&& ((pi = SSA_NAME_PTR_INFO (name)) != NULL))
add_partitioned_vars_to_ptset (&pi->pt, decls_to_partitions,
&visited, temp);
@@ -6270,16 +6269,15 @@ pass_expand::execute (function *fun)
/* Now propagate the RTL assignment of each partition to the
underlying var of each SSA_NAME. */
- for (i = 1; i < num_ssa_names; i++)
- {
- tree name = ssa_name (i);
+ tree name;
- if (!name
- /* We might have generated new SSA names in
- update_alias_info_with_stack_vars. They will have a NULL
- defining statements, and won't be part of the partitioning,
- so ignore those. */
- || !SSA_NAME_DEF_STMT (name))
+ FOR_EACH_SSA_NAME (i, name, cfun)
+ {
+ /* We might have generated new SSA names in
+ update_alias_info_with_stack_vars. They will have a NULL
+ defining statements, and won't be part of the partitioning,
+ so ignore those. */
+ if (!SSA_NAME_DEF_STMT (name))
continue;
adjust_one_expanded_partition_var (name);
@@ -6288,17 +6286,15 @@ pass_expand::execute (function *fun)
/* Clean up RTL of variables that straddle across multiple
partitions, and check that the rtl of any PARM_DECLs that are not
cleaned up is that of their default defs. */
- for (i = 1; i < num_ssa_names; i++)
+ FOR_EACH_SSA_NAME (i, name, cfun)
{
- tree name = ssa_name (i);
int part;
- if (!name
- /* We might have generated new SSA names in
- update_alias_info_with_stack_vars. They will have a NULL
- defining statements, and won't be part of the partitioning,
- so ignore those. */
- || !SSA_NAME_DEF_STMT (name))
+ /* We might have generated new SSA names in
+ update_alias_info_with_stack_vars. They will have a NULL
+ defining statements, and won't be part of the partitioning,
+ so ignore those. */
+ if (!SSA_NAME_DEF_STMT (name))
continue;
part = var_to_partition (SA.map, name);
if (part == NO_PARTITION)