From f211616e5d2a3e711d6c066c91c302b7d4bf2468 Mon Sep 17 00:00:00 2001 From: kugan Date: Thu, 15 Sep 2016 02:03:51 +0000 Subject: Iterator to visit SSA gcc/ChangeLog: 2016-09-15 Kugan Vivekanandarajah * 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@240152 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/cfgexpand.c | 38 +++++++++++++++++--------------------- 1 file changed, 17 insertions(+), 21 deletions(-) (limited to 'gcc/cfgexpand.c') diff --git a/gcc/cfgexpand.c b/gcc/cfgexpand.c index 130a16b1d7d..dfa301de9cc 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 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) -- cgit v1.2.1 From ac29ece21d1243ab39f49fd72ef7c171cf1feaee Mon Sep 17 00:00:00 2001 From: jason Date: Fri, 16 Sep 2016 19:20:44 +0000 Subject: Add inline functions for various bitwise operations. * hwint.h (least_bit_hwi, pow2_or_zerop, pow2p_hwi, ctz_or_zero): New. * hwint.c (exact_log2): Use pow2p_hwi. (ctz_hwi, ffs_hwi): Use least_bit_hwi. * alias.c (memrefs_conflict_p): Use pow2_or_zerop. * builtins.c (get_object_alignment_2, get_object_alignment) (get_pointer_alignment, fold_builtin_atomic_always_lock_free): Use least_bit_hwi. * calls.c (compute_argument_addresses, store_one_arg): Use least_bit_hwi. * cfgexpand.c (expand_one_stack_var_at): Use least_bit_hwi. * combine.c (force_to_mode): Use least_bit_hwi. * emit-rtl.c (set_mem_attributes_minus_bitpos, adjust_address_1): Use least_bit_hwi. * expmed.c (synth_mult, expand_divmod): Use ctz_or_zero, ctz_hwi. (init_expmed_one_conv): Use pow2p_hwi. * fold-const.c (round_up_loc, round_down_loc): Use pow2_or_zerop. (fold_binary_loc): Use pow2p_hwi. * function.c (assign_parm_find_stack_rtl): Use least_bit_hwi. * gimple-fold.c (gimple_fold_builtin_memory_op): Use pow2p_hwi. * gimple-ssa-strength-reduction.c (replace_ref): Use least_bit_hwi. * hsa-gen.c (gen_hsa_addr_with_align, hsa_bitmemref_alignment): Use least_bit_hwi. * ipa-cp.c (ipcp_alignment_lattice::meet_with_1): Use least_bit_hwi. * ipa-prop.c (ipa_modify_call_arguments): Use least_bit_hwi. * omp-low.c (oacc_loop_fixed_partitions) (oacc_loop_auto_partitions): Use least_bit_hwi. * rtlanal.c (nonzero_bits1): Use ctz_or_zero. * stor-layout.c (place_field): Use least_bit_hwi. * tree-pretty-print.c (dump_generic_node): Use pow2p_hwi. * tree-sra.c (build_ref_for_offset): Use least_bit_hwi. * tree-ssa-ccp.c (ccp_finalize): Use least_bit_hwi. * tree-ssa-math-opts.c (bswap_replace): Use least_bit_hwi. * tree-ssa-strlen.c (handle_builtin_memcmp): Use pow2p_hwi. * tree-vect-data-refs.c (vect_analyze_group_access_1) (vect_grouped_store_supported, vect_grouped_load_supported) (vect_permute_load_chain, vect_shift_permute_load_chain) (vect_transform_grouped_load): Use pow2p_hwi. * tree-vect-generic.c (expand_vector_divmod): Use ctz_or_zero. * tree-vect-patterns.c (vect_recog_divmod_pattern): Use ctz_or_zero. * tree-vect-stmts.c (vectorizable_mask_load_store): Use least_bit_hwi. * tsan.c (instrument_expr): Use least_bit_hwi. * var-tracking.c (negative_power_of_two_p): Use pow2_or_zerop. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@240194 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/cfgexpand.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gcc/cfgexpand.c') diff --git a/gcc/cfgexpand.c b/gcc/cfgexpand.c index dfa301de9cc..4190f7f0aed 100644 --- a/gcc/cfgexpand.c +++ b/gcc/cfgexpand.c @@ -1008,7 +1008,7 @@ expand_one_stack_var_at (tree decl, rtx base, unsigned base_align, important, we'll simply use the alignment that is already set. */ if (base == virtual_stack_vars_rtx) offset -= frame_phase; - align = offset & -offset; + align = least_bit_hwi (offset); align *= BITS_PER_UNIT; if (align == 0 || align > base_align) align = base_align; -- cgit v1.2.1