/* Loop optimizations over tree-ssa.
- Copyright (C) 2003, 2005, 2006, 2007 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
This file is part of GCC.
#include "flags.h"
#include "tree-inline.h"
#include "tree-scalar-evolution.h"
+#include "toplev.h"
+#include "tree-vectorizer.h"
/* The loop superpass. */
}
};
+/* GRAPHITE optimizations. */
+
+static unsigned int
+graphite_transforms (void)
+{
+ if (!current_loops)
+ return 0;
+
+ graphite_transform_loops ();
+
+ return 0;
+}
+
+static bool
+gate_graphite_transforms (void)
+{
+ /* Enable -fgraphite pass if any one of the graphite optimization flags
+ is turned on. */
+ if (flag_loop_block || flag_loop_interchange || flag_loop_strip_mine
+ || flag_graphite_identity || flag_loop_parallelize_all)
+ flag_graphite = 1;
+
+ if (flag_loop_block)
+ sorry ("loop blocking not implemented");
+
+ return flag_graphite != 0;
+}
+
+struct gimple_opt_pass pass_graphite_transforms =
+{
+ {
+ GIMPLE_PASS,
+ "graphite", /* name */
+ gate_graphite_transforms, /* gate */
+ graphite_transforms, /* execute */
+ NULL, /* sub */
+ NULL, /* next */
+ 0, /* static_pass_number */
+ TV_GRAPHITE_TRANSFORMS, /* tv_id */
+ PROP_cfg | PROP_ssa, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ TODO_verify_loops /* todo_flags_finish */
+ }
+};
+
/* Check the correctness of the data dependence analyzers. */
static unsigned int
}
};
-/* Remove empty loops. */
-
-static unsigned int
-tree_ssa_empty_loop (void)
-{
- if (number_of_loops () <= 1)
- return 0;
-
- return remove_empty_loops ();
-}
-
-struct gimple_opt_pass pass_empty_loop =
-{
- {
- GIMPLE_PASS,
- "empty", /* name */
- NULL, /* gate */
- tree_ssa_empty_loop, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_COMPLETE_UNROLL, /* tv_id */
- PROP_cfg | PROP_ssa, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- TODO_dump_func | TODO_verify_loops
- | TODO_ggc_collect /* todo_flags_finish */
- }
-};
-
/* Record bounds on numbers of iterations of loops. */
static unsigned int
{
{
GIMPLE_PASS,
- NULL, /* name */
+ "*record_bounds", /* name */
NULL, /* gate */
tree_ssa_loop_bounds, /* execute */
NULL, /* sub */