diff --git a/gcc/graphite-scop-detection.c b/gcc/graphite-scop-detection.c
index dac8eeb..2c1cc36 100644
--- a/gcc/graphite-scop-detection.c
+++ b/gcc/graphite-scop-detection.c
@@ -64,6 +64,7 @@ along with GCC; see the file COPYING3.  If not see
 
 #ifdef HAVE_isl
 #include "graphite-poly.h"
+#include "graphite.h"
 #include "graphite-scop-detection.h"
 
 /* Forward declarations.  */
@@ -1124,77 +1125,6 @@ contains_only_close_phi_nodes (basic_block bb)
   return true;
 }
 
-/* Print statistics for SCOP to FILE.  */
-
-static void
-print_graphite_scop_statistics (FILE* file, scop_p scop)
-{
-  long n_bbs = 0;
-  long n_loops = 0;
-  long n_stmts = 0;
-  long n_conditions = 0;
-  long n_p_bbs = 0;
-  long n_p_loops = 0;
-  long n_p_stmts = 0;
-  long n_p_conditions = 0;
-
-  basic_block bb;
-
-  FOR_ALL_BB_FN (bb, cfun)
-    {
-      gimple_stmt_iterator psi;
-      loop_p loop = bb->loop_father;
-
-      if (!bb_in_sese_p (bb, SCOP_REGION (scop)))
-	continue;
-
-      n_bbs++;
-      n_p_bbs += bb->count;
-
-      if (EDGE_COUNT (bb->succs) > 1)
-	{
-	  n_conditions++;
-	  n_p_conditions += bb->count;
-	}
-
-      for (psi = gsi_start_bb (bb); !gsi_end_p (psi); gsi_next (&psi))
-	{
-	  n_stmts++;
-	  n_p_stmts += bb->count;
-	}
-
-      if (loop->header == bb && loop_in_sese_p (loop, SCOP_REGION (scop)))
-	{
-	  n_loops++;
-	  n_p_loops += bb->count;
-	}
-
-    }
-
-  fprintf (file, "\nBefore limit_scops SCoP statistics (");
-  fprintf (file, "BBS:%ld, ", n_bbs);
-  fprintf (file, "LOOPS:%ld, ", n_loops);
-  fprintf (file, "CONDITIONS:%ld, ", n_conditions);
-  fprintf (file, "STMTS:%ld)\n", n_stmts);
-  fprintf (file, "\nBefore limit_scops SCoP profiling statistics (");
-  fprintf (file, "BBS:%ld, ", n_p_bbs);
-  fprintf (file, "LOOPS:%ld, ", n_p_loops);
-  fprintf (file, "CONDITIONS:%ld, ", n_p_conditions);
-  fprintf (file, "STMTS:%ld)\n", n_p_stmts);
-}
-
-/* Print statistics for SCOPS to FILE.  */
-
-static void
-print_graphite_statistics (FILE* file, vec<scop_p> scops)
-{
-  int i;
-  scop_p scop;
-
-  FOR_EACH_VEC_ELT (scops, i, scop)
-    print_graphite_scop_statistics (file, scop);
-}
-
 /* We limit all SCoPs to SCoPs, that are completely surrounded by a loop.
 
    Example:
@@ -1440,7 +1370,7 @@ build_scops (vec<scop_p> *scops)
   build_graphite_scops (regions, scops);
 
   if (dump_file && (dump_flags & TDF_DETAILS))
-    print_graphite_statistics (dump_file, *scops);
+    print_graphite_statistics (dump_file, "Before limit_scops ", *scops);
 
   limit_scops (scops);
   regions.release ();
diff --git a/gcc/graphite.c b/gcc/graphite.c
index ba8029a..820491a 100644
--- a/gcc/graphite.c
+++ b/gcc/graphite.c
@@ -77,6 +77,7 @@ along with GCC; see the file COPYING3.  If not see
 #ifdef HAVE_isl
 
 #include "graphite-poly.h"
+#include "graphite.h"
 #include "graphite-scop-detection.h"
 #include "graphite-isl-ast-to-gimple.h"
 #include "graphite-sese-to-poly.h"
@@ -140,7 +141,7 @@ print_global_statistics (FILE* file)
 /* Print statistics for SCOP to FILE.  */
 
 static void
-print_graphite_scop_statistics (FILE* file, scop_p scop)
+print_graphite_scop_statistics (FILE* file, const char *prefix, scop_p scop)
 {
   long n_bbs = 0;
   long n_loops = 0;
@@ -153,6 +154,9 @@ print_graphite_scop_statistics (FILE* file, scop_p scop)
 
   basic_block bb;
 
+  if (prefix == NULL)
+    prefix = "";
+
   FOR_ALL_BB_FN (bb, cfun)
     {
       gimple_stmt_iterator psi;
@@ -183,7 +187,7 @@ print_graphite_scop_statistics (FILE* file, scop_p scop)
 	}
     }
 
-  fprintf (file, "\nSCoP statistics (");
+  fprintf (file, "\n%sSCoP statistics (", prefix);
   fprintf (file, "BBS:%ld, ", n_bbs);
   fprintf (file, "LOOPS:%ld, ", n_loops);
   fprintf (file, "CONDITIONS:%ld, ", n_conditions);
@@ -195,17 +199,17 @@ print_graphite_scop_statistics (FILE* file, scop_p scop)
   fprintf (file, "STMTS:%ld)\n", n_p_stmts);
 }
 
-/* Print statistics for SCOPS to FILE.  */
+/* Print statistics for SCOPS to FILE. Prefix statistic headers with PREFIX.  */
 
-static void
-print_graphite_statistics (FILE* file, vec<scop_p> scops)
+void
+print_graphite_statistics (FILE* file, const char *prefix, vec<scop_p> scops)
 {
   int i;
 
   scop_p scop;
 
   FOR_EACH_VEC_ELT (scops, i, scop)
-    print_graphite_scop_statistics (file, scop);
+    print_graphite_scop_statistics (file, prefix, scop);
 }
 
 /* Initialize graphite: when there are no loops returns false.  */
@@ -286,7 +290,7 @@ graphite_transform_loops (void)
 
   if (dump_file && (dump_flags & TDF_DETAILS))
     {
-      print_graphite_statistics (dump_file, scops);
+      print_graphite_statistics (dump_file, NULL, scops);
       print_global_statistics (dump_file);
     }
 
diff --git a/gcc/graphite.h b/gcc/graphite.h
new file mode 100644
index 0000000..08330b3
--- /dev/null
+++ b/gcc/graphite.h
@@ -0,0 +1,27 @@
+/* Gimple Represented as Polyhedra.
+   Copyright (C) 2006-2015 Free Software Foundation, Inc.
+   Contributed by Sebastian Pop <sebastian.pop@amd.com> and
+   Tobias Grosser <grosser@fim.uni-passau.de>.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3, or (at your option)
+any later version.
+
+GCC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING3.  If not see
+<http://www.gnu.org/licenses/>.  */
+
+#ifndef GCC_GRAPHITE_H
+#define GCC_GRAPHITE_H
+
+extern void print_graphite_statistics (FILE*, const char*, vec<scop_p>);
+
+#endif /* GCC_GRAPHITE_H */
