tree-optimize.c (init_tree_optimization_passes): Add pass_record_bounds.
authorZdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
Sat, 25 Sep 2004 12:53:26 +0000 (14:53 +0200)
committerZdenek Dvorak <rakdver@gcc.gnu.org>
Sat, 25 Sep 2004 12:53:26 +0000 (12:53 +0000)
* tree-optimize.c (init_tree_optimization_passes): Add
pass_record_bounds.
* tree-pass.h (pass_record_bounds): Declare.
* tree-ssa-loop.c (tree_ssa_loop_bounds, pass_record_bounds):
New pass.

From-SVN: r88097

gcc/ChangeLog
gcc/tree-optimize.c
gcc/tree-pass.h
gcc/tree-ssa-loop.c

index 63d20983690bfe56c7391a2140d0c6ef69bbcc5d..f267169a8d902e8f4c199df9b13b0e30d0976e74 100644 (file)
@@ -1,3 +1,11 @@
+2004-09-25  Zdenek Dvorak  <rakdver@atrey.karlin.mff.cuni.cz>
+
+       * tree-optimize.c (init_tree_optimization_passes): Add
+       pass_record_bounds.
+       * tree-pass.h (pass_record_bounds): Declare.
+       * tree-ssa-loop.c (tree_ssa_loop_bounds, pass_record_bounds):
+       New pass.
+
 2004-09-25  Zdenek Dvorak  <rakdver@atrey.karlin.mff.cuni.cz>
 
        PR tree-optimization/17474
index 3bcc1cde47b85deb3271f4a422806826dd3dab02..aa3df9e787c9a71be4bffed781508043c4b16007 100644 (file)
@@ -393,6 +393,7 @@ init_tree_optimization_passes (void)
   NEXT_PASS (pass_lim);
   NEXT_PASS (pass_unswitch);
   NEXT_PASS (pass_iv_canon);
+  NEXT_PASS (pass_record_bounds);
   NEXT_PASS (pass_if_conversion);
   NEXT_PASS (pass_vectorize);
   NEXT_PASS (pass_linear_transform);
index ae19e2de517cd1395db3ee1fd33e7794b4a0f859..6250ae6140bfa76ae29a628db366a25b2675b48e 100644 (file)
@@ -127,6 +127,7 @@ extern struct tree_opt_pass pass_loop_init;
 extern struct tree_opt_pass pass_lim;
 extern struct tree_opt_pass pass_unswitch;
 extern struct tree_opt_pass pass_iv_canon;
+extern struct tree_opt_pass pass_record_bounds;
 extern struct tree_opt_pass pass_if_conversion;
 extern struct tree_opt_pass pass_vectorize;
 extern struct tree_opt_pass pass_complete_unroll;
index 19f784d9bbfb87285535ce972820e6123fbd2280..b1d854e9acd9ace973a20f73136ed3182d0079da 100644 (file)
@@ -297,6 +297,35 @@ struct tree_opt_pass pass_iv_canon =
   0                                    /* letter */
 };
 
+/* Record bounds on numbers of iterations of loops.  */
+
+static void
+tree_ssa_loop_bounds (void)
+{
+  if (!current_loops)
+    return;
+
+  estimate_numbers_of_iterations (current_loops);
+  scev_reset ();
+}
+
+struct tree_opt_pass pass_record_bounds =
+{
+  "bounds",                            /* name */
+  NULL,                                        /* gate */
+  tree_ssa_loop_bounds,                        /* execute */
+  NULL,                                        /* sub */
+  NULL,                                        /* next */
+  0,                                   /* static_pass_number */
+  0,                                   /* tv_id */
+  PROP_cfg | PROP_ssa,                 /* properties_required */
+  0,                                   /* properties_provided */
+  0,                                   /* properties_destroyed */
+  0,                                   /* todo_flags_start */
+  0,                                   /* todo_flags_finish */
+  0                                    /* letter */
+};
+
 /* Complete unrolling of loops.  */
 
 static void