summaryrefslogtreecommitdiff
path: root/gcc/loop-init.c
diff options
context:
space:
mode:
authorbonzini <bonzini@138bc75d-0d04-0410-961f-82ee72b054a4>2005-08-10 09:02:48 +0000
committerbonzini <bonzini@138bc75d-0d04-0410-961f-82ee72b054a4>2005-08-10 09:02:48 +0000
commit228967a9230a164d744d7829974f3daf4fde55eb (patch)
tree7154582b6e5a6b54e05449f8475c0e96e2ad36f0 /gcc/loop-init.c
parent84e0b98da311c5814c05fcb821d89abf2b1069b1 (diff)
downloadgcc-228967a9230a164d744d7829974f3daf4fde55eb.tar.gz
2005-08-09 Paolo Bonzini <bonzini@gnu.org>
* bb-reorder.c (pass_duplicate_computed_gotos, pass_partition_blocks): Add dump. * cfglayout.c (pass_insn_locators_initialize): Add dump. * emit-rtl.c (pass_unshare_all_rtl, pass_remove_unnecessary_notes): Add dump. * except.c (pass_convert_to_eh_region_ranges): Add dump. * final.c (pass_shorten_branches): Add dump. * flow.c (pass_recompute_reg_usage, pass_remove_death_notes): Add dump. (pass_life): Rename dump. (rest_of_handle_flow2): Remove initial verify_flow_info. * function.c (pass_instantiate_virtual_regs): Add dump. * integrate.c (pass_initial_value_sets): Add dump. * jump.c (pass_cleanup_barriers, pass_purge_lineno_notes): Add dump. * loop-init.c (pass_rtl_loop_init, pass_rtl_loop_done): Rename dump. (pass_rtl_move_loop_invariants, pass_rtl_unswitch, pass_rtl_doloop, pass_rtl_unroll_and_peel_loops): Rename dump and add gate. (gate_rtl_move_loop_invariants, gate_rtl_unswitch, gate_rtl_doloop, gate_rtl_unrool_and_peel_loops): New. (rtl_move_loop_invariants, rtl_unswitch, rtl_unrool_and_peel_loops, rtl_doloop): Do not look at flags. * mode-switching.c (pass_mode_switching): Add dump. * recog.c (pass_split_all_insns, pass_split_for_shorten_branches, pass_split_before_regstack): Add dump. * regmove.c (pass_stack_adjustments): Add dump. * tree-optimize.c (pass_fixup_cfg): Add dump. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@102945 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/loop-init.c')
-rw-r--r--gcc/loop-init.c58
1 files changed, 42 insertions, 16 deletions
diff --git a/gcc/loop-init.c b/gcc/loop-init.c
index 0e0b0cf4c88..517474a545b 100644
--- a/gcc/loop-init.c
+++ b/gcc/loop-init.c
@@ -171,7 +171,7 @@ rtl_loop_init (void)
struct tree_opt_pass pass_rtl_loop_init =
{
- "loopinit", /* name */
+ "loop2_init", /* name */
NULL, /* gate */
rtl_loop_init, /* execute */
NULL, /* sub */
@@ -215,7 +215,7 @@ rtl_loop_done (void)
struct tree_opt_pass pass_rtl_loop_done =
{
- "loopdone", /* name */
+ "loop2_done", /* name */
NULL, /* gate */
rtl_loop_done, /* execute */
NULL, /* sub */
@@ -232,17 +232,23 @@ struct tree_opt_pass pass_rtl_loop_done =
/* Loop invariant code motion. */
+static bool
+gate_rtl_move_loop_invariants (void)
+{
+ return flag_move_loop_invariants;
+}
+
static void
rtl_move_loop_invariants (void)
{
- if (current_loops && flag_move_loop_invariants)
+ if (current_loops)
move_loop_invariants (current_loops);
}
struct tree_opt_pass pass_rtl_move_loop_invariants =
{
- "loop_invariant", /* name */
- NULL, /* gate */
+ "loop2_invariant", /* name */
+ gate_rtl_move_loop_invariants, /* gate */
rtl_move_loop_invariants, /* execute */
NULL, /* sub */
NULL, /* next */
@@ -258,17 +264,23 @@ struct tree_opt_pass pass_rtl_move_loop_invariants =
/* Loop unswitching for RTL. */
+static bool
+gate_rtl_unswitch (void)
+{
+ return flag_unswitch_loops;
+}
+
static void
rtl_unswitch (void)
{
- if (current_loops && flag_unswitch_loops)
+ if (current_loops)
unswitch_loops (current_loops);
}
struct tree_opt_pass pass_rtl_unswitch =
{
- "loop_unswitch", /* name */
- NULL, /* gate */
+ "loop2_unswitch", /* name */
+ gate_rtl_unswitch, /* gate */
rtl_unswitch, /* execute */
NULL, /* sub */
NULL, /* next */
@@ -284,11 +296,16 @@ struct tree_opt_pass pass_rtl_unswitch =
/* Loop unswitching for RTL. */
+static bool
+gate_rtl_unroll_and_peel_loops (void)
+{
+ return (flag_peel_loops || flag_unroll_loops || flag_unroll_all_loops);
+}
+
static void
rtl_unroll_and_peel_loops (void)
{
- if (current_loops
- && (flag_peel_loops || flag_unroll_loops || flag_unroll_all_loops))
+ if (current_loops)
{
int flags = 0;
@@ -305,8 +322,8 @@ rtl_unroll_and_peel_loops (void)
struct tree_opt_pass pass_rtl_unroll_and_peel_loops =
{
- "loop_unroll", /* name */
- NULL, /* gate */
+ "loop2_unroll", /* name */
+ gate_rtl_unroll_and_peel_loops, /* gate */
rtl_unroll_and_peel_loops, /* execute */
NULL, /* sub */
NULL, /* next */
@@ -322,20 +339,29 @@ struct tree_opt_pass pass_rtl_unroll_and_peel_loops =
/* The doloop optimization. */
+static bool
+gate_rtl_doloop (void)
+{
+#ifdef HAVE_doloop_end
+ return (flag_branch_on_count_reg && HAVE_doloop_end);
+#else
+ return 0;
+#endif
+}
+
static void
rtl_doloop (void)
{
#ifdef HAVE_doloop_end
- if (current_loops
- && (flag_branch_on_count_reg && HAVE_doloop_end))
+ if (current_loops)
doloop_optimize_loops (current_loops);
#endif
}
struct tree_opt_pass pass_rtl_doloop =
{
- "loop_doloop", /* name */
- NULL, /* gate */
+ "loop2_doloop", /* name */
+ gate_rtl_doloop, /* gate */
rtl_doloop, /* execute */
NULL, /* sub */
NULL, /* next */