summaryrefslogtreecommitdiff
path: root/gcc/tree-ssa.c
diff options
context:
space:
mode:
authordnovillo <dnovillo@138bc75d-0d04-0410-961f-82ee72b054a4>2007-04-11 16:14:06 +0000
committerdnovillo <dnovillo@138bc75d-0d04-0410-961f-82ee72b054a4>2007-04-11 16:14:06 +0000
commitc227f8def1ec1ff3dba7bc6459029e97da4885af (patch)
tree40007b60a5085028843a5b427234f0fd32072b58 /gcc/tree-ssa.c
parent10e1d11768fec298b027d11575e9847febb3ed9a (diff)
downloadgcc-c227f8def1ec1ff3dba7bc6459029e97da4885af.tar.gz
PR 30735
PR 31090 * doc/invoke.texi: Document --params max-aliased-vops and avg-aliased-vops. * tree-ssa-operands.h (get_mpt_for, dump_memory_partitions, debug_memory_partitions): Move to tree-flow.h * params.h (AVG_ALIASED_VOPS): Define. * tree-ssa-alias.c (struct mp_info_def): Remove. Update all users. (mp_info_t): Likewise. (get_mem_sym_stats_for): New. (set_memory_partition): Move from tree-flow-inline.h. (mark_non_addressable): Only clear the set of symbols for the partition if it exists. (dump_memory_partitions): Move from tree-ssa-operands.c (debug_memory_partitions): Likewise. (need_to_partition_p): New. (dump_mem_ref_stats): New. (debug_mem_ref_stats): New. (dump_mem_sym_stats): New. (debug_mem_sym_stats): New. (update_mem_sym_stats_from_stmt): New. (compare_mp_info_entries): New. (mp_info_cmp): Call it. (sort_mp_info): Change argument to a list of mem_sym_stats_t objects. (get_mpt_for): Move from tree-ssa-operands.c. (find_partition_for): New. (create_partition_for): Remove. (estimate_vop_reduction): New. (update_reference_counts): New. (build_mp_info): New. (compute_memory_partitions): Refactor. Document new heuristic. Call build_mp_info, update_reference_counts, find_partition_for and estimate_vop_reduction. (compute_may_aliases): Populate virtual operands before calling debugging dumps. (delete_mem_sym_stats): New. (delete_mem_ref_stats): New. (init_mem_ref_stats): New. (init_alias_info): Call it. (maybe_create_global_var): Remove alias_info argument. Get number of call sites and number of pure/const call sites from gimple_mem_ref_stats(). (dump_alias_info): Call dump_memory_partitions first. (dump_points_to_info_for): Show how many times a pointer has been dereferenced. * opts.c (decode_options): For -O2 set --param max-aliased-vops to 500. For -O3 set --param max-aliased-vops to 1000 and --param avg-aliased-vops to 3. * fortran/options.c (gfc_init_options): Remove assignment to MAX_ALIASED_VOPS. * tree-flow-inline.h (gimple_mem_ref_stats): New. * tree-dfa.c (dump_variable): Dump memory reference statistics. Dump NO_ALIAS* settings. (referenced_var_lookup): Tidy. (mem_sym_stats): New. * tree-ssa-copy.c (may_propagate_copy): Return true if DEST and ORIG are different SSA names for a memory partition. * tree-ssa.c (delete_tree_ssa): Call delete_mem_ref_stats. * tree-flow.h (struct mem_sym_stats_d): Define. (mem_sym_stats_t): Define. (struct mem_ref_stats_d): Define. (struct gimple_df): Add field mem_ref_stats. (enum noalias_state): Define. (struct var_ann_d): Add bitfield noalias_state. (mem_sym_stats, delete_mem_ref_stats, dump_mem_ref_stats, debug_mem_ref_stats, debug_memory_partitions, debug_mem_sym_stats): Declare. * tree-ssa-structalias.c (update_alias_info): Update call sites, pure/const call sites and asm sites in structure returned by gimple_mem_ref_stats. Remove local variable IS_POTENTIAL_DEREF. Increase NUM_DEREFS if the memory expression is a potential dereference. Call update_mem_sym_stats_from_stmt. If the memory references memory, call update_mem_sym_stats_from_stmt for all the direct memory symbol references found. (intra_create_variable_infos): Set noalias_state field for pointer arguments according to the value of flag_argument_noalias. * tree-ssa-structalias.h (struct alias_info): Remove fields num_calls_found and num_pure_const_calls_found. (update_mem_sym_stats_from_stmt): Declare. * params.def (PARAM_MAX_ALIASED_VOPS): Change description. Set default value to 100. (PARAM_AVG_ALIASED_VOPS): Define. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@123719 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa.c')
-rw-r--r--gcc/tree-ssa.c47
1 files changed, 47 insertions, 0 deletions
diff --git a/gcc/tree-ssa.c b/gcc/tree-ssa.c
index e7cd4a17c2e..1eb407d52b5 100644
--- a/gcc/tree-ssa.c
+++ b/gcc/tree-ssa.c
@@ -538,6 +538,51 @@ verify_call_clobbering (void)
internal_error ("verify_call_clobbering failed");
}
+
+/* Verify invariants in memory partitions. */
+
+static void
+verify_memory_partitions (void)
+{
+ unsigned i;
+ tree mpt;
+ VEC(tree,heap) *mpt_table = gimple_ssa_operands (cfun)->mpt_table;
+ struct pointer_set_t *partitioned_syms = pointer_set_create ();
+
+ for (i = 0; VEC_iterate (tree, mpt_table, i, mpt); i++)
+ {
+ unsigned j;
+ bitmap_iterator bj;
+
+ if (MPT_SYMBOLS (mpt) == NULL)
+ {
+ error ("Memory partitions should have at least one symbol");
+ debug_variable (mpt);
+ goto err;
+ }
+
+ EXECUTE_IF_SET_IN_BITMAP (MPT_SYMBOLS (mpt), 0, j, bj)
+ {
+ tree var = referenced_var (j);
+ if (pointer_set_insert (partitioned_syms, var))
+ {
+ error ("Partitioned symbols should belong to exactly one "
+ "partition");
+ debug_variable (var);
+ goto err;
+ }
+ }
+ }
+
+ pointer_set_destroy (partitioned_syms);
+
+ return;
+
+err:
+ internal_error ("verify_memory_partitions failed");
+}
+
+
/* Verify the consistency of aliasing information. */
static void
@@ -546,6 +591,7 @@ verify_alias_info (void)
verify_flow_sensitive_alias_info ();
verify_call_clobbering ();
verify_flow_insensitive_alias_info ();
+ verify_memory_partitions ();
}
@@ -835,6 +881,7 @@ delete_tree_ssa (void)
gcc_assert (!need_ssa_update_p ());
}
cfun->gimple_df->aliases_computed_p = false;
+ delete_mem_ref_stats (cfun);
cfun->gimple_df = NULL;
}