Lines Matching refs:loop
268 static tree analyze_scalar_evolution_1 (struct loop *, tree, tree);
383 loop_p def_loop, loop; in chrec_contains_symbols_defined_in_loop() local
390 loop = get_loop (loop_nb); in chrec_contains_symbols_defined_in_loop()
395 if (loop == def_loop || flow_loop_nested_p (loop, def_loop)) in chrec_contains_symbols_defined_in_loop()
457 compute_overall_effect_of_inner_loop (struct loop *loop, tree evolution_fn) in compute_overall_effect_of_inner_loop() argument
466 struct loop *inner_loop = get_chrec_loop (evolution_fn); in compute_overall_effect_of_inner_loop()
468 if (inner_loop == loop in compute_overall_effect_of_inner_loop()
469 || flow_loop_nested_p (loop, inner_loop)) in compute_overall_effect_of_inner_loop()
483 if (chrec_contains_symbols_defined_in_loop (res, loop->num)) in compute_overall_effect_of_inner_loop()
484 res = instantiate_parameters (loop, res); in compute_overall_effect_of_inner_loop()
487 return compute_overall_effect_of_inner_loop (loop, res); in compute_overall_effect_of_inner_loop()
495 else if (no_evolution_in_loop_p (evolution_fn, loop->num, &val) && val) in compute_overall_effect_of_inner_loop()
597 struct loop *loop = get_loop (loop_nb), *chloop; in add_to_evolution_1() local
603 if (chloop == loop in add_to_evolution_1()
604 || flow_loop_nested_p (chloop, loop)) in add_to_evolution_1()
611 if (chloop != loop) in add_to_evolution_1()
633 gcc_assert (flow_loop_nested_p (loop, chloop)); in add_to_evolution_1()
844 get_loop_exit_condition (const struct loop *loop) in get_loop_exit_condition() argument
847 edge exit_edge = single_exit (loop); in get_loop_exit_condition()
873 get_exit_conditions_rec (struct loop *loop, in get_exit_conditions_rec() argument
876 if (!loop) in get_exit_conditions_rec()
880 get_exit_conditions_rec (loop->inner, exit_conditions); in get_exit_conditions_rec()
881 get_exit_conditions_rec (loop->next, exit_conditions); in get_exit_conditions_rec()
883 if (single_exit (loop)) in get_exit_conditions_rec()
885 gimple loop_condition = get_loop_exit_condition (loop); in get_exit_conditions_rec()
898 struct loop *function_body = current_loops->tree_root; in select_loops_exit_conditions()
913 static t_bool follow_ssa_edge (struct loop *loop, gimple, gimple, tree *, int);
919 follow_ssa_edge_binary (struct loop *loop, gimple at_stmt, in follow_ssa_edge_binary() argument
944 (loop, SSA_NAME_DEF_STMT (rhs0), halting_phi, &evol, limit); in follow_ssa_edge_binary()
948 (loop->num, in follow_ssa_edge_binary()
955 (loop, SSA_NAME_DEF_STMT (rhs1), halting_phi, in follow_ssa_edge_binary()
960 (loop->num, in follow_ssa_edge_binary()
977 (loop, SSA_NAME_DEF_STMT (rhs0), halting_phi, in follow_ssa_edge_binary()
981 (loop->num, chrec_convert (type, *evolution_of_loop, in follow_ssa_edge_binary()
995 (loop, SSA_NAME_DEF_STMT (rhs1), halting_phi, in follow_ssa_edge_binary()
999 (loop->num, chrec_convert (type, *evolution_of_loop, in follow_ssa_edge_binary()
1027 res = follow_ssa_edge (loop, SSA_NAME_DEF_STMT (rhs0), halting_phi, in follow_ssa_edge_binary()
1031 (loop->num, chrec_convert (type, *evolution_of_loop, at_stmt), in follow_ssa_edge_binary()
1055 follow_ssa_edge_expr (struct loop *loop, gimple at_stmt, tree expr, in follow_ssa_edge_expr() argument
1075 res = follow_ssa_edge_expr (loop, at_stmt, TREE_OPERAND (expr, 0), in follow_ssa_edge_expr()
1088 (loop, SSA_NAME_DEF_STMT (expr), halting_phi, evolution_of_loop, limit); in follow_ssa_edge_expr()
1100 res = follow_ssa_edge_binary (loop, at_stmt, type, rhs0, code, rhs1, in follow_ssa_edge_expr()
1114 res = follow_ssa_edge_binary (loop, at_stmt, type, in follow_ssa_edge_expr()
1127 res = follow_ssa_edge (loop, SSA_NAME_DEF_STMT (rhs0), in follow_ssa_edge_expr()
1145 follow_ssa_edge_in_rhs (struct loop *loop, gimple stmt, in follow_ssa_edge_in_rhs() argument
1156 res = follow_ssa_edge_expr (loop, stmt, gimple_assign_rhs1 (stmt), in follow_ssa_edge_in_rhs()
1167 res = follow_ssa_edge_binary (loop, stmt, type, rhs1, code, rhs2, in follow_ssa_edge_in_rhs()
1173 res = follow_ssa_edge_expr (loop, stmt, gimple_assign_rhs1 (stmt), in follow_ssa_edge_in_rhs()
1205 struct loop *loop, in follow_ssa_edge_in_condition_phi_branch() argument
1222 return follow_ssa_edge (loop, SSA_NAME_DEF_STMT (branch), halting_phi, in follow_ssa_edge_in_condition_phi_branch()
1240 follow_ssa_edge_in_condition_phi (struct loop *loop, in follow_ssa_edge_in_condition_phi() argument
1248 t_bool res = follow_ssa_edge_in_condition_phi_branch (0, loop, condition_phi, in follow_ssa_edge_in_condition_phi()
1267 res = follow_ssa_edge_in_condition_phi_branch (i, loop, condition_phi, in follow_ssa_edge_in_condition_phi()
1287 follow_ssa_edge_inner_loop_phi (struct loop *outer_loop, in follow_ssa_edge_inner_loop_phi()
1292 struct loop *loop = loop_containing_stmt (loop_phi_node); in follow_ssa_edge_inner_loop_phi() local
1293 tree ev = analyze_scalar_evolution (loop, PHI_RESULT (loop_phi_node)); in follow_ssa_edge_inner_loop_phi()
1309 if (!flow_bb_inside_loop_p (loop, bb)) in follow_ssa_edge_inner_loop_phi()
1325 ev = compute_overall_effect_of_inner_loop (loop, ev); in follow_ssa_edge_inner_loop_phi()
1334 follow_ssa_edge (struct loop *loop, gimple def, gimple halting_phi, in follow_ssa_edge() argument
1337 struct loop *def_loop; in follow_ssa_edge()
1357 (loop, def, halting_phi, evolution_of_loop, limit); in follow_ssa_edge()
1368 if (def_loop == loop) in follow_ssa_edge()
1372 if (flow_loop_nested_p (loop, def_loop)) in follow_ssa_edge()
1374 (loop, def, halting_phi, evolution_of_loop, limit + 1); in follow_ssa_edge()
1380 return follow_ssa_edge_in_rhs (loop, def, halting_phi, in follow_ssa_edge()
1402 struct loop *loop = loop_containing_stmt (loop_phi_node); in analyze_evolution_in_loop() local
1422 if (!flow_bb_inside_loop_p (loop, bb)) in analyze_evolution_in_loop()
1433 res = follow_ssa_edge (loop, ssa_chain, loop_phi_node, &ev_fn, 0); in analyze_evolution_in_loop()
1440 && no_evolution_in_loop_p (ev_fn, loop->num, &val) && val in analyze_evolution_in_loop()
1483 struct loop *loop = loop_containing_stmt (loop_phi_node); in analyze_initial_condition() local
1501 if (flow_bb_inside_loop_p (loop, bb)) in analyze_initial_condition()
1550 interpret_loop_phi (struct loop *loop, gimple loop_phi_node) in interpret_loop_phi() argument
1553 struct loop *phi_loop = loop_containing_stmt (loop_phi_node); in interpret_loop_phi()
1556 if (phi_loop != loop) in interpret_loop_phi()
1558 struct loop *subloop; in interpret_loop_phi()
1563 subloop = superloop_at_depth (phi_loop, loop_depth (loop) + 1); in interpret_loop_phi()
1599 interpret_condition_phi (struct loop *loop, gimple condition_phi) in interpret_condition_phi() argument
1615 (loop, PHI_ARG_DEF (condition_phi, i)); in interpret_condition_phi()
1631 interpret_rhs_expr (struct loop *loop, gimple at_stmt, in interpret_rhs_expr() argument
1642 return chrec_convert (type, analyze_scalar_evolution (loop, rhs1), in interpret_rhs_expr()
1648 return chrec_convert (type, analyze_scalar_evolution (loop, rhs1), in interpret_rhs_expr()
1668 chrec1 = analyze_scalar_evolution (loop, rhs1); in interpret_rhs_expr()
1669 chrec2 = analyze_scalar_evolution (loop, rhs2); in interpret_rhs_expr()
1676 chrec1 = analyze_scalar_evolution (loop, rhs1); in interpret_rhs_expr()
1677 chrec2 = analyze_scalar_evolution (loop, rhs2); in interpret_rhs_expr()
1684 chrec1 = analyze_scalar_evolution (loop, rhs1); in interpret_rhs_expr()
1685 chrec2 = analyze_scalar_evolution (loop, rhs2); in interpret_rhs_expr()
1692 chrec1 = analyze_scalar_evolution (loop, rhs1); in interpret_rhs_expr()
1701 chrec1 = analyze_scalar_evolution (loop, rhs1); in interpret_rhs_expr()
1709 chrec1 = analyze_scalar_evolution (loop, rhs1); in interpret_rhs_expr()
1710 chrec2 = analyze_scalar_evolution (loop, rhs2); in interpret_rhs_expr()
1717 chrec1 = analyze_scalar_evolution (loop, rhs1); in interpret_rhs_expr()
1732 interpret_expr (struct loop *loop, gimple at_stmt, tree expr) in interpret_expr() argument
1746 return interpret_rhs_expr (loop, at_stmt, type, in interpret_expr()
1753 interpret_gimple_assign (struct loop *loop, gimple stmt) in interpret_gimple_assign() argument
1758 return interpret_rhs_expr (loop, stmt, type, in interpret_gimple_assign()
1775 compute_scalar_evolution_in_loop (struct loop *wrto_loop, in compute_scalar_evolution_in_loop()
1776 struct loop *def_loop, in compute_scalar_evolution_in_loop()
1797 analyze_scalar_evolution_1 (struct loop *loop, tree var, tree res) in analyze_scalar_evolution_1() argument
1802 struct loop *def_loop; in analyze_scalar_evolution_1()
1804 if (loop == NULL || TREE_CODE (type) == VECTOR_TYPE) in analyze_scalar_evolution_1()
1808 return interpret_expr (loop, NULL, var); in analyze_scalar_evolution_1()
1815 || !flow_bb_inside_loop_p (loop, bb)) in analyze_scalar_evolution_1()
1824 if (loop != bb->loop_father) in analyze_scalar_evolution_1()
1826 (find_common_loop (loop, bb->loop_father), bb->loop_father, res); in analyze_scalar_evolution_1()
1831 if (loop != def_loop) in analyze_scalar_evolution_1()
1834 res = compute_scalar_evolution_in_loop (loop, def_loop, res); in analyze_scalar_evolution_1()
1842 res = interpret_gimple_assign (loop, def); in analyze_scalar_evolution_1()
1847 res = interpret_loop_phi (loop, def); in analyze_scalar_evolution_1()
1849 res = interpret_condition_phi (loop, def); in analyze_scalar_evolution_1()
1863 if (loop == def_loop) in analyze_scalar_evolution_1()
1864 set_scalar_evolution (block_before_loop (loop), var, res); in analyze_scalar_evolution_1()
1883 analyze_scalar_evolution (struct loop *loop, tree var) in analyze_scalar_evolution() argument
1890 fprintf (dump_file, " (loop_nb = %d)\n", loop->num); in analyze_scalar_evolution()
1896 res = get_scalar_evolution (block_before_loop (loop), var); in analyze_scalar_evolution()
1897 res = analyze_scalar_evolution_1 (loop, var, res); in analyze_scalar_evolution()
1956 analyze_scalar_evolution_in_loop (struct loop *wrto_loop, struct loop *use_loop, in analyze_scalar_evolution_in_loop()
2050 struct loop *loop; in loop_closed_phi_def() local
2059 loop = loop_containing_stmt (SSA_NAME_DEF_STMT (var)); in loop_closed_phi_def()
2060 exit = single_exit (loop); in loop_closed_phi_def()
2074 static tree instantiate_scev_r (basic_block, struct loop *, tree, bool,
2093 struct loop *evolution_loop, tree chrec, in instantiate_scev_name()
2097 struct loop *def_loop; in instantiate_scev_name()
2149 loop_p loop = loop_containing_stmt (SSA_NAME_DEF_STMT (chrec)); in instantiate_scev_name() local
2150 res = analyze_scalar_evolution (loop, chrec); in instantiate_scev_name()
2151 res = compute_overall_effect_of_inner_loop (loop, res); in instantiate_scev_name()
2185 struct loop *evolution_loop, tree chrec, in instantiate_scev_poly()
2238 struct loop *evolution_loop, tree chrec, enum tree_code code, in instantiate_scev_binary()
2297 struct loop *evolution_loop, tree chrec, in instantiate_array_ref()
2333 struct loop *evolution_loop, tree chrec, in instantiate_scev_convert()
2380 struct loop *evolution_loop, tree chrec, in instantiate_scev_not()
2428 struct loop *evolution_loop, tree chrec, in instantiate_scev_3()
2475 struct loop *evolution_loop, tree chrec, in instantiate_scev_2()
2514 struct loop *evolution_loop, tree chrec, in instantiate_scev_1()
2546 struct loop *evolution_loop, tree chrec, in instantiate_scev_r()
2640 instantiate_scev (basic_block instantiate_below, struct loop *evolution_loop, in instantiate_scev()
2677 resolve_mixers (struct loop *loop, tree chrec) in resolve_mixers() argument
2680 tree ret = instantiate_scev_r (block_before_loop (loop), loop, chrec, true, in resolve_mixers()
2710 number_of_latch_executions (struct loop *loop) in number_of_latch_executions() argument
2719 res = loop->nb_iterations; in number_of_latch_executions()
2729 exit = single_exit (loop); in number_of_latch_executions()
2731 if (exit && number_of_iterations_exit (loop, exit, &niter_desc, false)) in number_of_latch_executions()
2757 loop->nb_iterations = res; in number_of_latch_executions()
2772 number_of_exit_cond_executions (struct loop *loop) in number_of_exit_cond_executions() argument
2774 tree ret = number_of_latch_executions (loop); in number_of_exit_cond_executions()
2956 struct loop *loop; in analyze_scalar_evolution_for_all_loop_phi_nodes() local
2960 loop = loop_containing_stmt (cond); in analyze_scalar_evolution_for_all_loop_phi_nodes()
2961 bb = loop->header; in analyze_scalar_evolution_for_all_loop_phi_nodes()
2969 (loop, in analyze_scalar_evolution_for_all_loop_phi_nodes()
2970 analyze_scalar_evolution (loop, PHI_RESULT (phi))); in analyze_scalar_evolution_for_all_loop_phi_nodes()
3037 struct loop *loop; in scev_initialize() local
3045 FOR_EACH_LOOP (li, loop, 0) in scev_initialize()
3047 loop->nb_iterations = NULL_TREE; in scev_initialize()
3070 struct loop *loop; in scev_reset() local
3077 FOR_EACH_LOOP (li, loop, 0) in scev_reset()
3079 loop->nb_iterations = NULL_TREE; in scev_reset()
3105 simple_iv (struct loop *wrto_loop, struct loop *use_loop, tree op, in simple_iv()
3237 struct loop *loop, *ex_loop; in scev_const_prop() local
3248 loop = bb->loop_father; in scev_const_prop()
3264 ev = resolve_mixers (loop, analyze_scalar_evolution (loop, name)); in scev_const_prop()
3302 FOR_EACH_LOOP (li, loop, LI_FROM_INNERMOST) in scev_const_prop()
3310 exit = single_exit (loop); in scev_const_prop()
3314 niter = number_of_latch_executions (loop); in scev_const_prop()
3323 ex_loop = superloop_at_depth (loop, in scev_const_prop()
3344 def = analyze_scalar_evolution_in_loop (ex_loop, loop, def, NULL); in scev_const_prop()