This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
Hi, this patch, updates the scalar evolution analyzer in order to make it work again after the merge. I have disabled the scev and all data deps analyzers from being triggered by the default. Zdenek, I have enabled by default the loop copy headers as you have asked for. Since some of the vectorizer tests still fail, I will try to solve these problems. * Makefile.in (tree-ssa-dom.o): Depends on cfgloop.h. * tree-flow-inline.h (loop_of_stmt): New function. * tree-ssa-dom.c: Include cfgloop.h. (tree_ssa_dominator_optimize): Detect and finalize the natural loops structure. (simplify_rhs_and_lookup_avail_expr): Verify that the folded operations belong to the same loop. * cfgloop.h (loop): Rewrite comments for the nb_iterations field. * tree-data-ref.c (analyze_all_data_dependences): Increase the size of the dependence graph when computing all the dependences. * tree-optimize.c (init_tree_optimization_passes): Move the pass_scev after the pass_pre. * tree-scalar-evolution.h: Update comments. * tree-scalar-evolution.c (symbolically_analyze, scev_follow_ssa_edge_same_loop, scev_follow_ssa_edge_inner_loop, loop_is_strictly_included_in, scev_analyze_inner_loop_phi, draw_tree_cfg): New functions. (compute_value_on_exit_of_loop): Removed. (analyze_evolution): Mark phi nodes instead of looking into the already_visited array. (analyze_evolution_in_loop): Use scev_follow_ssa_edge_same_loop, scev_follow_ssa_edge_inner_loop. (scev_analyze_modify_expr): Refine the wrap-around case. (scev_follow_ssa_edge): Handle edges to the current and inner loops separately calling scev_follow_ssa_edge_same_loop or scev_follow_ssa_edge_inner_loop. (merge_branches_of_condition_phi_node): Restructure. (set_nb_iterations_in_loop): Add one to the number of iterations. When the loop copy headers is on, we always exit the loop after having executed once its body. (record_dependences_for_opnd): Do not record dependences on variables that are not in the current loop. (pass_scev_depend): Rename the pass from alldd to ddall. * tree-ssa-loop.c (gate_ch): New function. (pass_ch): Use gate_ch. * doc/invoke.texi (-ftree-ch, -fdump-tree-ch): Document flags. (fdump-tree-scev, fdump-tree-ddall): Update names, and comments. * common.opt (ftree-ch): Document. * flags.h (flag_tree_ch): Declare. * opts.c (flag_tree_ch): Set it on by default. (flag_scalar_evolutions, flag_all_data_deps): Turn off by default. (OPT_ftree_ch): Handle this case. * toplev.c (lang_independent_options): Register flag_tree_ch. * ssa-chrec-{01, 10, 30, 31, 32, 33, 34, 35, 36, 52, 53}.c: Update comments. * ssa-chrec-{13, 14}.c: Use call functions for avoid optimisations touching the condition. * ssa-chrec-{01, 06, 09, 10, 13, 14, 17, 24, 25, 26, 27, 28, 30, 33, 36, 38, 39, 41, 43, 46, 47, 51, 52, 53}.c.scev: Adjusted. * ssa-chrec-10.c.ddall ssa-chrec-30.c.ddall ssa-chrec-31.c.ddall ssa-chrec-32.c.ddall ssa-chrec-33.c.ddall ssa-chrec-34.c.ddall ssa-chrec-35.c.ddall ssa-chrec-36.c.ddall ssa-chrec-52.c.ddall: New files. * ssa-chrec-10.c.alldd ssa-chrec-30.c.alldd ssa-chrec-31.c.alldd ssa-chrec-32.c.alldd ssa-chrec-33.c.alldd ssa-chrec-34.c.alldd ssa-chrec-35.c.alldd ssa-chrec-36.c.alldd ssa-chrec-52.c.alldd ssa-chrec-53.c.alldd: Removed. Index: Makefile.in =================================================================== RCS file: /cvs/gcc/gcc/gcc/Makefile.in,v retrieving revision 1.903.2.158.2.9 diff -d -u -p -r1.903.2.158.2.9 Makefile.in --- Makefile.in 28 Jan 2004 21:07:31 -0000 1.903.2.158.2.9 +++ Makefile.in 29 Jan 2004 17:45:35 -0000 @@ -1554,7 +1554,7 @@ tree-ssa.o : tree-ssa.c $(TREE_FLOW_H) $ tree-ssa-dom.o : tree-ssa-dom.c $(TREE_FLOW_H) $(CONFIG_H) $(SYSTEM_H) \ $(RTL_H) $(TREE_H) $(TM_P_H) $(EXPR_H) $(GGC_H) output.h diagnostic.h \ errors.h function.h $(TIMEVAR_H) $(TM_H) coretypes.h $(TREE_DUMP_H) \ - $(BASIC_BLOCK_H) domwalk.h real.h tree-pass.h flags.h + $(BASIC_BLOCK_H) domwalk.h real.h tree-pass.h flags.h cfgloop.h tree-ssanames.o : tree-ssanames.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ $(TM_H) $(TREE_H) varray.h $(GGC_H) gt-tree-ssanames.h tree-phinodes.o : tree-phinodes.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ Index: cfgloop.h =================================================================== RCS file: /cvs/gcc/gcc/gcc/cfgloop.h,v retrieving revision 1.2.4.9.2.6 diff -d -u -p -r1.2.4.9.2.6 cfgloop.h --- cfgloop.h 28 Jan 2004 21:07:32 -0000 1.2.4.9.2.6 +++ cfgloop.h 29 Jan 2004 17:45:35 -0000 @@ -197,8 +197,10 @@ struct loop loops nested inside it. */ int exit_count; - /* The number of probable iterations. This is either an INTERVAL_CHREC - or an INTEGER_CST. */ + /* The probable number of times the loop is executed at runtime. + This is either an INTERVAL_CHREC or an INTEGER_CST. Don't access + this field directly: number_of_iterations_in_loop computes and + caches the computed information in this field. */ tree nb_iterations; }; Index: common.opt =================================================================== RCS file: /cvs/gcc/gcc/gcc/common.opt,v retrieving revision 1.14.2.13.2.5 diff -d -u -p -r1.14.2.13.2.5 common.opt --- common.opt 28 Jan 2004 21:07:33 -0000 1.14.2.13.2.5 +++ common.opt 29 Jan 2004 17:45:35 -0000 @@ -719,6 +719,10 @@ ftree-dominator-opts Common Enable dominator optimizations +ftree-ch +Common +Enable loop copy headers on trees + ftree-loop-optimize Common Enable loop optimizations on trees Index: flags.h =================================================================== RCS file: /cvs/gcc/gcc/gcc/flags.h,v retrieving revision 1.86.2.41.2.4 diff -d -u -p -r1.86.2.41.2.4 flags.h --- flags.h 28 Jan 2004 21:07:33 -0000 1.86.2.41.2.4 +++ flags.h 29 Jan 2004 17:45:36 -0000 @@ -727,6 +727,9 @@ extern int flag_tree_ter; /* Enable dominator optimizations while re-writing into SSA form. */ extern int flag_tree_dom; +/* Enable loop copy headers on tree-ssa. */ +extern int flag_tree_ch; + /* Enable loop optimization on tree-ssa. */ extern int flag_tree_loop; Index: opts.c =================================================================== RCS file: /cvs/gcc/gcc/gcc/opts.c,v retrieving revision 1.31.2.22.2.4 diff -d -u -p -r1.31.2.22.2.4 opts.c --- opts.c 28 Jan 2004 21:07:33 -0000 1.31.2.22.2.4 +++ opts.c 29 Jan 2004 17:45:36 -0000 @@ -541,11 +541,12 @@ decode_options (unsigned int argc, const flag_tree_ccp = 1; flag_tree_dce = 1; flag_tree_dom = 1; + flag_tree_ch = 1; flag_tree_loop = 0; flag_tree_vectorize = 0; flag_tree_pre = 1; - flag_scalar_evolutions = 1; - flag_all_data_deps = 1; + flag_scalar_evolutions = 0; + flag_all_data_deps = 0; flag_tree_ter = 1; flag_tree_sra = 1; } @@ -1455,6 +1456,10 @@ common_handle_option (size_t scode, cons case OPT_ftree_dominator_opts: flag_tree_dom = value; + break; + + case OPT_ftree_ch: + flag_tree_ch = value; break; case OPT_ftree_loop_optimize: Index: toplev.c =================================================================== RCS file: /cvs/gcc/gcc/gcc/toplev.c,v retrieving revision 1.654.2.84.2.5 diff -d -u -p -r1.654.2.84.2.5 toplev.c --- toplev.c 28 Jan 2004 21:07:34 -0000 1.654.2.84.2.5 +++ toplev.c 29 Jan 2004 17:45:36 -0000 @@ -967,6 +967,9 @@ int flag_all_data_deps = 0; /* Enable loop vectorization on trees */ int flag_tree_vectorize = 0; +/* Enable loop copy headers at tree level. */ +int flag_tree_ch = 0; + /* Enable loop optimization on tree-ssa. */ int flag_tree_loop = 0; @@ -1179,6 +1182,7 @@ static const lang_independent_options f_ { "tree-dominator-opts", &flag_tree_dom, 1 }, { "tree-combine-temps", &flag_tree_combine_temps, 1 }, { "tree-ter", &flag_tree_ter, 1 }, + { "tree-ch", &flag_tree_ch, 1 }, { "tree-loop-optimize", &flag_tree_loop, 1 }, { "tree-vectorize", &flag_tree_vectorize, 1} }; Index: tree-data-ref.c =================================================================== RCS file: /cvs/gcc/gcc/gcc/Attic/tree-data-ref.c,v retrieving revision 1.1.2.6 diff -d -u -p -r1.1.2.6 tree-data-ref.c --- tree-data-ref.c 21 Jan 2004 01:10:50 -0000 1.1.2.6 +++ tree-data-ref.c 29 Jan 2004 17:45:36 -0000 @@ -811,8 +811,13 @@ analyze_all_data_dependences (void) varray_type datarefs; varray_type dependence_relations; - VARRAY_GENERIC_PTR_INIT (datarefs, 10, "datarefs"); - VARRAY_GENERIC_PTR_INIT (dependence_relations, 10*10, + /* When computing the whole data dependence graph, this is the + maximum number of nodes that we want to compute. */ + int alldd_max_size = 100; + + VARRAY_GENERIC_PTR_INIT (datarefs, alldd_max_size, "datarefs"); + VARRAY_GENERIC_PTR_INIT (dependence_relations, + alldd_max_size * alldd_max_size, "dependence_relations"); find_data_references (datarefs); Index: tree-optimize.c =================================================================== RCS file: /cvs/gcc/gcc/gcc/tree-optimize.c,v retrieving revision 1.1.4.98.2.7 diff -d -u -p -r1.1.4.98.2.7 tree-optimize.c --- tree-optimize.c 21 Jan 2004 01:10:52 -0000 1.1.4.98.2.7 +++ tree-optimize.c 29 Jan 2004 17:45:36 -0000 @@ -288,7 +288,6 @@ init_tree_optimization_passes (void) NEXT_PASS (pass_profile); NEXT_PASS (pass_lower_complex); NEXT_PASS (pass_sra); - NEXT_PASS (pass_scev); NEXT_PASS (DUP_PASS (pass_dominator)); NEXT_PASS (DUP_PASS (pass_dce)); NEXT_PASS (pass_tail_recursion); @@ -296,6 +295,7 @@ init_tree_optimization_passes (void) NEXT_PASS (pass_fold_builtins); NEXT_PASS (pass_split_crit_edges); NEXT_PASS (pass_pre); + NEXT_PASS (pass_scev); NEXT_PASS (pass_loop); NEXT_PASS (DUP_PASS (pass_dominator)); NEXT_PASS (DUP_PASS (pass_dce)); Index: tree-scalar-evolution.c =================================================================== RCS file: /cvs/gcc/gcc/gcc/Attic/tree-scalar-evolution.c,v retrieving revision 1.1.2.11 diff -d -u -p -r1.1.2.11 tree-scalar-evolution.c --- tree-scalar-evolution.c 21 Jan 2004 18:36:07 -0000 1.1.2.11 +++ tree-scalar-evolution.c 29 Jan 2004 17:45:36 -0000 @@ -157,11 +157,14 @@ static void matched_a_wrap_around (enum static void matched_an_arithmetic_wrap_around (unsigned, tree, tree, tree *, tree *); static inline bool evolution_of_phi_already_analyzed_p (tree); +static tree symbolically_analyze (tree); static void scev_analyze_modify_expr (unsigned, tree, tree, tree, tree *, tree *); -static void scev_follow_ssa_edge (tree, tree); -static tree compute_value_on_exit_of_loop (tree); -static void compute_overall_effect_of_inner_loop (tree, unsigned); +static void scev_follow_ssa_edge (tree, tree); +static void scev_follow_ssa_edge_same_loop (tree, tree); +static void scev_analyze_inner_loop_phi (tree, tree) +static void scev_follow_ssa_edge_inner_loop (tree, tree); +static tree compute_overall_effect_of_inner_loop (tree, unsigned); static inline bool no_ssa_name_in_arguments_of_phi_node (tree); static tree get_loop_phi_node_for_variable (struct loop *, tree); @@ -274,6 +277,18 @@ loop_is_included_in (unsigned a, unsigne loop_from_num (scev_loops, a)); } +/* Determines whether loop A is strictly contained in loop B. */ + +static bool +loop_is_strictly_included_in (unsigned a, unsigned b) +{ + if (a == b) + return false; + + return flow_loop_nested_p (loop_from_num (scev_loops, b), + loop_from_num (scev_loops, a)); +} + /* Observers for the EDGE struct. */ static inline basic_block edge_src (edge); @@ -414,10 +429,23 @@ analyze_evolution (tree version_to_analy "updated" at every iteration of the loop. */ if (loop_phi_node) { - VARRAY_TREE_INIT (already_visited, 5, "already_visited"); + /* Avoid recursions when there are circular phi nodes, as in + gcc/gcc/calls.c:expand_call, where we have the following phis: + + "normal_call_insns_8 = PHI <0B(380), normal_call_insns_9(782)>; + ... + normal_call_insns_9 = PHI <normal_call_insns_8(773), T.1529_2087(777), T.1529_2087(778)>;" + */ + if (PHI_MARKED (loop_phi_node) == 1) + return; + + else + PHI_MARKED (loop_phi_node) = 1; + analyze_initial_condition (loop_phi_node); analyze_evolution_in_loop (loop_phi_node); - varray_clear (already_visited); + + PHI_MARKED (loop_phi_node) = 0; } /* Otherwise, the variable is a temporary (such as those @@ -641,43 +669,49 @@ analyze_evolution_in_loop (tree loop_phi /* Select the edges that enter the loop body. */ if (inner_chain != NULL_TREE - && TREE_CODE (inner_chain) != NOP_EXPR - && (loop_depth (loop_of_stmt (inner_chain)) - >= loop_depth (loop_of_stmt (loop_phi_node)))) + && TREE_CODE (inner_chain) != NOP_EXPR) { - if (SSA_NAME_VAR (arg) - == SSA_NAME_VAR (PHI_RESULT (loop_phi_node))) - scev_follow_ssa_edge (inner_chain, loop_phi_node); - - else + if (loop_of_stmt (inner_chain) == loop_of_stmt (loop_phi_node)) { - /* The phi node is under the form: - "a = phi (..., t, ...)", where t has already - been analyzed symbolically. - testsuite/.../ssa-chrec-36.c */ - tree evolution_function, effect_after_execution; - unsigned loop_nb = loop_num (loop_of_stmt (loop_phi_node)); - - scev_analyze_modify_expr - (loop_nb, - PHI_RESULT (loop_phi_node), - arg, - loop_phi_node, - &evolution_function, - &effect_after_execution); + if (SSA_NAME_VAR (arg) + == SSA_NAME_VAR (PHI_RESULT (loop_phi_node))) + scev_follow_ssa_edge_same_loop (inner_chain, loop_phi_node); - /* Set the evolution_function, but don't update the - effect_after_execution, because the loop-phi-node - has the right initial condition already set, and - its value on exit of the loop is computed after - the computation of the number of iterations. */ - set_scev (0, SSA_NAME_VAR (PHI_RESULT (loop_phi_node)), - evolution_function); + else + { + /* The phi node is under the form: + "a = phi (..., t, ...)", where t has already + been analyzed symbolically. + testsuite/.../ssa-chrec-36.c */ + tree evolution_function, effect_after_execution; + unsigned loop_nb = loop_num (loop_of_stmt (loop_phi_node)); + + scev_analyze_modify_expr + (loop_nb, + PHI_RESULT (loop_phi_node), + arg, + loop_phi_node, + &evolution_function, + &effect_after_execution); + + /* Set the evolution_function, but don't update the + effect_after_execution, because the loop-phi-node + has the right initial condition already set, and + its value on exit of the loop is computed after + the computation of the number of iterations. */ + set_scev (0, SSA_NAME_VAR (PHI_RESULT (loop_phi_node)), + evolution_function); + } } + + else if (loop_is_included_in + (loop_num (loop_of_stmt (inner_chain)), + loop_num (loop_of_stmt (loop_phi_node)))) + scev_follow_ssa_edge_inner_loop (inner_chain, loop_phi_node); } } } - + DBG_S (fprintf (stderr, ")\n")); } @@ -1078,9 +1112,8 @@ matched_an_increment (unsigned loop_nb, /* Recursively construct the SSA path. */ scev_follow_ssa_edge (upper_chain, halting_phi); - + /* Analyze the assignment on the return walk. */ - chrec_before = get_scev (0, var); if (chrec_should_remain_symbolic (chrec_before)) /* KEEP_IT_SYMBOLIC. */ @@ -1129,8 +1162,8 @@ matched_an_exponentiation (unsigned loop /* Recursively construct the SSA path. */ scev_follow_ssa_edge (upper_chain, halting_phi); - /* Then, analyze the assignment on the return walk. */ + /* Analyze the assignment on the return walk. */ chrec_before = get_scev (0, var); if (chrec_should_remain_symbolic (chrec_before)) /* KEEP_IT_SYMBOLIC. */ @@ -1254,22 +1287,40 @@ matched_an_arithmetic_wrap_around (unsig (loop_nb, chrec_before, chrec_top); } -/* Given a loop-phi-node RDEF, determines whether its evolution has - already been analyzed. */ +/* Given a loop phi-node, determines whether its evolution has already + been analyzed. */ static inline bool -evolution_of_phi_already_analyzed_p (tree rdef) +evolution_of_phi_already_analyzed_p (tree loop_phi) { /* Another way to check this property would be: "if all the edges - that enter the loop have been analyzed, then the loop-phi-node - has already been analyzed". */ + that point to definitions contained in the loop have been + analyzed, then the loop phi-node has already been analyzed". */ return (evolution_part_in_loop_num - (get_scev (0, SSA_NAME_VAR (PHI_RESULT (rdef))), - loop_num (loop_of_stmt (rdef))) + (get_scev (0, SSA_NAME_VAR (PHI_RESULT (loop_phi))), + loop_num (loop_of_stmt (loop_phi))) == NULL_TREE); } +/* Analyze VERSION and keep the reconstructed tree under a symbolic + form. */ + +static tree +symbolically_analyze (tree version) +{ + tree def = SSA_NAME_DEF_STMT (version); + + switch (TREE_CODE (def)) + { + case MODIFY_EXPR: + return TREE_OPERAND (def, 1); + + default: + return version; + } +} + /* Helper function for analyzing a modify expression "OPND0 = OPND1" in the context of loop LOOP_NB. The EVOLUTION_FUNCTION is the new evolution function after having analyzed the statement, and the @@ -1340,20 +1391,40 @@ scev_analyze_modify_expr (unsigned loop_ chrec1 = evolution_at_version (loop_nb, opnd1); init_cond = initial_condition (chrec1); - /* If VAR occurs in the initial condition of opnd1 - then the analyzed modify expression is not a - wrap-around: it is just an expression that has - been gimplified using temporary variables. */ - if (expression_contains_variable_p - (init_cond, SSA_NAME_VAR (opnd0))) - analyze_non_gimple_initial_condition - (loop_nb, opnd0, chrec_before, - chrec1, init_cond, - evolution_function, effect_after_execution); - - else - { - /* FIXME wrap_around. */ + /* When the evolution of opnd1 is not yet known, we have to + analyze it before going further. */ + if (chrec1 == opnd1) + { + /* testsuite/.../ssa-chrec-53.c. */ + init_cond = symbolically_analyze (opnd1); + chrec1 = replace_initial_condition (chrec_before, init_cond); + + if (expression_contains_variable_p + (init_cond, SSA_NAME_VAR (opnd0))) + analyze_non_gimple_initial_condition + (loop_nb, opnd0, chrec_before, chrec1, init_cond, + evolution_function, effect_after_execution); + else + { + /* FIXME wrap_around. */ + *effect_after_execution = chrec1; + *evolution_function = reset_evolution_in_loop + (loop_nb, chrec_before, chrec_top); + } + } + + /* If VAR occurs in the initial condition of opnd1 then the + analyzed modify expression is not a wrap-around: it is + just an expression that has been gimplified using + temporary variables. */ + else if (expression_contains_variable_p + (init_cond, SSA_NAME_VAR (opnd0))) + analyze_non_gimple_initial_condition + (loop_nb, opnd0, chrec_before, chrec1, init_cond, + evolution_function, effect_after_execution); + else + { + /* FIXME wrap_around. */ *effect_after_execution = chrec1; *evolution_function = reset_evolution_in_loop (loop_nb, chrec_before, chrec_top); @@ -1455,9 +1526,8 @@ scev_analyze_modify_expr (unsigned loop_ /* Recursively construct the SSA path. */ scev_follow_ssa_edge (upper_chain, halting_phi); - + /* Analyze the assignment on the return walk. */ - chrec_before = get_scev (0, var); if (chrec_should_remain_symbolic (chrec_before)) /* KEEP_IT_SYMBOLIC. */ @@ -1619,25 +1689,40 @@ scev_analyze_modify_expr (unsigned loop_ DBG_S (fprintf (stderr, ")\n")); } -/* This recursive function follows an SSA edge from a loop phi node to - itself, constructing a path that is analyzed on the return - walk. */ +/* Helper function. */ static void scev_follow_ssa_edge (tree rdef, tree halting_phi) { - unsigned rdef_num, rdef_depth; - unsigned halting_num, halting_depth; - if (rdef == NULL_TREE || TREE_CODE (rdef) == NOP_EXPR /* End the recursion when the halting_phi node is reached. */ - || rdef == halting_phi - /* Avoid infinite recursion on bizarre cases. */ - || node_already_visited_by_ssa_path (rdef)) + || rdef == halting_phi) return; + /* Dispatch the call to the right function handler. */ + if (loop_of_stmt (rdef) == loop_of_stmt (halting_phi)) + scev_follow_ssa_edge_same_loop (rdef, halting_phi); + + else + scev_follow_ssa_edge_inner_loop (rdef, halting_phi); +} + +/* This recursive function follows an SSA edge from a loop phi node to + itself, constructing a path that is analyzed on the return walk. + This function is called for each version of a variable in the + current analyzed loop. The number of calls to this function is + equal to the number of versions of the variable in the loop of the + halting_phi, excluding all the versions defined in inner loops. */ + +static void +scev_follow_ssa_edge_same_loop (tree rdef, + tree halting_phi) +{ + unsigned rdef_num, rdef_depth; + unsigned halting_num, halting_depth; + rdef_num = loop_num (loop_of_stmt (rdef)); rdef_depth = loop_depth (loop_of_stmt (rdef)); halting_num = loop_num (loop_of_stmt (halting_phi)); @@ -1650,99 +1735,18 @@ scev_follow_ssa_edge (tree rdef, switch (TREE_CODE (rdef)) { case PHI_NODE: - /* Determine whether the PHI_NODE is a loop phi or a conditional - phi. */ - if (rdef_depth > halting_depth) - { - /* This is a inner-loop-phi-node: the rdef is in an inner loop. - - First, follow the upper chain for determining the initial - conditions from the analysis of the outer loop. Then - analyze the evolution in the inner loop. */ - - int i; - - for (i = 0; i < PHI_NUM_ARGS (rdef); i++) - { - tree arg = PHI_ARG_DEF (rdef, i); - tree upper_branch; - unsigned upper_depth, upper_num; - - if (TREE_CODE (arg) == INTEGER_CST) - { - set_scev (rdef_num, PHI_RESULT (rdef), arg); - break; - } - - upper_branch = SSA_NAME_DEF_STMT (arg); - upper_depth = loop_depth (loop_of_stmt (upper_branch)); - upper_num = loop_num (loop_of_stmt (upper_branch)); - - if (upper_depth < rdef_depth) - { - /* This is an out of analyzed-loop edge. */ - tree res; - - switch (TREE_CODE (upper_branch)) - { - case MODIFY_EXPR: - scev_follow_ssa_edge (upper_branch, halting_phi); - res = evolution_at_version - (upper_num, TREE_OPERAND (upper_branch, 0)); - break; - - case PHI_NODE: - scev_follow_ssa_edge (upper_branch, halting_phi); - res = evolution_at_version - (upper_num, PHI_RESULT (upper_branch)); - break; - - default: - debug_tree (rdef); - res = chrec_top; - } - - set_scev (rdef_num, PHI_RESULT (rdef), - initial_condition (res)); - } - } - - /* Avoid the analysis of the inner loop when it has already - been analyzed: testsuite/.../ssa-chrec-01.c */ - if (evolution_of_phi_already_analyzed_p (rdef)) - analyze_evolution_in_loop (rdef); - - /* After having determined the evolution in the inner loop, - the analyzer computes the overall effect of the inner - loop on the analyzed variable. - - Example: - - | loop 10 times - | i = i + 2 - | endloop - - This loop has the same effect as: - - | i = i + 20 - */ - compute_overall_effect_of_inner_loop (rdef, halting_num); - } - - else - /* RDEF is a CONDITION-phi-node. - - Follow the branches, and record their evolutions. Finally, - merge the collected information and set the approximation - to the main variable. - - FIXME: It is possible to improve the analysis speed by not - following the whole chain to the loop-phi-node. A better - solution is to analyze the evolution only on the portions - of paths that differ, ie. do not analyze n times outside - the if-body. */ - merge_branches_of_condition_phi_node_in_loop (rdef, halting_phi); - + /* RDEF is a CONDITION-phi-node. + + Follow the branches, and record their evolutions. Finally, + merge the collected information and set the approximation to + the main variable. + + FIXME: It is possible to improve the analysis speed by not + following the whole chain to the loop-phi-node. A better + solution is to analyze the evolution only on the portions of + paths that differ, ie. do not analyze n times outside the + if-body. */ + merge_branches_of_condition_phi_node_in_loop (rdef, halting_phi); break; case MODIFY_EXPR: @@ -1773,67 +1777,152 @@ scev_follow_ssa_edge (tree rdef, } } -/* Compute the value of loop_phi_node on exit of the loop. */ +/* Given an inner loop phi-node, follow the upper chain for + determining the initial conditions from the analysis of the outer + loop. Then analyze the evolution in the inner loop. */ -static tree -compute_value_on_exit_of_loop (tree loop_phi_node) +static void +scev_analyze_inner_loop_phi (tree inner_loop_phi, + tree halting_phi) { - tree exit_value, nb_iter; - - DBG_S (fprintf (stderr, "(compute_value_on_exit_of_loop \n")); + int i; - nb_iter = number_of_iterations_in_loop (loop_of_stmt (loop_phi_node)); - if (nb_iter == chrec_top) - exit_value = chrec_top; + if (inner_loop_phi == NULL_TREE) + return; - else + for (i = 0; i < PHI_NUM_ARGS (inner_loop_phi); i++) { - tree overall_effect; - tree evolution_fn; - - /* An example: given the evolution - "{{22, +, 4}_1, +, [1,3]}_2", - - and the fact that the loop 2 runs exactly 6 times, the - overall effect is obtained by evaluating: - - "({{22, +, 4}_1, +, [1,3]}_2 - initial_conditions) (2, 6)" - "({{22, +, 4}_1, +, [1,3]}_2 - 22) (2, 6)" - "{{0, +, 4}_1, +, [1,3]}_2 (2, 6)" - "[6,18]". - */ + tree arg = PHI_ARG_DEF (inner_loop_phi, i); + tree upper_branch; - evolution_fn = get_scev - (0, SSA_NAME_VAR (PHI_RESULT (loop_phi_node))); + if (TREE_CODE (arg) == INTEGER_CST) + { + set_scev (loop_num (loop_of_stmt (inner_loop_phi)), + PHI_RESULT (inner_loop_phi), arg); + break; + } - overall_effect = chrec_apply - (loop_num (loop_of_stmt (loop_phi_node)), - update_initial_condition_to_origin - (evolution_function_in_loop_num - (evolution_fn, loop_num (loop_of_stmt (loop_phi_node)))), - nb_iter); + upper_branch = SSA_NAME_DEF_STMT (arg); + if (TREE_CODE (upper_branch) == NOP_EXPR) + continue; - /* On exit of the loop, the value of the variable is equal to - the sum of its initial condition with the loop's overall - effect. */ - exit_value = chrec_fold_plus - (get_scev (loop_num (loop_of_stmt (loop_phi_node)), - PHI_RESULT (loop_phi_node)), - overall_effect); + if (loop_is_strictly_included_in + (loop_num (loop_of_stmt (inner_loop_phi)), + loop_num (loop_of_stmt (upper_branch)))) + { + tree res; + + switch (TREE_CODE (upper_branch)) + { + case MODIFY_EXPR: + scev_follow_ssa_edge (upper_branch, halting_phi); + res = evolution_at_version + (loop_num (loop_of_stmt (upper_branch)), + TREE_OPERAND (upper_branch, 0)); + break; + + case PHI_NODE: + scev_follow_ssa_edge (upper_branch, halting_phi); + res = evolution_at_version + (loop_num (loop_of_stmt (upper_branch)), + PHI_RESULT (upper_branch)); + break; + + default: + debug_tree (inner_loop_phi); + res = chrec_top; + } + + set_scev (loop_num (loop_of_stmt (inner_loop_phi)), + PHI_RESULT (inner_loop_phi), + initial_condition (res)); + } + } + + /* Avoid the analysis of the inner loop when it has already + been analyzed: testsuite/.../ssa-chrec-01.c */ + if (evolution_of_phi_already_analyzed_p (inner_loop_phi)) + analyze_evolution_in_loop (inner_loop_phi); +} + +/* This recursive function follows an SSA edge from a loop phi node to + itself, constructing a path that is analyzed on the return + walk. */ + +static void +scev_follow_ssa_edge_inner_loop (tree rdef, + tree halting_phi) +{ + /* We have to deal with only three cases in an update expression: + - an inner loop PHI_NODE, + - a conditional PHI_NODE, + - a MODIFY_EXPR. */ + switch (TREE_CODE (rdef)) + { + case PHI_NODE: + /* This is a inner-loop-phi-node. */ + scev_analyze_inner_loop_phi (rdef, halting_phi); - /* A loop phi node has two values: + /* After having determined the evolution in the inner loop, + the analyzer computes the overall effect of the inner + loop on the analyzed variable. - - one exposed to the statements in the inner loop, + Example: - - the other that is seen by the statements after the loop. + | loop 10 times + | i = i + 2 + | endloop - This updates the exit value of the loop's phi node. */ - set_scev_outer_value (PHI_RESULT (loop_phi_node), - exit_value); + This loop has the same effect as: + + | i = i + 20 + */ + compute_overall_effect_of_inner_loop + (PHI_RESULT (rdef), + loop_num (loop_of_stmt (halting_phi))); + break; + + case MODIFY_EXPR: + { + /* This is an inner loop modify-expression. The first step + finds the inner loop phi-node and follows its initial + condition branch. Then the evolution of the inner loop is + computed, and finally the overall effect of this inner loop + on the analyzed variable is computed. */ + tree loop_phi_node = get_loop_phi_node_for_variable + (loop_of_stmt (rdef), SSA_NAME_VAR (TREE_OPERAND (rdef, 0))); + + if (loop_phi_node != NULL_TREE) + { + scev_analyze_inner_loop_phi (loop_phi_node, halting_phi); + compute_overall_effect_of_inner_loop + (TREE_OPERAND (rdef, 0), + loop_num (loop_of_stmt (halting_phi))); + } + + else + { + /* This modify expression is in a loop, but does not have + a loop phi node. It's a quite strange case, don't know + if this case occurs in the SSA IR, but if it happens, I + think that this have to be solved in the same time as + the FIXME wrap_around. */ + tree var = SSA_NAME_VAR (TREE_OPERAND (rdef, 0)); + set_scev (0, var, + reset_evolution_in_loop + (loop_num (loop_of_stmt (halting_phi)), + get_scev (0, var), chrec_top)); + } + break; + } + + default: + /* At this level of abstraction, the program is just a set of + MODIFY_EXPRs and PHI_NODEs. In principle there is no other + node to be handled. */ + abort (); + break; } - - DBG_S (fprintf (stderr, ")\n")); - return exit_value; } /* Compute the overall effect of a loop on a variable. @@ -1841,15 +1930,19 @@ compute_value_on_exit_of_loop (tree loop 2. compute the number of iterations in the loop, 3. compute the value of the variable after crossing the loop. */ -static void -compute_overall_effect_of_inner_loop (tree loop_phi_node, +static tree +compute_overall_effect_of_inner_loop (tree version, unsigned halting_num) { + tree exit_value; tree nb_iter; + struct loop *loop = loop_of_stmt (SSA_NAME_DEF_STMT (version)); + unsigned loop_nb = loop_num (loop); + tree var = SSA_NAME_VAR (version); DBG_S (fprintf (stderr, "(compute_overall_effect_of_inner_loop \n")); - nb_iter = number_of_iterations_in_loop (loop_of_stmt (loop_phi_node)); + nb_iter = number_of_iterations_in_loop (loop); if (nb_iter == chrec_top) { /* If the number of iterations is not known, set the @@ -1878,21 +1971,21 @@ compute_overall_effect_of_inner_loop (tr {5, +, [-oo, +oo]}_1. */ if (halting_num != 0) - { - tree snv = SSA_NAME_VAR (PHI_RESULT (loop_phi_node)); - set_scev (0, snv, - reset_evolution_in_loop (halting_num, - get_scev (0, snv), - chrec_top)); - } + set_scev (0, var, + reset_evolution_in_loop (halting_num, + get_scev (0, var), + chrec_top)); + + exit_value = chrec_top; } else { tree overall_effect; - tree new_evol, exit_value; + tree new_evol; tree evolution_fn; - + tree loop_phi_node; + /* An example: given the evolution "{{22, +, 4}_1, +, [1,3]}_2", @@ -1910,33 +2003,37 @@ compute_overall_effect_of_inner_loop (tr function is: "{{22, +, [10,22]}_1, +, [1,3]}_2". */ - evolution_fn = get_scev - (0, SSA_NAME_VAR (PHI_RESULT (loop_phi_node))); + evolution_fn = get_scev (0, var); overall_effect = chrec_apply - (loop_num (loop_of_stmt (loop_phi_node)), - update_initial_condition_to_origin + (loop_nb, update_initial_condition_to_origin (evolution_function_in_loop_num - (evolution_fn, loop_num (loop_of_stmt (loop_phi_node)))), + (evolution_fn, loop_nb)), nb_iter); /* On exit of the loop, the value of the variable is equal to - the sum of its initial condition with the loop's overall - effect. */ - exit_value = chrec_fold_plus - (get_scev (loop_num (loop_of_stmt (loop_phi_node)), - PHI_RESULT (loop_phi_node)), - overall_effect); + the sum of its initial condition when entering the loop + (ie. the initial condition of the loop phi-node), with the + loop's overall effect. */ + loop_phi_node = get_loop_phi_node_for_variable + (loop_of_stmt (SSA_NAME_DEF_STMT (version)), + SSA_NAME_VAR (version)); - /* A loop phi node has two values: + if (loop_phi_node == NULL_TREE) + exit_value = chrec_top; + + else + exit_value = chrec_fold_plus + (get_scev (loop_nb, PHI_RESULT (loop_phi_node)), overall_effect); + + /* A VERSION has two values: - one exposed to the statements in the inner loop, - the other that is seen by the statements after the loop. This updates the exit value of the loop's phi node. */ - set_scev_outer_value (PHI_RESULT (loop_phi_node), - exit_value); + set_scev_outer_value (version, exit_value); /* We're not interested in the evolution in the outermost scope: loop 0 represents the analyzed function. Maybe in an @@ -1945,36 +2042,30 @@ compute_overall_effect_of_inner_loop (tr of loop indexing. */ if (halting_num != 0) { + unsigned out_loop_nb = loop_num (outer_loop (loop)); + if (TREE_CODE (overall_effect) == EXPONENTIAL_CHREC) /* testsuite/.../ssa-chrec-41.c. */ - new_evol = multiply_evolution - (loop_num (outer_loop (loop_of_stmt (loop_phi_node))), - get_scev (loop_num (loop_of_stmt (loop_phi_node)), - SSA_NAME_VAR - (PHI_RESULT (loop_phi_node))), - overall_effect); - + new_evol = multiply_evolution (out_loop_nb, + get_scev (loop_nb, var), + overall_effect); + else { - unsigned loop_nb = loop_num - (outer_loop (loop_of_stmt (loop_phi_node))); - overall_effect = select_outer_and_current_evolutions - (loop_nb, overall_effect); + (out_loop_nb, overall_effect); - new_evol = add_to_evolution - (loop_nb, - get_scev (loop_num (loop_of_stmt (loop_phi_node)), - SSA_NAME_VAR - (PHI_RESULT (loop_phi_node))), - overall_effect); + new_evol = add_to_evolution (out_loop_nb, + get_scev (loop_nb, var), + overall_effect); } - set_scev (0, SSA_NAME_VAR (PHI_RESULT (loop_phi_node)), - new_evol); + set_scev (0, var, new_evol); } } + DBG_S (fprintf (stderr, ")\n")); + return exit_value; } /* Determines whether the PHI_NODE has SSA_NAMEs in its arguments. */ @@ -2105,7 +2196,6 @@ set_scev (unsigned loop_nb, MI_LOOP_NUM (var_info) = loop_nb; MI_INNER_LOOPS_CHREC (var_info) = chrec; - MI_OUTER_LOOPS_CHREC (var_info) = chrec; } /* Associate the value CHREC exposed to the statements in the inner @@ -2170,7 +2260,8 @@ get_scev (unsigned loop_nb, struct scev_info_str *var_info; tree res = NULL_TREE; - DBG_S (fprintf (stderr, "(get_scev \n")); + DBG_S (fprintf (stderr, "(get_scev \n"); + fprintf (stderr, " (loop_nb = %d)\n", loop_nb)); switch (TREE_CODE (var)) { @@ -2196,7 +2287,7 @@ get_scev (unsigned loop_nb, res = MI_OUTER_LOOPS_CHREC (var_info); if (res == chrec_not_analyzed_yet) - res = compute_value_on_exit_of_loop (SSA_NAME_DEF_STMT (var)); + res = compute_overall_effect_of_inner_loop (var, 0); } break; @@ -2288,7 +2379,7 @@ merge_evolutions (tree original_chrec, /* In the case where there is a single branch, there is no need to merge evolution functions. */ if (nb_branches == 1) - res = VARRAY_TREE (branch_chrecs, 0); + res = chrec_merge (original_chrec, VARRAY_TREE (branch_chrecs, 0)); /* Otherwise merge the different branches. */ else @@ -2320,6 +2411,9 @@ merge_evolutions (tree original_chrec, } } + else + res = original_chrec; + DBG_S (fprintf (stderr, " (evolution_after_merge = "); debug_generic_expr (res); fprintf (stderr, " )\n"); @@ -2338,6 +2432,12 @@ merge_branches_of_condition_phi_node_in_ int i; tree original_chrec, res; varray_type branch_chrecs; + + if (PHI_MARKED (condition_phi) == 1) + return; + + else + PHI_MARKED (condition_phi) = 1; VARRAY_TREE_INIT (branch_chrecs, 2, "branch_chrecs"); original_chrec = get_scev (0, SSA_NAME_VAR (PHI_RESULT (condition_phi))); @@ -2385,31 +2485,40 @@ merge_branches_of_condition_phi_node_in_ res)); varray_clear (branch_chrecs); + PHI_MARKED (condition_phi) = 0; } -/* This function merges the branches of a condition phi node whose - arguments are already analyzed. */ +/* This function merges the branches of a condition phi node, + contained in the outermost loop, and whose arguments are already + analyzed. */ static void merge_branches_of_condition_phi_node (tree condition_phi) { int i; - tree res; + tree res, var, chrec; varray_type branch_chrecs; int loop_nb = loop_num (loop_of_stmt (condition_phi)); VARRAY_TREE_INIT (branch_chrecs, 2, "branch_chrecs"); for (i = 1; i < PHI_NUM_ARGS (condition_phi); i++) - VARRAY_PUSH_TREE - (branch_chrecs, evolution_at_version - (loop_nb, PHI_ARG_DEF (condition_phi, i))); + { + chrec = get_scev (loop_nb, PHI_ARG_DEF (condition_phi, i)); + if (chrec != chrec_not_analyzed_yet) + VARRAY_PUSH_TREE (branch_chrecs, chrec); + else + VARRAY_PUSH_TREE (branch_chrecs, PHI_ARG_DEF (condition_phi, i)); + } - res = merge_evolutions - (evolution_at_version (loop_nb, PHI_ARG_DEF (condition_phi, 0)), - branch_chrecs); + chrec = get_scev (loop_nb, PHI_ARG_DEF (condition_phi, 0)); + if (chrec != chrec_not_analyzed_yet) + res = merge_evolutions (chrec, branch_chrecs); + else + res = merge_evolutions (PHI_ARG_DEF (condition_phi, 0), branch_chrecs); - set_scev (0, SSA_NAME_VAR (PHI_RESULT (condition_phi)), res); + var = SSA_NAME_VAR (PHI_RESULT (condition_phi)); + set_scev (0, var, replace_initial_condition (get_scev (0, var), res)); set_scev (loop_nb, PHI_RESULT (condition_phi), chrec_eval_next_init_cond (loop_nb, res)); @@ -2934,11 +3043,14 @@ static inline tree set_nb_iterations_in_loop (struct loop *loop, tree res) { + /* After the loop copy headers has transformed the code, each loop + runs at least once. */ + res = chrec_fold_plus (res, integer_one_node); DBG_S (fprintf (stderr, " (set_nb_iterations_in_loop = "); debug_generic_expr (res); fprintf (stderr, " )\n"); fprintf (stderr, ")\n")); - + loop->nb_iterations = res; return res; } @@ -3054,7 +3166,9 @@ record_dependences_for_opnd (unsigned lo complete_imperative_list)) SDD_insert (lhs, opnd, sdd_graph); - else + /* Analyze dependences only on the current loop. */ + else if (loop_num (loop_of_stmt (SSA_NAME_DEF_STMT (opnd))) + == loop_nb) record_dependences_for_definition (loop_nb, SSA_NAME_DEF_STMT (opnd), sdd_graph, complete_imperative_list); @@ -3683,6 +3797,26 @@ draw_SDD (varray_type sdd_graph) system ("dotty tree_sdd.dot"); } } + +extern void draw_tree_cfg (void); + +/* Draw the flow graph. */ + +void +draw_tree_cfg (void) +{ + FILE *dump_file; + if (n_basic_blocks > 0) + { + dump_file = fopen ("tree_cfg.dot", "w"); + if (dump_file) + { + tree_cfg2dot (dump_file); + fclose (dump_file); + system ("dotty tree_cfg.dot"); + } + } +} /* The Scalar Data Dependence (SDD) graph is stored in an array by tuples with?the following convention: @@ -4227,7 +4361,7 @@ gate_scev_depend (void) struct tree_opt_pass pass_scev_depend = { - "alldd", /* name */ + "ddall", /* name */ gate_scev_depend, /* gate */ scev_depend, /* execute */ NULL, /* sub */ Index: tree-scalar-evolution.h =================================================================== RCS file: /cvs/gcc/gcc/gcc/Attic/tree-scalar-evolution.h,v retrieving revision 1.1.2.3 diff -d -u -p -r1.1.2.3 tree-scalar-evolution.h --- tree-scalar-evolution.h 18 Jan 2004 11:24:46 -0000 1.1.2.3 +++ tree-scalar-evolution.h 29 Jan 2004 17:45:36 -0000 @@ -45,7 +45,7 @@ extern void finalize_scalar_evolutions_a Example: | a_0 = 0 - | loop + | loop_1 | a_1 = phi (a_0, a_2) | if (a_1 > 9) | goto exit_loop @@ -57,7 +57,7 @@ extern void finalize_scalar_evolutions_a |var | a_0 | a_1 | a_2 | a | |loop_num | 0 | 1 | 1 | 0 | |inner_loops_chrec | 0 | 0 | 1 | {0, +, 1}_1 | - |outer_loops_chrec | 0 | 10 | 1 | {0, +, 1}_1 | + |outer_loops_chrec | 0 | 10 | nay | {0, +, 1}_1 | ------------------------------------------------------------------- A loop phi node (a_1) has two visible values: (see the comments in Index: tree-ssa-dom.c =================================================================== RCS file: /cvs/gcc/gcc/gcc/Attic/tree-ssa-dom.c,v retrieving revision 1.1.2.102.2.1 diff -d -u -p -r1.1.2.102.2.1 tree-ssa-dom.c --- tree-ssa-dom.c 21 Jan 2004 01:10:53 -0000 1.1.2.102.2.1 +++ tree-ssa-dom.c 29 Jan 2004 17:45:36 -0000 @@ -35,6 +35,7 @@ Boston, MA 02111-1307, USA. */ #include "function.h" #include "diagnostic.h" #include "timevar.h" +#include "cfgloop.h" #include "tree-dump.h" #include "tree-flow.h" #include "domwalk.h" @@ -321,6 +322,10 @@ tree_ssa_dominator_optimize (void) edge e; struct dom_walk_data walk_data; tree phi; + struct loops* loops; + + /* Compute the natural loops. */ + loops = loop_optimizer_init (NULL); /* Mark loop edges so we avoid threading across loop boundaries. This may result in transforming natural loop into irreducible @@ -580,6 +585,8 @@ tree_ssa_dominator_optimize (void) /* Remove any unreachable blocks left behind and linearize the CFG. */ cleanup_tree_cfg (); + loop_optimizer_finalize (loops, NULL); + /* Debugging dumps. */ if (tree_dump_file && (tree_dump_flags & TDF_STATS)) dump_dominator_optimization_stats (tree_dump_file); @@ -1644,7 +1651,8 @@ simplify_rhs_and_lookup_avail_expr (stru /* See if the RHS_DEF_STMT has the same form as our statement. */ if (TREE_CODE (rhs_def_stmt) == MODIFY_EXPR - && TREE_CODE (TREE_OPERAND (rhs_def_stmt, 1)) == rhs_code) + && TREE_CODE (TREE_OPERAND (rhs_def_stmt, 1)) == rhs_code + && loop_of_stmt (rhs_def_stmt) == loop_of_stmt (stmt)) { tree rhs_def_operand; @@ -1673,7 +1681,8 @@ simplify_rhs_and_lookup_avail_expr (stru /* See if the RHS_DEF_STMT has the same form as our statement. */ if (TREE_CODE (rhs_def_stmt) == MODIFY_EXPR - && TREE_CODE (TREE_OPERAND (rhs_def_stmt, 1)) == rhs_code) + && TREE_CODE (TREE_OPERAND (rhs_def_stmt, 1)) == rhs_code + && loop_of_stmt (rhs_def_stmt) == loop_of_stmt (stmt)) { tree rhs_def_rhs = TREE_OPERAND (rhs_def_stmt, 1); tree def_stmt_op0 = TREE_OPERAND (rhs_def_rhs, 0); Index: tree-ssa-loop.c =================================================================== RCS file: /cvs/gcc/gcc/gcc/Attic/tree-ssa-loop.c,v retrieving revision 1.1.2.3.2.5 diff -d -u -p -r1.1.2.3.2.5 tree-ssa-loop.c --- tree-ssa-loop.c 25 Jan 2004 20:20:16 -0000 1.1.2.3.2.5 +++ tree-ssa-loop.c 29 Jan 2004 17:45:36 -0000 @@ -217,6 +217,12 @@ gate_loop (void) return flag_tree_loop != 0; } +static bool +gate_ch (void) +{ + return flag_tree_ch != 0; +} + struct tree_opt_pass pass_loop = { "loop", /* name */ @@ -236,7 +242,7 @@ struct tree_opt_pass pass_loop = struct tree_opt_pass pass_ch = { "ch", /* name */ - gate_loop, /* gate */ + gate_ch, /* gate */ copy_loop_headers, /* execute */ NULL, /* sub */ NULL, /* next */ Index: doc/invoke.texi =================================================================== RCS file: /cvs/gcc/gcc/gcc/doc/invoke.texi,v retrieving revision 1.152.2.63.2.4 diff -d -u -p -r1.152.2.63.2.4 invoke.texi --- doc/invoke.texi 21 Jan 2004 01:12:48 -0000 1.152.2.63.2.4 +++ doc/invoke.texi 29 Jan 2004 17:45:37 -0000 @@ -250,7 +250,7 @@ in the following sections. -fdump-tree-optimized@r{[}-@var{n}@r{]} @gol -fdump-tree-inlined@r{[}-@var{n}@r{]} @gol -fdump-tree-cfg -fdump-tree-dot -fdump-tree-alias @gol --fdump-tree-copy-headers @gol +-fdump-tree-ch @gol -fdump-tree-ssa@r{[}-@var{n}@r{]} -fdump-tree-pre@r{[}-@var{n}@r{]} @gol -fdump-tree-ccp@r{[}-@var{n}@r{]} -fdump-tree-dce@r{[}-@var{n}@r{]} @gol -fdump-tree-gimple@r{[}-raw@r{]} -fdump-tree-mudflap@r{[}-@var{n}@r{]} @gol @@ -310,7 +310,7 @@ in the following sections. -ftree-pre -ftree-ccp -ftree-dce -ftree-copyprop @gol -fdisable-tree-ssa -ftree-dominator-opts @gol -fscalar-evolutions -fall-data-deps @gol --ftree-loop-optimize -ftree-sra @gol +-ftree-ch -ftree-loop-optimize -ftree-sra @gol -ftree-vectorize @gol --param @var{name}=@var{value} -O -O0 -O1 -O2 -O3 -Os} @@ -3503,14 +3503,11 @@ made by appending @file{.cfg} to the sou Dump a dot language representation of the control flow graph to a file. The file name is made by appending @file{.dot} to the source file name. -@item copy-headers -@opindex fdump-tree-copy-headers +@item ch +@opindex fdump-tree-ch Dump each function after copying loop headers. The file name is made by appending @file{.ch} to the source file name. -Dump the control flow graph of each function to a file. The file name is -made by appending @file{.cfg} to the source file name. - @item ssa @opindex fdump-tree-ssa Dump SSA related information to a file. The file name is made by appending @@ -3546,15 +3543,15 @@ appending @file{.dce} to the source file Dump each function after adding mudflap instrumentation. The file name is made by appending @file{.mudflap} to the source file name. -@item scalar-evolutions -@opindex fdump-scalar-evolutions +@item scev +@opindex fdump-tree-scev Dump the information gathered by the scalar evolution analyzer. The file name is made by appending @file{.scev} to the source file name. -@item all-data-deps -@opindex fdump-all-data-deps +@item ddall +@opindex fdump-tree-ddall Dump all the data dependence relations. -The file name is made by appending @file{.alldd} to the source file name. +The file name is made by appending @file{.ddall} to the source file name. @item sra @opindex fdump-tree-sra @@ -4326,6 +4323,10 @@ default at -O and higher. Perform dead code elimination (DCE) on trees. This flag is enabled by default at -O and higher. +@item -ftree-ch +Perform loop copy headers on trees. This flag is enabled by +default at -O and higher. + @item -ftree-loop-optimize Perform loop optimization on trees. This flag is enabled by default at -O and higher. @@ -4335,11 +4336,15 @@ Perform loop vectorization on trees. Th default. @item -fscalar-evolutions -Perform the scalar evolution analysis on trees. This analysis extracts -for a variable an approximation of the evolution function. +Analyzes the scalar variables that determine the exit condition of a +loop, and try to determine the number of iterations. This pass is +only used for verifying the correctness of the analyzer, and it is not +enabled by default. @item -fall-data-deps -Perform the data dependence analysis on all the data references. +Perform the data dependence analysis on all the data references. This +pass is only used for verifying the correctness of the analyzer, and +it is not enabled by default. @item -ftree-sra Perform scalar replacement of aggregates. This pass replaces structure Index: testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-01.c =================================================================== RCS file: /cvs/gcc/gcc/gcc/testsuite/gcc.dg/tree-ssa-chrec/Attic/ssa-chrec-01.c,v retrieving revision 1.1.2.3 diff -d -u -p -r1.1.2.3 ssa-chrec-01.c --- testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-01.c 21 Jan 2004 17:39:05 -0000 1.1.2.3 +++ testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-01.c 29 Jan 2004 17:45:39 -0000 @@ -6,8 +6,12 @@ int main(void) int a; int b; int c; + + /* loop_1 runs exactly 4 times. */ for (a = 22; a < 50; a+=1) { + + /* loop_2 runs exactly 6 times. On exit, the variable B is equal to 53. */ for (b = 23; b < 50; b+=5) { ++a; Index: testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-01.c.scev =================================================================== RCS file: /cvs/gcc/gcc/gcc/testsuite/gcc.dg/tree-ssa-chrec/Attic/ssa-chrec-01.c.scev,v retrieving revision 1.1.2.3 diff -d -u -p -r1.1.2.3 ssa-chrec-01.c.scev --- testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-01.c.scev 21 Jan 2004 18:02:49 -0000 1.1.2.3 +++ testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-01.c.scev 29 Jan 2004 17:45:39 -0000 @@ -6,14 +6,14 @@ Scalar evolution functions: c - -> {a_17, +, 1}_3 + -> {a_9, +, 1}_3 Scalar evolution functions: a - -> {a_2, +, 1}_2 + -> {a_1, +, 1}_2 Index: testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-06.c.scev =================================================================== RCS file: /cvs/gcc/gcc/gcc/testsuite/gcc.dg/tree-ssa-chrec/Attic/ssa-chrec-06.c.scev,v retrieving revision 1.1.2.3 diff -d -u -p -r1.1.2.3 ssa-chrec-06.c.scev --- testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-06.c.scev 15 Jan 2004 13:54:35 -0000 1.1.2.3 +++ testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-06.c.scev 29 Jan 2004 17:45:39 -0000 @@ -1,4 +1,7 @@ +;; Function main (main) + + Scalar evolution functions: @@ -11,6 +14,4 @@ b a -> {{22, +, 60}_1, +, 1}_2 - - Index: testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-09.c.scev =================================================================== RCS file: /cvs/gcc/gcc/gcc/testsuite/gcc.dg/tree-ssa-chrec/Attic/ssa-chrec-09.c.scev,v retrieving revision 1.1.2.4 diff -d -u -p -r1.1.2.4 ssa-chrec-09.c.scev --- testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-09.c.scev 21 Jan 2004 18:02:49 -0000 1.1.2.4 +++ testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-09.c.scev 29 Jan 2004 17:45:39 -0000 @@ -6,17 +6,17 @@ Scalar evolution functions: e - -> {5, +, c_28}_1 + -> {5, +, c_13}_1 d - -> {{4, +, 5}_1, +, c_28}_1 + -> {{4, +, 5}_1, +, c_13}_1 c - -> {{{3, +, 4}_1, +, 5}_1, +, c_28}_1 + -> {{{3, +, 4}_1, +, 5}_1, +, c_13}_1 b - -> {{{{2, +, 3}_1, +, 4}_1, +, 5}_1, +, c_28}_1 + -> {{{{2, +, 3}_1, +, 4}_1, +, 5}_1, +, c_13}_1 a - -> {{{{{-100, +, 2}_1, +, 3}_1, +, 4}_1, +, 5}_1, +, c_28}_1 + -> {{{{{-100, +, 2}_1, +, 3}_1, +, 4}_1, +, 5}_1, +, c_13}_1 Index: testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-10.c =================================================================== RCS file: /cvs/gcc/gcc/gcc/testsuite/gcc.dg/tree-ssa-chrec/Attic/ssa-chrec-10.c,v retrieving revision 1.1.2.3 diff -d -u -p -r1.1.2.3 ssa-chrec-10.c --- testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-10.c 21 Jan 2004 17:39:05 -0000 1.1.2.3 +++ testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-10.c 29 Jan 2004 17:45:39 -0000 @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O1 -fscalar-evolutions -fdump-tree-scev -fall-data-deps -fdump-tree-alldd" } */ +/* { dg-options "-O1 -fscalar-evolutions -fdump-tree-scev -fall-data-deps -fdump-tree-ddall" } */ void bar (int); @@ -26,4 +26,4 @@ int foo (void) */ /* { dg-final { diff-tree-dumps "scev" } } */ -/* { dg-final { diff-tree-dumps "alldd" } } */ +/* { dg-final { diff-tree-dumps "ddall" } } */ Index: testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-10.c.scev =================================================================== RCS file: /cvs/gcc/gcc/gcc/testsuite/gcc.dg/tree-ssa-chrec/Attic/ssa-chrec-10.c.scev,v retrieving revision 1.1.2.2 diff -d -u -p -r1.1.2.2 ssa-chrec-10.c.scev --- testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-10.c.scev 9 Jan 2004 12:15:53 -0000 1.1.2.2 +++ testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-10.c.scev 29 Jan 2004 17:45:39 -0000 @@ -1,43 +1,13 @@ - - Scalar evolution functions: - -T.1 - -> a_1 + 1; - -a - -> {11, +, 1}_1 - - - - Scalar evolution functions: - -T.3 - -> {14, +, 1}_1 - - - - Scalar evolution functions: - -T.2 - -> {18, +, 1}_1 - - - - Scalar evolution functions: - -T.6 - -> {13, +, 1}_1 +;; Function foo (foo) Scalar evolution functions: -x - -> {16, +, 1}_1 - -T.5 - -> {15, +, 1}_1 - +a + -> {11, +, 1}_1 +T.1 + -> {12, +, 1}_1 Index: testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-13.c =================================================================== RCS file: /cvs/gcc/gcc/gcc/testsuite/gcc.dg/tree-ssa-chrec/Attic/ssa-chrec-13.c,v retrieving revision 1.1.2.2 diff -d -u -p -r1.1.2.2 ssa-chrec-13.c --- testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-13.c 21 Jan 2004 17:39:05 -0000 1.1.2.2 +++ testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-13.c 29 Jan 2004 17:45:39 -0000 @@ -1,6 +1,7 @@ /* { dg-do compile } */ /* { dg-options "-O1 -fscalar-evolutions -fdump-tree-scev" } */ +int foo (void); int main (void) { @@ -11,7 +12,7 @@ int main (void) while (a) { /* Exercises if-phi-nodes. */ - if (a < 30) + if (foo ()) a += b; else a += c; Index: testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-13.c.scev =================================================================== RCS file: /cvs/gcc/gcc/gcc/testsuite/gcc.dg/tree-ssa-chrec/Attic/ssa-chrec-13.c.scev,v retrieving revision 1.1.2.2 diff -d -u -p -r1.1.2.2 ssa-chrec-13.c.scev --- testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-13.c.scev 15 Jan 2004 13:54:35 -0000 1.1.2.2 +++ testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-13.c.scev 29 Jan 2004 17:45:39 -0000 @@ -1,4 +1,7 @@ +;; Function main (main) + + Scalar evolution functions: @@ -10,6 +13,4 @@ b a -> {{-100, +, [2, 3]}_1, +, 1}_1 - - Index: testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-14.c =================================================================== RCS file: /cvs/gcc/gcc/gcc/testsuite/gcc.dg/tree-ssa-chrec/Attic/ssa-chrec-14.c,v retrieving revision 1.1.2.2 diff -d -u -p -r1.1.2.2 ssa-chrec-14.c --- testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-14.c 21 Jan 2004 17:39:05 -0000 1.1.2.2 +++ testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-14.c 29 Jan 2004 17:45:39 -0000 @@ -1,6 +1,7 @@ /* { dg-do compile } */ /* { dg-options "-O1 -fscalar-evolutions -fdump-tree-scev" } */ +int foo (void); int main (void) { @@ -11,7 +12,7 @@ int main (void) while (d) { - if (a < 30) + if (foo ()) a += b; else a += c; Index: testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-14.c.scev =================================================================== RCS file: /cvs/gcc/gcc/gcc/testsuite/gcc.dg/tree-ssa-chrec/Attic/ssa-chrec-14.c.scev,v retrieving revision 1.1.2.2 diff -d -u -p -r1.1.2.2 ssa-chrec-14.c.scev --- testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-14.c.scev 15 Jan 2004 13:54:35 -0000 1.1.2.2 +++ testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-14.c.scev 29 Jan 2004 17:45:39 -0000 @@ -1,4 +1,7 @@ +;; Function main (main) + + Scalar evolution functions: @@ -13,6 +16,4 @@ a d -> {{{4, +, [-98, -97]}_1, +, [2, 3]}_1, +, [1, 5]}_1 - - Index: testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-17.c.scev =================================================================== RCS file: /cvs/gcc/gcc/gcc/testsuite/gcc.dg/tree-ssa-chrec/Attic/ssa-chrec-17.c.scev,v retrieving revision 1.1.2.3 diff -d -u -p -r1.1.2.3 ssa-chrec-17.c.scev --- testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-17.c.scev 21 Jan 2004 18:02:49 -0000 1.1.2.3 +++ testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-17.c.scev 29 Jan 2004 17:45:39 -0000 @@ -9,5 +9,5 @@ a -> [-oo, +oo] b - -> {2, +, a_3}_1 + -> {2, +, a_2}_1 Index: testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-24.c.scev =================================================================== RCS file: /cvs/gcc/gcc/gcc/testsuite/gcc.dg/tree-ssa-chrec/Attic/ssa-chrec-24.c.scev,v retrieving revision 1.1.2.1 diff -d -u -p -r1.1.2.1 ssa-chrec-24.c.scev --- testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-24.c.scev 27 Dec 2003 05:42:52 -0000 1.1.2.1 +++ testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-24.c.scev 29 Jan 2004 17:45:39 -0000 @@ -1,9 +1,17 @@ +;; Function foo (foo) + + Scalar evolution functions: c - -> {[2, 3], +, 5}_1 + -> {c_2, +, 5}_1 + + Scalar evolution functions: + +c + -> {[2, 3], +, 5}_1 Index: testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-25.c.scev =================================================================== RCS file: /cvs/gcc/gcc/gcc/testsuite/gcc.dg/tree-ssa-chrec/Attic/ssa-chrec-25.c.scev,v retrieving revision 1.1.2.1 diff -d -u -p -r1.1.2.1 ssa-chrec-25.c.scev --- testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-25.c.scev 27 Dec 2003 05:42:52 -0000 1.1.2.1 +++ testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-25.c.scev 29 Jan 2004 17:45:39 -0000 @@ -1,9 +1,17 @@ +;; Function foo (foo) + + Scalar evolution functions: c - -> {[2, 10], +, 5}_1 + -> {c_2, +, 5}_1 + + Scalar evolution functions: + +c + -> {[2, 10], +, 5}_1 Index: testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-26.c.scev =================================================================== RCS file: /cvs/gcc/gcc/gcc/testsuite/gcc.dg/tree-ssa-chrec/Attic/ssa-chrec-26.c.scev,v retrieving revision 1.1.2.1 diff -d -u -p -r1.1.2.1 ssa-chrec-26.c.scev --- testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-26.c.scev 27 Dec 2003 05:42:52 -0000 1.1.2.1 +++ testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-26.c.scev 29 Jan 2004 17:45:39 -0000 @@ -1,4 +1,7 @@ +;; Function foo (foo) + + Scalar evolution functions: @@ -11,6 +14,4 @@ a b -> {-10, +, 1}_2 - - Index: testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-27.c.scev =================================================================== RCS file: /cvs/gcc/gcc/gcc/testsuite/gcc.dg/tree-ssa-chrec/Attic/ssa-chrec-27.c.scev,v retrieving revision 1.1.2.3 diff -d -u -p -r1.1.2.3 ssa-chrec-27.c.scev --- testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-27.c.scev 21 Jan 2004 18:02:49 -0000 1.1.2.3 +++ testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-27.c.scev 29 Jan 2004 17:45:39 -0000 @@ -13,12 +13,12 @@ a Scalar evolution functions: a - -> {{a_10, +, 1}_1, +, 3}_2 + -> {{a_5, +, 1}_1, +, 3}_2 Scalar evolution functions: a - -> {{a_10, +, 1}_1, +, 3}_2 + -> {{a_5, +, 1}_1, +, 3}_2 Index: testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-28.c.scev =================================================================== RCS file: /cvs/gcc/gcc/gcc/testsuite/gcc.dg/tree-ssa-chrec/Attic/ssa-chrec-28.c.scev,v retrieving revision 1.1.2.2 diff -d -u -p -r1.1.2.2 ssa-chrec-28.c.scev --- testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-28.c.scev 9 Jan 2004 12:15:53 -0000 1.1.2.2 +++ testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-28.c.scev 29 Jan 2004 17:45:39 -0000 @@ -1,4 +1,7 @@ +;; Function foo (foo) + + Scalar evolution functions: @@ -10,7 +13,12 @@ i Scalar evolution functions: a - -> {{2, *, [-oo, +oo]}_1, +, 4}_2 + -> {a_6, +, 4}_2 + + Scalar evolution functions: + +a + -> {{2, *, [-oo, +oo]}_1, +, 4}_2 Index: testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-30.c =================================================================== RCS file: /cvs/gcc/gcc/gcc/testsuite/gcc.dg/tree-ssa-chrec/Attic/ssa-chrec-30.c,v retrieving revision 1.1.2.2 diff -d -u -p -r1.1.2.2 ssa-chrec-30.c --- testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-30.c 21 Jan 2004 17:39:05 -0000 1.1.2.2 +++ testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-30.c 29 Jan 2004 17:45:39 -0000 @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O1 -fscalar-evolutions -fdump-tree-scev -fall-data-deps -fdump-tree-alldd" } */ +/* { dg-options "-O1 -fscalar-evolutions -fdump-tree-scev -fall-data-deps -fdump-tree-ddall" } */ void foo (int); @@ -19,4 +19,4 @@ int main () } /* { dg-final { diff-tree-dumps "scev" } } */ -/* { dg-final { diff-tree-dumps "alldd" } } */ +/* { dg-final { diff-tree-dumps "ddall" } } */ Index: testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-30.c.scev =================================================================== RCS file: /cvs/gcc/gcc/gcc/testsuite/gcc.dg/tree-ssa-chrec/Attic/ssa-chrec-30.c.scev,v retrieving revision 1.1.2.2 diff -d -u -p -r1.1.2.2 ssa-chrec-30.c.scev --- testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-30.c.scev 9 Jan 2004 12:15:53 -0000 1.1.2.2 +++ testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-30.c.scev 29 Jan 2004 17:45:39 -0000 @@ -1,30 +1,10 @@ - - Scalar evolution functions: - -a - -> {1, +, 1}_1 - - - - Scalar evolution functions: - -T.2 - -> {3, +, 1}_1 - - - - Scalar evolution functions: - -T.4 - -> {0, +, 1}_1 +;; Function main (main) Scalar evolution functions: -T.1 - -> {-6, +, 1}_1 - - +a + -> {1, +, 1}_1 Index: testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-31.c =================================================================== RCS file: /cvs/gcc/gcc/gcc/testsuite/gcc.dg/tree-ssa-chrec/Attic/ssa-chrec-31.c,v retrieving revision 1.1.2.2 diff -d -u -p -r1.1.2.2 ssa-chrec-31.c --- testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-31.c 21 Jan 2004 17:39:05 -0000 1.1.2.2 +++ testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-31.c 29 Jan 2004 17:45:39 -0000 @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O1 -fscalar-evolutions -fdump-tree-scev -fall-data-deps -fdump-tree-alldd" } */ +/* { dg-options "-O1 -fscalar-evolutions -fdump-tree-scev -fall-data-deps -fdump-tree-ddall" } */ void bar (short); @@ -17,4 +17,4 @@ foo (){ } /* { dg-final { diff-tree-dumps "scev" } } */ -/* { dg-final { diff-tree-dumps "alldd" } } */ +/* { dg-final { diff-tree-dumps "ddall" } } */ Index: testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-32.c =================================================================== RCS file: /cvs/gcc/gcc/gcc/testsuite/gcc.dg/tree-ssa-chrec/Attic/ssa-chrec-32.c,v retrieving revision 1.1.2.3 diff -d -u -p -r1.1.2.3 ssa-chrec-32.c --- testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-32.c 21 Jan 2004 17:39:05 -0000 1.1.2.3 +++ testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-32.c 29 Jan 2004 17:45:39 -0000 @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O1 -fscalar-evolutions -fdump-tree-scev -fall-data-deps -fdump-tree-alldd" } */ +/* { dg-options "-O1 -fscalar-evolutions -fdump-tree-scev -fall-data-deps -fdump-tree-ddall" } */ void bar (short); @@ -33,4 +33,4 @@ void foo() */ /* { dg-final { diff-tree-dumps "scev" } } */ -/* { dg-final { diff-tree-dumps "alldd" } } */ +/* { dg-final { diff-tree-dumps "ddall" } } */ Index: testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-33.c =================================================================== RCS file: /cvs/gcc/gcc/gcc/testsuite/gcc.dg/tree-ssa-chrec/Attic/ssa-chrec-33.c,v retrieving revision 1.1.2.3 diff -d -u -p -r1.1.2.3 ssa-chrec-33.c --- testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-33.c 21 Jan 2004 17:39:05 -0000 1.1.2.3 +++ testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-33.c 29 Jan 2004 17:45:39 -0000 @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O1 -fscalar-evolutions -fdump-tree-scev -fall-data-deps -fdump-tree-alldd" } */ +/* { dg-options "-O1 -fscalar-evolutions -fdump-tree-scev -fall-data-deps -fdump-tree-ddall" } */ void bar (int); @@ -44,4 +44,4 @@ void foo () */ /* { dg-final { diff-tree-dumps "scev" } } */ -/* { dg-final { diff-tree-dumps "alldd" } } */ +/* { dg-final { diff-tree-dumps "ddall" } } */ Index: testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-33.c.scev =================================================================== RCS file: /cvs/gcc/gcc/gcc/testsuite/gcc.dg/tree-ssa-chrec/Attic/ssa-chrec-33.c.scev,v retrieving revision 1.1.2.2 diff -d -u -p -r1.1.2.2 ssa-chrec-33.c.scev --- testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-33.c.scev 9 Jan 2004 12:15:54 -0000 1.1.2.2 +++ testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-33.c.scev 29 Jan 2004 17:45:39 -0000 @@ -1,4 +1,7 @@ +;; Function foo (foo) + + Scalar evolution functions: @@ -11,46 +14,4 @@ j i -> {0, +, 1}_1 - - - - Scalar evolution functions: - -T.1 - -> {k_1, +, -1}_2 - -T.2 - -> {k_1 * 2, +, -2}_2 - -T.3 - -> {k_1 * 2 + 1, +, -2}_2 - - - - Scalar evolution functions: - -k - -> {10, +, 1}_1 - - - - Scalar evolution functions: - -T.6 - -> {0, +, 2}_2 - -T.7 - -> {1, +, 2}_2 - - - - Scalar evolution functions: - -T.20 - -> {0, +, 2}_1 - -T.21 - -> {1, +, 2}_1 - - Index: testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-34.c =================================================================== RCS file: /cvs/gcc/gcc/gcc/testsuite/gcc.dg/tree-ssa-chrec/Attic/ssa-chrec-34.c,v retrieving revision 1.1.2.3 diff -d -u -p -r1.1.2.3 ssa-chrec-34.c --- testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-34.c 21 Jan 2004 17:39:05 -0000 1.1.2.3 +++ testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-34.c 29 Jan 2004 17:45:39 -0000 @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O1 -fscalar-evolutions -fdump-tree-scev -fall-data-deps -fdump-tree-alldd" } */ +/* { dg-options "-O1 -fscalar-evolutions -fdump-tree-scev -fall-data-deps -fdump-tree-ddall" } */ void bar (int); @@ -31,4 +31,4 @@ short foo (short image[][M], short block */ /* { dg-final { diff-tree-dumps "scev" } } */ -/* { dg-final { diff-tree-dumps "alldd" } } */ +/* { dg-final { diff-tree-dumps "ddall" } } */ Index: testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-35.c =================================================================== RCS file: /cvs/gcc/gcc/gcc/testsuite/gcc.dg/tree-ssa-chrec/Attic/ssa-chrec-35.c,v retrieving revision 1.1.2.3 diff -d -u -p -r1.1.2.3 ssa-chrec-35.c --- testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-35.c 21 Jan 2004 17:39:05 -0000 1.1.2.3 +++ testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-35.c 29 Jan 2004 17:45:39 -0000 @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O1 -fscalar-evolutions -fdump-tree-scev -fall-data-deps -fdump-tree-alldd" } */ +/* { dg-options "-O1 -fscalar-evolutions -fdump-tree-scev -fall-data-deps -fdump-tree-ddall" } */ #define L 100 #define M 100 @@ -32,4 +32,4 @@ int foo (float A[][M][N]) */ /* { dg-final { diff-tree-dumps "scev" } } */ -/* { dg-final { diff-tree-dumps "alldd" } } */ +/* { dg-final { diff-tree-dumps "ddall" } } */ Index: testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-36.c =================================================================== RCS file: /cvs/gcc/gcc/gcc/testsuite/gcc.dg/tree-ssa-chrec/Attic/ssa-chrec-36.c,v retrieving revision 1.1.2.2 diff -d -u -p -r1.1.2.2 ssa-chrec-36.c --- testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-36.c 21 Jan 2004 17:39:05 -0000 1.1.2.2 +++ testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-36.c 29 Jan 2004 17:45:39 -0000 @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O1 -fscalar-evolutions -fdump-scalar-evolutions -fall-data-deps -fdump-tree-alldd" } */ +/* { dg-options "-O1 -fscalar-evolutions -fdump-tree-scev -fall-data-deps -fdump-tree-ddall" } */ int foo (int); @@ -34,5 +34,5 @@ int main () /* { dg -final FIXME fails-for-the-moment { scan-tree-dump "a\\\n -\> \{?1, \\+, 1\}_1" "scev"} } */ /* { dg-final { diff-tree-dumps "scev" } } */ -/* { dg-final { diff-tree-dumps "alldd" } } */ -y +/* { dg-final { diff-tree-dumps "ddall" } } */ + Index: testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-36.c.scev =================================================================== RCS file: /cvs/gcc/gcc/gcc/testsuite/gcc.dg/tree-ssa-chrec/Attic/ssa-chrec-36.c.scev,v retrieving revision 1.1.2.2 diff -d -u -p -r1.1.2.2 ssa-chrec-36.c.scev --- testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-36.c.scev 9 Jan 2004 12:15:54 -0000 1.1.2.2 +++ testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-36.c.scev 29 Jan 2004 17:45:39 -0000 @@ -1,12 +1,13 @@ +;; Function main (main) - Scalar evolution functions: -T.1 - -> a_1 + 1; + + Scalar evolution functions: a -> {1, +, 1}_1 - +T.1 + -> {2, +, 1}_1 Index: testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-38.c.scev =================================================================== RCS file: /cvs/gcc/gcc/gcc/testsuite/gcc.dg/tree-ssa-chrec/Attic/ssa-chrec-38.c.scev,v retrieving revision 1.1.2.3 diff -d -u -p -r1.1.2.3 ssa-chrec-38.c.scev --- testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-38.c.scev 15 Jan 2004 13:54:35 -0000 1.1.2.3 +++ testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-38.c.scev 29 Jan 2004 17:45:39 -0000 @@ -1,4 +1,7 @@ +;; Function main (main) + + Scalar evolution functions: @@ -9,14 +12,19 @@ d Scalar evolution functions: -b - -> {2, +, 5}_1 - c -> {11, +, 12}_1 a - -> {{{3, +, 62}_1, +, 65}_1, +, {11, +, 12}_1}_2 + -> {a_12, +, {11, +, 12}_1}_2 + + Scalar evolution functions: + +b + -> {2, +, 5}_1 + +a + -> {{{3, +, 62}_1, +, 65}_1, +, {11, +, 12}_1}_2 Index: testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-39.c.scev =================================================================== RCS file: /cvs/gcc/gcc/gcc/testsuite/gcc.dg/tree-ssa-chrec/Attic/ssa-chrec-39.c.scev,v retrieving revision 1.1.2.3 diff -d -u -p -r1.1.2.3 ssa-chrec-39.c.scev --- testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-39.c.scev 15 Jan 2004 13:54:35 -0000 1.1.2.3 +++ testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-39.c.scev 29 Jan 2004 17:45:39 -0000 @@ -1,4 +1,7 @@ +;; Function foo (foo) + + Scalar evolution functions: @@ -9,11 +12,8 @@ d Scalar evolution functions: -b - -> {2, +, 25}_1 - a - -> {{{3, +, ParmN_12 * 5 + 27}_1, +, 25}_1, +, ParmN_12}_2 + -> {a_10, +, ParmN_12}_2 @@ -23,4 +23,12 @@ ParmN -> not_analyzed_yet + + Scalar evolution functions: + +b + -> {2, +, 25}_1 + +a + -> {{{3, +, ParmN_12 * 5 + 27}_1, +, 25}_1, +, ParmN_12}_2 Index: testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-41.c.scev =================================================================== RCS file: /cvs/gcc/gcc/gcc/testsuite/gcc.dg/tree-ssa-chrec/Attic/ssa-chrec-41.c.scev,v retrieving revision 1.1.2.2 diff -d -u -p -r1.1.2.2 ssa-chrec-41.c.scev --- testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-41.c.scev 9 Jan 2004 12:15:54 -0000 1.1.2.2 +++ testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-41.c.scev 29 Jan 2004 17:45:39 -0000 @@ -1,4 +1,7 @@ +;; Function main (main) + + Scalar evolution functions: @@ -13,7 +16,12 @@ b -> {4, *, 5}_1 a - -> {{2, *, {120, *, 5}_1}_1, *, {4, *, 5}_1}_2 + -> {a_9, *, {4, *, 5}_1}_2 + + Scalar evolution functions: + +a + -> {{2, *, {120, *, 5}_1}_1, *, {4, *, 5}_1}_2 Index: testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-43.c.scev =================================================================== RCS file: /cvs/gcc/gcc/gcc/testsuite/gcc.dg/tree-ssa-chrec/Attic/ssa-chrec-43.c.scev,v retrieving revision 1.1.2.3 diff -d -u -p -r1.1.2.3 ssa-chrec-43.c.scev --- testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-43.c.scev 15 Jan 2004 13:54:35 -0000 1.1.2.3 +++ testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-43.c.scev 29 Jan 2004 17:45:39 -0000 @@ -1,4 +1,7 @@ +;; Function main (main) + + Scalar evolution functions: @@ -12,14 +15,16 @@ e d -> {5, +, 9}_1 -c - -> {0, +, 1}_1 - b - -> {{{2, +, 0}_1, +, 10}_1, +, {0, +, 1}_1}_2 + -> {{2, +, c_5 * 10}_1, +, c_5}_2 a - -> {{{1, +, 7}_1, +, 9}_1, +, 10}_1 + -> {{1, +, 7}_1, +, c_5 * 10 + 9}_1 + + Scalar evolution functions: + +c + -> {0, +, 1}_1 Index: testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-46.c.scev =================================================================== RCS file: /cvs/gcc/gcc/gcc/testsuite/gcc.dg/tree-ssa-chrec/Attic/ssa-chrec-46.c.scev,v retrieving revision 1.1.2.3 diff -d -u -p -r1.1.2.3 ssa-chrec-46.c.scev --- testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-46.c.scev 21 Jan 2004 18:02:49 -0000 1.1.2.3 +++ testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-46.c.scev 29 Jan 2004 17:45:39 -0000 @@ -6,12 +6,12 @@ Scalar evolution functions: i - -> {i_5, +, -1}_1 + -> {i_6, +, -1}_1 Scalar evolution functions: i - -> {i_5, +, -1}_1 + -> {i_6, +, -1}_1 Index: testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-47.c.scev =================================================================== RCS file: /cvs/gcc/gcc/gcc/testsuite/gcc.dg/tree-ssa-chrec/Attic/ssa-chrec-47.c.scev,v retrieving revision 1.1.2.2 diff -d -u -p -r1.1.2.2 ssa-chrec-47.c.scev --- testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-47.c.scev 9 Jan 2004 12:15:54 -0000 1.1.2.2 +++ testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-47.c.scev 29 Jan 2004 17:45:39 -0000 @@ -1,23 +1,17 @@ - - Scalar evolution functions: - -p - -> {[MIN_EXPR <p_5, p_7>, MAX_EXPR <p_5, p_7>], +, -1}_1 +;; Function foo (foo) Scalar evolution functions: p - -> {[MIN_EXPR <p_5, p_7>, MAX_EXPR <p_5, p_7>], +, -1}_1 + -> {p_2, +, -1}_1 Scalar evolution functions: p - -> {[MIN_EXPR <p_5, p_7>, MAX_EXPR <p_5, p_7>], +, -1}_1 - - + -> {[MIN_EXPR <p_6, p_8>, MAX_EXPR <p_6, p_8>], +, -1}_1 Index: testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-51.c.scev =================================================================== RCS file: /cvs/gcc/gcc/gcc/testsuite/gcc.dg/tree-ssa-chrec/Attic/ssa-chrec-51.c.scev,v retrieving revision 1.1.2.2 diff -d -u -p -r1.1.2.2 ssa-chrec-51.c.scev --- testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-51.c.scev 12 Jan 2004 16:24:52 -0000 1.1.2.2 +++ testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-51.c.scev 29 Jan 2004 17:45:39 -0000 @@ -1,12 +1,15 @@ +;; Function foo (foo) + + Scalar evolution functions: temp_var - -> i_1 + j_4; + -> i_1 + j_5; i - -> {0, +, j_4 + 2}_1 + -> {0, +, j_5 + 2}_1 @@ -16,4 +19,9 @@ j -> not_analyzed_yet + + Scalar evolution functions: + +j + -> not_analyzed_yet Index: testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-52.c =================================================================== RCS file: /cvs/gcc/gcc/gcc/testsuite/gcc.dg/tree-ssa-chrec/Attic/ssa-chrec-52.c,v retrieving revision 1.1.2.2 diff -d -u -p -r1.1.2.2 ssa-chrec-52.c --- testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-52.c 21 Jan 2004 17:39:05 -0000 1.1.2.2 +++ testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-52.c 29 Jan 2004 17:45:39 -0000 @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O1 -fscalar-evolutions -fdump-tree-scev -fall-data-deps -fdump-tree-alldd" } */ +/* { dg-options "-O1 -fscalar-evolutions -fdump-tree-scev -fall-data-deps -fdump-tree-ddall" } */ int bar (int); @@ -20,4 +20,4 @@ int foo (void) } /* { dg-final { diff-tree-dumps "scev" } } */ -/* { dg-final { diff-tree-dumps "alldd" } } */ +/* { dg-final { diff-tree-dumps "ddall" } } */ Index: testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-52.c.scev =================================================================== RCS file: /cvs/gcc/gcc/gcc/testsuite/gcc.dg/tree-ssa-chrec/Attic/ssa-chrec-52.c.scev,v retrieving revision 1.1.2.1 diff -d -u -p -r1.1.2.1 ssa-chrec-52.c.scev --- testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-52.c.scev 9 Jan 2004 12:15:54 -0000 1.1.2.1 +++ testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-52.c.scev 29 Jan 2004 17:45:39 -0000 @@ -1,26 +1,10 @@ - - Scalar evolution functions: - -a - -> {11, +, 1}_1 - - - - Scalar evolution functions: - -T.1 - -> {18, +, 1}_1 +;; Function foo (foo) Scalar evolution functions: -x - -> {16, +, 1}_1 - -T.3 - -> {15, +, 1}_1 - - +a + -> {11, +, 1}_1 Index: testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-53.c =================================================================== RCS file: /cvs/gcc/gcc/gcc/testsuite/gcc.dg/tree-ssa-chrec/Attic/ssa-chrec-53.c,v retrieving revision 1.1.2.2 diff -d -u -p -r1.1.2.2 ssa-chrec-53.c --- testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-53.c 21 Jan 2004 17:39:05 -0000 1.1.2.2 +++ testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-53.c 29 Jan 2004 17:45:39 -0000 @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O1 -fscalar-evolutions -fdump-tree-scev -fall-data-deps -fdump-tree-alldd" } */ +/* { dg-options "-O1 -fscalar-evolutions -fdump-tree-scev -fall-data-deps -fdump-tree-ddall" } */ #define N 16 @@ -127,4 +127,4 @@ foo (int n) } /* { dg-final { diff-tree-dumps "scev" } } */ -/* { dg-final { diff-tree-dumps "alldd" } } */ +/* { dg-final { diff-tree-dumps "ddall" } } */ Index: testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-53.c.scev =================================================================== RCS file: /cvs/gcc/gcc/gcc/testsuite/gcc.dg/tree-ssa-chrec/Attic/ssa-chrec-53.c.scev,v retrieving revision 1.1.2.2 diff -d -u -p -r1.1.2.2 ssa-chrec-53.c.scev --- testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-53.c.scev 15 Jan 2004 13:54:35 -0000 1.1.2.2 +++ testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-53.c.scev 29 Jan 2004 17:45:39 -0000 @@ -1,4 +1,7 @@ +;; Function foo (foo) + + Scalar evolution functions: @@ -100,45 +103,9 @@ i Scalar evolution functions: -T.35 - -> {{{{{{{{{{{{{i_14 + 1, +, 1}_1, +, 1}_2, +, 1}_3, +, 1}_4, +, 1}_5, +, 1}_6, +, 1}_7, +, 1}_8, +, 1}_9, +, 1}_10, +, 1}_11, +, 1}_12, +, 1}_13 - i -> {{{{{{{{{{{{{{0, +, 1}_1, +, 1}_2, +, 1}_3, +, 1}_4, +, 1}_5, +, 1}_6, +, 1}_7, +, 1}_8, +, 1}_9, +, 1}_10, +, 1}_11, +, 1}_12, +, 1}_13, +, 1}_14 - - - Scalar evolution functions: - -T.8 - -> {{{{{{{{{{{{{{8, +, 1}_1, +, 1}_2, +, 1}_3, +, 1}_4, +, 1}_5, +, 1}_6, +, 1}_7, +, 1}_8, +, 1}_9, +, 1}_10, +, 1}_11, +, 1}_12, +, 1}_13, +, 1}_14 - - - - Scalar evolution functions: - -T.8 - -> {{{{{{{{{{{{{{8, +, 1}_1, +, 1}_2, +, 1}_3, +, 1}_4, +, 1}_5, +, 1}_6, +, 1}_7, +, 1}_8, +, 1}_9, +, 1}_10, +, 1}_11, +, 1}_12, +, 1}_13, +, 1}_14 - - - - Scalar evolution functions: - -T.16 - -> {{{{{{{{{{{{{{0, +, 2}_1, +, 2}_2, +, 2}_3, +, 2}_4, +, 2}_5, +, 2}_6, +, 2}_7, +, 2}_8, +, 2}_9, +, 2}_10, +, 2}_11, +, 2}_12, +, 2}_13, +, 2}_14 - -T.17 - -> {{{{{{{{{{{{{{1, +, 2}_1, +, 2}_2, +, 2}_3, +, 2}_4, +, 2}_5, +, 2}_6, +, 2}_7, +, 2}_8, +, 2}_9, +, 2}_10, +, 2}_11, +, 2}_12, +, 2}_13, +, 2}_14 - - - - Scalar evolution functions: - -T.16 - -> {{{{{{{{{{{{{{0, +, 2}_1, +, 2}_2, +, 2}_3, +, 2}_4, +, 2}_5, +, 2}_6, +, 2}_7, +, 2}_8, +, 2}_9, +, 2}_10, +, 2}_11, +, 2}_12, +, 2}_13, +, 2}_14 - -T.17 - -> {{{{{{{{{{{{{{1, +, 2}_1, +, 2}_2, +, 2}_3, +, 2}_4, +, 2}_5, +, 2}_6, +, 2}_7, +, 2}_8, +, 2}_9, +, 2}_10, +, 2}_11, +, 2}_12, +, 2}_13, +, 2}_14 - - +T.35 + -> {{{{{{{{{{{{{{1, +, 1}_1, +, 1}_2, +, 1}_3, +, 1}_4, +, 1}_5, +, 1}_6, +, 1}_7, +, 1}_8, +, 1}_9, +, 1}_10, +, 1}_11, +, 1}_12, +, 1}_13, +, 1}_14
Attachment:
ddall.tar.gz
Description: Binary data
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |