public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH 1/2] [graphite] add more dumps on data dependence graph
@ 2015-12-14 21:48 Sebastian Pop
  2015-12-14 21:48 ` [PATCH 2/2] [graphite] update required isl versions Sebastian Pop
  2015-12-25 10:40 ` [PATCH 1/2] [graphite] add more dumps on data dependence graph Gerald Pfeifer
  0 siblings, 2 replies; 7+ messages in thread
From: Sebastian Pop @ 2015-12-14 21:48 UTC (permalink / raw)
  To: sebpop; +Cc: richard.guenther, gcc-patches, hiraditya, Sebastian Pop

---
 gcc/graphite-dependences.c    | 31 +++++++++++++++++++++++++++----
 gcc/graphite-poly.c           | 15 ++++++++++++++-
 gcc/graphite-scop-detection.c | 21 ++++++++++++++++-----
 3 files changed, 57 insertions(+), 10 deletions(-)

diff --git a/gcc/graphite-dependences.c b/gcc/graphite-dependences.c
index bb81ae3..7b7912a 100644
--- a/gcc/graphite-dependences.c
+++ b/gcc/graphite-dependences.c
@@ -89,8 +89,16 @@ scop_get_reads (scop_p scop, vec<poly_bb_p> pbbs)
 	if (pdr_read_p (pdr))
 	  {
 	    if (dump_file)
-	      print_pdr (dump_file, pdr);
+	      {
+		fprintf (dump_file, "Adding read to depedence graph: ");
+		print_pdr (dump_file, pdr);
+	      }
 	    res = isl_union_map_add_map (res, add_pdr_constraints (pdr, pbb));
+	    if (dump_file)
+	      {
+		fprintf (dump_file, "Reads depedence graph: ");
+		print_isl_union_map (dump_file, res);
+	      }
 	  }
     }
 
@@ -114,8 +122,16 @@ scop_get_must_writes (scop_p scop, vec<poly_bb_p> pbbs)
 	if (pdr_write_p (pdr))
 	  {
 	    if (dump_file)
-	      print_pdr (dump_file, pdr);
+	      {
+		fprintf (dump_file, "Adding must write to depedence graph: ");
+		print_pdr (dump_file, pdr);
+	      }
 	    res = isl_union_map_add_map (res, add_pdr_constraints (pdr, pbb));
+	    if (dump_file)
+	      {
+		fprintf (dump_file, "Must writes depedence graph: ");
+		print_isl_union_map (dump_file, res);
+	      }
 	  }
     }
 
@@ -139,9 +155,16 @@ scop_get_may_writes (scop_p scop, vec<poly_bb_p> pbbs)
 	if (pdr_may_write_p (pdr))
 	  {
 	    if (dump_file)
-	      print_pdr (dump_file, pdr);
-
+	      {
+		fprintf (dump_file, "Adding may write to depedence graph: ");
+		print_pdr (dump_file, pdr);
+	      }
 	    res = isl_union_map_add_map (res, add_pdr_constraints (pdr, pbb));
+	    if (dump_file)
+	      {
+		fprintf (dump_file, "May writes depedence graph: ");
+		print_isl_union_map (dump_file, res);
+	      }
 	  }
     }
 
diff --git a/gcc/graphite-poly.c b/gcc/graphite-poly.c
index f4bdd40..6c01a4c 100644
--- a/gcc/graphite-poly.c
+++ b/gcc/graphite-poly.c
@@ -31,13 +31,15 @@ along with GCC; see the file COPYING3.  If not see
 #include "tree.h"
 #include "gimple.h"
 #include "cfghooks.h"
-#include "gimple-pretty-print.h"
 #include "diagnostic-core.h"
 #include "fold-const.h"
 #include "gimple-iterator.h"
 #include "tree-ssa-loop.h"
 #include "cfgloop.h"
 #include "tree-data-ref.h"
+#include "pretty-print.h"
+#include "gimple-pretty-print.h"
+#include "tree-dump.h"
 
 #include <isl/constraint.h>
 #include <isl/set.h>
@@ -147,6 +149,17 @@ new_poly_dr (poly_bb_p pbb, gimple *stmt, enum poly_dr_type type,
   pdr->subscript_sizes = subscript_sizes;
   PDR_TYPE (pdr) = type;
   PBB_DRS (pbb).safe_push (pdr);
+
+  if (dump_file)
+    {
+      fprintf (dump_file, "Converting dr: ");
+      print_pdr (dump_file, pdr);
+      fprintf (dump_file, "To polyhedral representation:\n");
+      fprintf (dump_file, "  - access functions: ");
+      print_isl_map (dump_file, acc);
+      fprintf (dump_file, "  - subscripts: ");
+      print_isl_set (dump_file, subscript_sizes);
+    }
 }
 
 /* Free polyhedral data reference PDR.  */
diff --git a/gcc/graphite-scop-detection.c b/gcc/graphite-scop-detection.c
index 729a5fd..23562d1 100644
--- a/gcc/graphite-scop-detection.c
+++ b/gcc/graphite-scop-detection.c
@@ -1684,9 +1684,9 @@ build_cross_bb_scalars_def (scop_p scop, tree def, basic_block def_bb,
     if (def_bb != gimple_bb (use_stmt) && !is_gimple_debug (use_stmt))
       {
 	writes->safe_push (def);
-	DEBUG_PRINT (dp << "Adding scalar write:\n";
+	DEBUG_PRINT (dp << "Adding scalar write: ";
 		     print_generic_expr (dump_file, def, 0);
-		     dp << "From stmt:\n";
+		     dp << "\nFrom stmt: ";
 		     print_gimple_stmt (dump_file,
 					SSA_NAME_DEF_STMT (def), 0, 0));
 	/* This is required by the FOR_EACH_IMM_USE_STMT when we want to break
@@ -1713,9 +1713,9 @@ build_cross_bb_scalars_use (scop_p scop, tree use, gimple *use_stmt,
   gimple *def_stmt = SSA_NAME_DEF_STMT (use);
   if (gimple_bb (def_stmt) != gimple_bb (use_stmt))
     {
-      DEBUG_PRINT (dp << "Adding scalar read:";
+      DEBUG_PRINT (dp << "Adding scalar read: ";
 		   print_generic_expr (dump_file, use, 0);
-		   dp << "\nFrom stmt:";
+		   dp << "\nFrom stmt: ";
 		   print_gimple_stmt (dump_file, use_stmt, 0, 0));
       reads->safe_push (std::make_pair (use_stmt, use));
     }
@@ -1879,7 +1879,18 @@ gather_bbs::before_dom_children (basic_block bb)
   int i;
   data_reference_p dr;
   FOR_EACH_VEC_ELT (gbb->data_refs, i, dr)
-    scop->drs.safe_push (dr_info (dr, pbb));
+    {
+      DEBUG_PRINT (dp << "Adding memory ";
+		   if (dr->is_read)
+		     dp << "read: ";
+		   else
+		     dp << "write: ";
+		   print_generic_expr (dump_file, dr->ref, 0);
+		   dp << "\nFrom stmt: ";
+		   print_gimple_stmt (dump_file, dr->stmt, 0, 0));
+
+      scop->drs.safe_push (dr_info (dr, pbb));
+    }
 }
 
 /* Call-back for dom_walk executed after visiting the dominated
-- 
1.9.1

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 2/2] [graphite] update required isl versions
  2015-12-14 21:48 [PATCH 1/2] [graphite] add more dumps on data dependence graph Sebastian Pop
@ 2015-12-14 21:48 ` Sebastian Pop
  2015-12-16  9:42   ` Richard Biener
  2015-12-25 10:40 ` [PATCH 1/2] [graphite] add more dumps on data dependence graph Gerald Pfeifer
  1 sibling, 1 reply; 7+ messages in thread
From: Sebastian Pop @ 2015-12-14 21:48 UTC (permalink / raw)
  To: sebpop; +Cc: richard.guenther, gcc-patches, hiraditya, Sebastian Pop

we now check the isl version, as there are no real differences in existing files
in between isl 0.14 and isl 0.15.
---
 config/isl.m4                    | 29 +++++++++++--------
 configure                        | 23 +++++++++------
 gcc/config.in                    | 12 --------
 gcc/configure                    | 61 ++--------------------------------------
 gcc/configure.ac                 | 23 ---------------
 gcc/graphite-isl-ast-to-gimple.c | 10 ++-----
 gcc/graphite-optimize-isl.c      | 30 ++------------------
 gcc/graphite-poly.c              |  8 ------
 gcc/graphite-sese-to-poly.c      |  8 ------
 gcc/graphite.h                   |  1 +
 10 files changed, 39 insertions(+), 166 deletions(-)

diff --git a/config/isl.m4 b/config/isl.m4
index 459fac1..7387ff2 100644
--- a/config/isl.m4
+++ b/config/isl.m4
@@ -19,23 +19,23 @@
 
 # ISL_INIT_FLAGS ()
 # -------------------------
-# Provide configure switches for ISL support.
+# Provide configure switches for isl support.
 # Initialize isllibs/islinc according to the user input.
 AC_DEFUN([ISL_INIT_FLAGS],
 [
   AC_ARG_WITH([isl-include],
     [AS_HELP_STRING(
       [--with-isl-include=PATH],
-      [Specify directory for installed ISL include files])])
+      [Specify directory for installed isl include files])])
   AC_ARG_WITH([isl-lib],
     [AS_HELP_STRING(
       [--with-isl-lib=PATH],
-      [Specify the directory for the installed ISL library])])
+      [Specify the directory for the installed isl library])])
 
   AC_ARG_ENABLE(isl-version-check,
     [AS_HELP_STRING(
       [--disable-isl-version-check],
-      [disable check for ISL version])],
+      [disable check for isl version])],
     ENABLE_ISL_CHECK=$enableval,
     ENABLE_ISL_CHECK=yes)
   
@@ -58,15 +58,15 @@ AC_DEFUN([ISL_INIT_FLAGS],
   if test "x${with_isl_lib}" != x; then
     isllibs="-L$with_isl_lib"
   fi
-  dnl If no --with-isl flag was specified and there is in-tree ISL
+  dnl If no --with-isl flag was specified and there is in-tree isl
   dnl source, set up flags to use that and skip any version tests
-  dnl as we cannot run them before building ISL.
+  dnl as we cannot run them before building isl.
   if test "x${islinc}" = x && test "x${isllibs}" = x \
      && test -d ${srcdir}/isl; then
     isllibs='-L$$r/$(HOST_SUBDIR)/isl/'"$lt_cv_objdir"' '
     islinc='-I$$r/$(HOST_SUBDIR)/isl/include -I$$s/isl/include'
     ENABLE_ISL_CHECK=no
-    AC_MSG_WARN([using in-tree ISL, disabling version check])
+    AC_MSG_WARN([using in-tree isl, disabling version check])
   fi
 
   isllibs="${isllibs} -lisl"
@@ -75,7 +75,7 @@ AC_DEFUN([ISL_INIT_FLAGS],
 
 # ISL_REQUESTED (ACTION-IF-REQUESTED, ACTION-IF-NOT)
 # ----------------------------------------------------
-# Provide actions for failed ISL detection.
+# Provide actions for failed isl detection.
 AC_DEFUN([ISL_REQUESTED],
 [
   AC_REQUIRE([ISL_INIT_FLAGS])
@@ -106,12 +106,17 @@ AC_DEFUN([ISL_CHECK_VERSION],
     LDFLAGS="${_isl_saved_LDFLAGS} ${isllibs}"
     LIBS="${_isl_saved_LIBS} -lisl"
 
-    AC_MSG_CHECKING([for compatible ISL])
-    AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <isl/val.h>]], [[;]])],
-	[gcc_cv_isl=yes],
-	[gcc_cv_isl=no])
+    AC_MSG_CHECKING([for isl 0.15 (or deprecated 0.14)])
+    AC_TRY_LINK([#include <isl/ctx.h>],
+                [isl_ctx_get_max_operations (isl_ctx_alloc ());],
+                [gcc_cv_isl=yes],
+                [gcc_cv_isl=no])
     AC_MSG_RESULT([$gcc_cv_isl])
 
+    if test "${gcc_cv_isl}" = no ; then
+      AC_MSG_RESULT([recommended isl version is 0.15, minimum required isl version 0.14 is deprecated])
+    fi
+
     CFLAGS=$_isl_saved_CFLAGS
     LDFLAGS=$_isl_saved_LDFLAGS
     LIBS=$_isl_saved_LIBS
diff --git a/configure b/configure
index 090615f..a6495c4 100755
--- a/configure
+++ b/configure
@@ -1492,7 +1492,7 @@ Optional Features:
                           build static libjava [default=no]
   --enable-bootstrap      enable bootstrapping [yes if native build]
   --disable-isl-version-check
-                          disable check for ISL version
+                          disable check for isl version
   --enable-lto            enable link time optimization support
   --enable-linker-plugin-configure-flags=FLAGS
                           additional flags for configuring linker plugins
@@ -1553,8 +1553,8 @@ Optional Packages:
                           package. Equivalent to
                           --with-isl-include=PATH/include plus
                           --with-isl-lib=PATH/lib
-  --with-isl-include=PATH Specify directory for installed ISL include files
-  --with-isl-lib=PATH     Specify the directory for the installed ISL library
+  --with-isl-include=PATH Specify directory for installed isl include files
+  --with-isl-lib=PATH     Specify the directory for the installed isl library
   --with-build-sysroot=SYSROOT
                           use sysroot as the system root during the build
   --with-debug-prefix-map='A=B C=D ...'
@@ -6003,8 +6003,8 @@ fi
     isllibs='-L$$r/$(HOST_SUBDIR)/isl/'"$lt_cv_objdir"' '
     islinc='-I$$r/$(HOST_SUBDIR)/isl/include -I$$s/isl/include'
     ENABLE_ISL_CHECK=no
-    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using in-tree ISL, disabling version check" >&5
-$as_echo "$as_me: WARNING: using in-tree ISL, disabling version check" >&2;}
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using in-tree isl, disabling version check" >&5
+$as_echo "$as_me: WARNING: using in-tree isl, disabling version check" >&2;}
   fi
 
   isllibs="${isllibs} -lisl"
@@ -6020,15 +6020,15 @@ $as_echo "$as_me: WARNING: using in-tree ISL, disabling version check" >&2;}
     LDFLAGS="${_isl_saved_LDFLAGS} ${isllibs}"
     LIBS="${_isl_saved_LIBS} -lisl"
 
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for compatible ISL" >&5
-$as_echo_n "checking for compatible ISL... " >&6; }
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for isl 0.15 (or deprecated 0.14)" >&5
+$as_echo_n "checking for isl 0.15 (or deprecated 0.14)... " >&6; }
     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#include <isl/val.h>
+#include <isl/ctx.h>
 int
 main ()
 {
-;
+isl_ctx_get_max_operations (isl_ctx_alloc ());
   ;
   return 0;
 }
@@ -6043,6 +6043,11 @@ rm -f core conftest.err conftest.$ac_objext \
     { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_isl" >&5
 $as_echo "$gcc_cv_isl" >&6; }
 
+    if test "${gcc_cv_isl}" = no ; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: recommended isl version is 0.15, minimum required isl version 0.14 is deprecated" >&5
+$as_echo "recommended isl version is 0.15, minimum required isl version 0.14 is deprecated" >&6; }
+    fi
+
     CFLAGS=$_isl_saved_CFLAGS
     LDFLAGS=$_isl_saved_LDFLAGS
     LIBS=$_isl_saved_LIBS
diff --git a/gcc/config.in b/gcc/config.in
index da745c9..f1977c6 100644
--- a/gcc/config.in
+++ b/gcc/config.in
@@ -1372,24 +1372,12 @@
 #endif
 
 
-/* Define if isl_ctx_get_max_operations exists. */
-#ifndef USED_FOR_TARGET
-#undef HAVE_ISL_CTX_MAX_OPERATIONS
-#endif
-
-
 /* Define if isl_options_set_schedule_serialize_sccs exists. */
 #ifndef USED_FOR_TARGET
 #undef HAVE_ISL_OPTIONS_SET_SCHEDULE_SERIALIZE_SCCS
 #endif
 
 
-/* Define if isl_schedule_constraints_compute_schedule exists. */
-#ifndef USED_FOR_TARGET
-#undef HAVE_ISL_SCHED_CONSTRAINTS_COMPUTE_SCHEDULE
-#endif
-
-
 /* Define to 1 if you have the `kill' function. */
 #ifndef USED_FOR_TARGET
 #undef HAVE_KILL
diff --git a/gcc/configure b/gcc/configure
index 23f92c3..f75d69ab 100755
--- a/gcc/configure
+++ b/gcc/configure
@@ -16378,7 +16378,7 @@ _LT_EOF
 	if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
 	  export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
 	else
-	  export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+	  export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
 	fi
 	aix_use_runtimelinking=no
 
@@ -20864,7 +20864,7 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie
     if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
       export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
     else
-      export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+      export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
     fi
     ;;
   pw32*)
@@ -28911,29 +28911,6 @@ if test "x${ISLLIBS}" != "x" ; then
   saved_LIBS="$LIBS"
   LIBS="$LIBS $ISLLIBS $GMPLIBS"
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking Checking for isl_schedule_constraints_compute_schedule" >&5
-$as_echo_n "checking Checking for isl_schedule_constraints_compute_schedule... " >&6; }
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <isl/schedule.h>
-int
-main ()
-{
-isl_schedule_constraints_compute_schedule (NULL);
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_cxx_try_link "$LINENO"; then :
-  ac_has_isl_schedule_constraints_compute_schedule=yes
-else
-  ac_has_isl_schedule_constraints_compute_schedule=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_has_isl_schedule_constraints_compute_schedule" >&5
-$as_echo "$ac_has_isl_schedule_constraints_compute_schedule" >&6; }
-
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking Checking for isl_options_set_schedule_serialize_sccs" >&5
 $as_echo_n "checking Checking for isl_options_set_schedule_serialize_sccs... " >&6; }
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -28957,48 +28934,14 @@ rm -f core conftest.err conftest.$ac_objext \
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_has_isl_options_set_schedule_serialize_sccs" >&5
 $as_echo "$ac_has_isl_options_set_schedule_serialize_sccs" >&6; }
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking Checking for isl_ctx_get_max_operations" >&5
-$as_echo_n "checking Checking for isl_ctx_get_max_operations... " >&6; }
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <isl/ctx.h>
-int
-main ()
-{
-isl_ctx_get_max_operations (isl_ctx_alloc ());
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_cxx_try_link "$LINENO"; then :
-  ac_has_isl_ctx_get_max_operations=yes
-else
-  ac_has_isl_ctx_get_max_operations=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_has_isl_ctx_get_max_operations" >&5
-$as_echo "$ac_has_isl_ctx_get_max_operations" >&6; }
-
   LIBS="$saved_LIBS"
   CXXFLAGS="$saved_CXXFLAGS"
 
-  if test x"$ac_has_isl_schedule_constraints_compute_schedule" = x"yes"; then
-
-$as_echo "#define HAVE_ISL_SCHED_CONSTRAINTS_COMPUTE_SCHEDULE 1" >>confdefs.h
-
-  fi
-
   if test x"$ac_has_isl_options_set_schedule_serialize_sccs" = x"yes"; then
 
 $as_echo "#define HAVE_ISL_OPTIONS_SET_SCHEDULE_SERIALIZE_SCCS 1" >>confdefs.h
 
   fi
-  if test x"$ac_has_isl_ctx_get_max_operations" = x"yes"; then
-
-$as_echo "#define HAVE_ISL_CTX_MAX_OPERATIONS 1" >>confdefs.h
-
-  fi
 fi
 
 # Check for plugin support
diff --git a/gcc/configure.ac b/gcc/configure.ac
index a2caf29..9382ab2 100644
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -5919,13 +5919,6 @@ if test "x${ISLLIBS}" != "x" ; then
   saved_LIBS="$LIBS"
   LIBS="$LIBS $ISLLIBS $GMPLIBS"
 
-  AC_MSG_CHECKING([Checking for isl_schedule_constraints_compute_schedule])
-  AC_TRY_LINK([#include <isl/schedule.h>],
-              [isl_schedule_constraints_compute_schedule (NULL);],
-              [ac_has_isl_schedule_constraints_compute_schedule=yes],
-              [ac_has_isl_schedule_constraints_compute_schedule=no])
-  AC_MSG_RESULT($ac_has_isl_schedule_constraints_compute_schedule)
-
   AC_MSG_CHECKING([Checking for isl_options_set_schedule_serialize_sccs])
   AC_TRY_LINK([#include <isl/schedule.h>],
               [isl_options_set_schedule_serialize_sccs (NULL, 0);],
@@ -5933,29 +5926,13 @@ if test "x${ISLLIBS}" != "x" ; then
               [ac_has_isl_options_set_schedule_serialize_sccs=no])
   AC_MSG_RESULT($ac_has_isl_options_set_schedule_serialize_sccs)
 
-  AC_MSG_CHECKING([Checking for isl_ctx_get_max_operations])
-  AC_TRY_LINK([#include <isl/ctx.h>],
-              [isl_ctx_get_max_operations (isl_ctx_alloc ());],
-              [ac_has_isl_ctx_get_max_operations=yes],
-              [ac_has_isl_ctx_get_max_operations=no])
-  AC_MSG_RESULT($ac_has_isl_ctx_get_max_operations)
-
   LIBS="$saved_LIBS"
   CXXFLAGS="$saved_CXXFLAGS"
 
-  if test x"$ac_has_isl_schedule_constraints_compute_schedule" = x"yes"; then
-     AC_DEFINE(HAVE_ISL_SCHED_CONSTRAINTS_COMPUTE_SCHEDULE, 1,
-               [Define if isl_schedule_constraints_compute_schedule exists.])
-  fi
-
   if test x"$ac_has_isl_options_set_schedule_serialize_sccs" = x"yes"; then
      AC_DEFINE(HAVE_ISL_OPTIONS_SET_SCHEDULE_SERIALIZE_SCCS, 1,
                [Define if isl_options_set_schedule_serialize_sccs exists.])
   fi
-  if test x"$ac_has_isl_ctx_get_max_operations" = x"yes"; then
-     AC_DEFINE(HAVE_ISL_CTX_MAX_OPERATIONS, 1,
-               [Define if isl_ctx_get_max_operations exists.])
-  fi
 fi
 
 GCC_ENABLE_PLUGINS
diff --git a/gcc/graphite-isl-ast-to-gimple.c b/gcc/graphite-isl-ast-to-gimple.c
index ed2a896..2f04de5 100644
--- a/gcc/graphite-isl-ast-to-gimple.c
+++ b/gcc/graphite-isl-ast-to-gimple.c
@@ -60,15 +60,7 @@ along with GCC; see the file COPYING3.  If not see
 #include <isl/map.h>
 #include <isl/union_map.h>
 #include <isl/ast_build.h>
-
-/* Since ISL-0.13, the extern is in val_gmp.h.  */
-#if !defined(HAVE_ISL_SCHED_CONSTRAINTS_COMPUTE_SCHEDULE) && defined(__cplusplus)
-extern "C" {
-#endif
 #include <isl/val_gmp.h>
-#if !defined(HAVE_ISL_SCHED_CONSTRAINTS_COMPUTE_SCHEDULE) && defined(__cplusplus)
-}
-#endif
 
 #include "graphite.h"
 
@@ -589,6 +581,7 @@ binary_op_to_tree (tree type, __isl_take isl_ast_expr *expr, ivs_params &ip)
       return fold_build2 (TRUNC_DIV_EXPR, type, tree_lhs_expr, tree_rhs_expr);
 
 #if HAVE_ISL_OPTIONS_SET_SCHEDULE_SERIALIZE_SCCS
+    /* ISL-0.15 or later.  */
     case isl_ast_op_zdiv_r:
 #endif
     case isl_ast_op_pdiv_r:
@@ -762,6 +755,7 @@ gcc_expression_from_isl_expr_op (tree type, __isl_take isl_ast_expr *expr,
     case isl_ast_op_pdiv_r:
     case isl_ast_op_fdiv_q:
 #if HAVE_ISL_OPTIONS_SET_SCHEDULE_SERIALIZE_SCCS
+    /* ISL-0.15 or later.  */
     case isl_ast_op_zdiv_r:
 #endif
     case isl_ast_op_and:
diff --git a/gcc/graphite-optimize-isl.c b/gcc/graphite-optimize-isl.c
index 0ae5656..e124d0e 100644
--- a/gcc/graphite-optimize-isl.c
+++ b/gcc/graphite-optimize-isl.c
@@ -49,6 +49,7 @@ along with GCC; see the file COPYING3.  If not see
 #include <isl/options.h>
 #include <isl/ctx.h>
 #ifdef HAVE_ISL_OPTIONS_SET_SCHEDULE_SERIALIZE_SCCS
+/* ISL-0.15 or later.  */
 #include <isl/schedule_node.h>
 #include <isl/ast_build.h>
 #endif
@@ -56,6 +57,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "graphite.h"
 
 #ifdef HAVE_ISL_OPTIONS_SET_SCHEDULE_SERIALIZE_SCCS
+/* ISL-0.15 or later.  */
 
 /* get_schedule_for_node_st - Improve schedule for the schedule node.
    Only Simple loop tiling is considered.  */
@@ -371,12 +373,10 @@ static const int CONSTANT_BOUND = 20;
 bool
 optimize_isl (scop_p scop)
 {
-#ifdef HAVE_ISL_CTX_MAX_OPERATIONS
   int old_max_operations = isl_ctx_get_max_operations (scop->isl_context);
   int max_operations = PARAM_VALUE (PARAM_MAX_ISL_OPERATIONS);
   if (max_operations)
     isl_ctx_set_max_operations (scop->isl_context, max_operations);
-#endif
   isl_options_set_on_error (scop->isl_context, ISL_ON_ERROR_CONTINUE);
 
   isl_union_set *domain = scop_get_domains (scop);
@@ -388,20 +388,6 @@ optimize_isl (scop_p scop)
   isl_union_map *validity = dependences;
   isl_union_map *proximity = isl_union_map_copy (validity);
 
-#ifdef HAVE_ISL_SCHED_CONSTRAINTS_COMPUTE_SCHEDULE
-  isl_schedule_constraints *schedule_constraints;
-  schedule_constraints = isl_schedule_constraints_on_domain (domain);
-  schedule_constraints
-    = isl_schedule_constraints_set_proximity (schedule_constraints,
-					      proximity);
-  schedule_constraints
-    = isl_schedule_constraints_set_validity (schedule_constraints,
-					     isl_union_map_copy (validity));
-  schedule_constraints
-    = isl_schedule_constraints_set_coincidence (schedule_constraints,
-						validity);
-#endif
-
   isl_options_set_schedule_max_constant_term (scop->isl_context, CONSTANT_BOUND);
   isl_options_set_schedule_maximize_band_depth (scop->isl_context, 1);
 #ifdef HAVE_ISL_OPTIONS_SET_SCHEDULE_SERIALIZE_SCCS
@@ -418,17 +404,10 @@ optimize_isl (scop_p scop)
   isl_options_set_schedule_fuse (scop->isl_context, ISL_SCHEDULE_FUSE_MIN);
 #endif
 
-#ifdef HAVE_ISL_SCHED_CONSTRAINTS_COMPUTE_SCHEDULE
-  isl_schedule *schedule
-    = isl_schedule_constraints_compute_schedule (schedule_constraints);
-#else
   isl_schedule *schedule
     = isl_union_set_compute_schedule (domain, validity, proximity);
-#endif
-
   isl_options_set_on_error (scop->isl_context, ISL_ON_ERROR_ABORT);
 
-#ifdef HAVE_ISL_CTX_MAX_OPERATIONS
   isl_ctx_reset_operations (scop->isl_context);
   isl_ctx_set_max_operations (scop->isl_context, old_max_operations);
   if (!schedule || isl_ctx_last_error (scop->isl_context) == isl_error_quota)
@@ -440,12 +419,9 @@ optimize_isl (scop_p scop)
 	isl_schedule_free (schedule);
       return false;
     }
-#else
-  if (!schedule)
-    return false;
-#endif
 
 #ifdef HAVE_ISL_OPTIONS_SET_SCHEDULE_SERIALIZE_SCCS
+  /* ISL-0.15 or later.  */
   isl_union_map *schedule_map = get_schedule_map_st (schedule);
 #else
   isl_union_map *schedule_map = get_schedule_map (schedule);
diff --git a/gcc/graphite-poly.c b/gcc/graphite-poly.c
index 6c01a4c..44f0241 100644
--- a/gcc/graphite-poly.c
+++ b/gcc/graphite-poly.c
@@ -49,15 +49,7 @@ along with GCC; see the file COPYING3.  If not see
 #include <isl/ilp.h>
 #include <isl/aff.h>
 #include <isl/val.h>
-
-/* Since ISL-0.13, the extern is in val_gmp.h.  */
-#if !defined(HAVE_ISL_SCHED_CONSTRAINTS_COMPUTE_SCHEDULE) && defined(__cplusplus)
-extern "C" {
-#endif
 #include <isl/val_gmp.h>
-#if !defined(HAVE_ISL_SCHED_CONSTRAINTS_COMPUTE_SCHEDULE) && defined(__cplusplus)
-}
-#endif
 
 #include "graphite.h"
 
diff --git a/gcc/graphite-sese-to-poly.c b/gcc/graphite-sese-to-poly.c
index 480c552..43dcb41 100644
--- a/gcc/graphite-sese-to-poly.c
+++ b/gcc/graphite-sese-to-poly.c
@@ -55,15 +55,7 @@ along with GCC; see the file COPYING3.  If not see
 #include <isl/constraint.h>
 #include <isl/aff.h>
 #include <isl/val.h>
-
-/* Since ISL-0.13, the extern is in val_gmp.h.  */
-#if !defined(HAVE_ISL_SCHED_CONSTRAINTS_COMPUTE_SCHEDULE) && defined(__cplusplus)
-extern "C" {
-#endif
 #include <isl/val_gmp.h>
-#if !defined(HAVE_ISL_SCHED_CONSTRAINTS_COMPUTE_SCHEDULE) && defined(__cplusplus)
-}
-#endif
 
 #include "graphite.h"
 
diff --git a/gcc/graphite.h b/gcc/graphite.h
index c7589ba..289c0b4 100644
--- a/gcc/graphite.h
+++ b/gcc/graphite.h
@@ -25,6 +25,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "sese.h"
 
 #ifndef HAVE_ISL_OPTIONS_SET_SCHEDULE_SERIALIZE_SCCS
+  /* ISL-0.14.  */
 # define isl_stat int
 # define isl_stat_ok 0
 #endif
-- 
1.9.1

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 2/2] [graphite] update required isl versions
  2015-12-14 21:48 ` [PATCH 2/2] [graphite] update required isl versions Sebastian Pop
@ 2015-12-16  9:42   ` Richard Biener
  0 siblings, 0 replies; 7+ messages in thread
From: Richard Biener @ 2015-12-16  9:42 UTC (permalink / raw)
  To: Sebastian Pop; +Cc: Sebastian Pop, GCC Patches, hiraditya

On Mon, Dec 14, 2015 at 10:48 PM, Sebastian Pop <s.pop@samsung.com> wrote:
> we now check the isl version, as there are no real differences in existing files
> in between isl 0.14 and isl 0.15.

Looks good to me.

Richard.

> ---
>  config/isl.m4                    | 29 +++++++++++--------
>  configure                        | 23 +++++++++------
>  gcc/config.in                    | 12 --------
>  gcc/configure                    | 61 ++--------------------------------------
>  gcc/configure.ac                 | 23 ---------------
>  gcc/graphite-isl-ast-to-gimple.c | 10 ++-----
>  gcc/graphite-optimize-isl.c      | 30 ++------------------
>  gcc/graphite-poly.c              |  8 ------
>  gcc/graphite-sese-to-poly.c      |  8 ------
>  gcc/graphite.h                   |  1 +
>  10 files changed, 39 insertions(+), 166 deletions(-)
>
> diff --git a/config/isl.m4 b/config/isl.m4
> index 459fac1..7387ff2 100644
> --- a/config/isl.m4
> +++ b/config/isl.m4
> @@ -19,23 +19,23 @@
>
>  # ISL_INIT_FLAGS ()
>  # -------------------------
> -# Provide configure switches for ISL support.
> +# Provide configure switches for isl support.
>  # Initialize isllibs/islinc according to the user input.
>  AC_DEFUN([ISL_INIT_FLAGS],
>  [
>    AC_ARG_WITH([isl-include],
>      [AS_HELP_STRING(
>        [--with-isl-include=PATH],
> -      [Specify directory for installed ISL include files])])
> +      [Specify directory for installed isl include files])])
>    AC_ARG_WITH([isl-lib],
>      [AS_HELP_STRING(
>        [--with-isl-lib=PATH],
> -      [Specify the directory for the installed ISL library])])
> +      [Specify the directory for the installed isl library])])
>
>    AC_ARG_ENABLE(isl-version-check,
>      [AS_HELP_STRING(
>        [--disable-isl-version-check],
> -      [disable check for ISL version])],
> +      [disable check for isl version])],
>      ENABLE_ISL_CHECK=$enableval,
>      ENABLE_ISL_CHECK=yes)
>
> @@ -58,15 +58,15 @@ AC_DEFUN([ISL_INIT_FLAGS],
>    if test "x${with_isl_lib}" != x; then
>      isllibs="-L$with_isl_lib"
>    fi
> -  dnl If no --with-isl flag was specified and there is in-tree ISL
> +  dnl If no --with-isl flag was specified and there is in-tree isl
>    dnl source, set up flags to use that and skip any version tests
> -  dnl as we cannot run them before building ISL.
> +  dnl as we cannot run them before building isl.
>    if test "x${islinc}" = x && test "x${isllibs}" = x \
>       && test -d ${srcdir}/isl; then
>      isllibs='-L$$r/$(HOST_SUBDIR)/isl/'"$lt_cv_objdir"' '
>      islinc='-I$$r/$(HOST_SUBDIR)/isl/include -I$$s/isl/include'
>      ENABLE_ISL_CHECK=no
> -    AC_MSG_WARN([using in-tree ISL, disabling version check])
> +    AC_MSG_WARN([using in-tree isl, disabling version check])
>    fi
>
>    isllibs="${isllibs} -lisl"
> @@ -75,7 +75,7 @@ AC_DEFUN([ISL_INIT_FLAGS],
>
>  # ISL_REQUESTED (ACTION-IF-REQUESTED, ACTION-IF-NOT)
>  # ----------------------------------------------------
> -# Provide actions for failed ISL detection.
> +# Provide actions for failed isl detection.
>  AC_DEFUN([ISL_REQUESTED],
>  [
>    AC_REQUIRE([ISL_INIT_FLAGS])
> @@ -106,12 +106,17 @@ AC_DEFUN([ISL_CHECK_VERSION],
>      LDFLAGS="${_isl_saved_LDFLAGS} ${isllibs}"
>      LIBS="${_isl_saved_LIBS} -lisl"
>
> -    AC_MSG_CHECKING([for compatible ISL])
> -    AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <isl/val.h>]], [[;]])],
> -       [gcc_cv_isl=yes],
> -       [gcc_cv_isl=no])
> +    AC_MSG_CHECKING([for isl 0.15 (or deprecated 0.14)])
> +    AC_TRY_LINK([#include <isl/ctx.h>],
> +                [isl_ctx_get_max_operations (isl_ctx_alloc ());],
> +                [gcc_cv_isl=yes],
> +                [gcc_cv_isl=no])
>      AC_MSG_RESULT([$gcc_cv_isl])
>
> +    if test "${gcc_cv_isl}" = no ; then
> +      AC_MSG_RESULT([recommended isl version is 0.15, minimum required isl version 0.14 is deprecated])
> +    fi
> +
>      CFLAGS=$_isl_saved_CFLAGS
>      LDFLAGS=$_isl_saved_LDFLAGS
>      LIBS=$_isl_saved_LIBS
> diff --git a/configure b/configure
> index 090615f..a6495c4 100755
> --- a/configure
> +++ b/configure
> @@ -1492,7 +1492,7 @@ Optional Features:
>                            build static libjava [default=no]
>    --enable-bootstrap      enable bootstrapping [yes if native build]
>    --disable-isl-version-check
> -                          disable check for ISL version
> +                          disable check for isl version
>    --enable-lto            enable link time optimization support
>    --enable-linker-plugin-configure-flags=FLAGS
>                            additional flags for configuring linker plugins
> @@ -1553,8 +1553,8 @@ Optional Packages:
>                            package. Equivalent to
>                            --with-isl-include=PATH/include plus
>                            --with-isl-lib=PATH/lib
> -  --with-isl-include=PATH Specify directory for installed ISL include files
> -  --with-isl-lib=PATH     Specify the directory for the installed ISL library
> +  --with-isl-include=PATH Specify directory for installed isl include files
> +  --with-isl-lib=PATH     Specify the directory for the installed isl library
>    --with-build-sysroot=SYSROOT
>                            use sysroot as the system root during the build
>    --with-debug-prefix-map='A=B C=D ...'
> @@ -6003,8 +6003,8 @@ fi
>      isllibs='-L$$r/$(HOST_SUBDIR)/isl/'"$lt_cv_objdir"' '
>      islinc='-I$$r/$(HOST_SUBDIR)/isl/include -I$$s/isl/include'
>      ENABLE_ISL_CHECK=no
> -    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using in-tree ISL, disabling version check" >&5
> -$as_echo "$as_me: WARNING: using in-tree ISL, disabling version check" >&2;}
> +    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using in-tree isl, disabling version check" >&5
> +$as_echo "$as_me: WARNING: using in-tree isl, disabling version check" >&2;}
>    fi
>
>    isllibs="${isllibs} -lisl"
> @@ -6020,15 +6020,15 @@ $as_echo "$as_me: WARNING: using in-tree ISL, disabling version check" >&2;}
>      LDFLAGS="${_isl_saved_LDFLAGS} ${isllibs}"
>      LIBS="${_isl_saved_LIBS} -lisl"
>
> -    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for compatible ISL" >&5
> -$as_echo_n "checking for compatible ISL... " >&6; }
> +    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for isl 0.15 (or deprecated 0.14)" >&5
> +$as_echo_n "checking for isl 0.15 (or deprecated 0.14)... " >&6; }
>      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
>  /* end confdefs.h.  */
> -#include <isl/val.h>
> +#include <isl/ctx.h>
>  int
>  main ()
>  {
> -;
> +isl_ctx_get_max_operations (isl_ctx_alloc ());
>    ;
>    return 0;
>  }
> @@ -6043,6 +6043,11 @@ rm -f core conftest.err conftest.$ac_objext \
>      { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_isl" >&5
>  $as_echo "$gcc_cv_isl" >&6; }
>
> +    if test "${gcc_cv_isl}" = no ; then
> +      { $as_echo "$as_me:${as_lineno-$LINENO}: result: recommended isl version is 0.15, minimum required isl version 0.14 is deprecated" >&5
> +$as_echo "recommended isl version is 0.15, minimum required isl version 0.14 is deprecated" >&6; }
> +    fi
> +
>      CFLAGS=$_isl_saved_CFLAGS
>      LDFLAGS=$_isl_saved_LDFLAGS
>      LIBS=$_isl_saved_LIBS
> diff --git a/gcc/config.in b/gcc/config.in
> index da745c9..f1977c6 100644
> --- a/gcc/config.in
> +++ b/gcc/config.in
> @@ -1372,24 +1372,12 @@
>  #endif
>
>
> -/* Define if isl_ctx_get_max_operations exists. */
> -#ifndef USED_FOR_TARGET
> -#undef HAVE_ISL_CTX_MAX_OPERATIONS
> -#endif
> -
> -
>  /* Define if isl_options_set_schedule_serialize_sccs exists. */
>  #ifndef USED_FOR_TARGET
>  #undef HAVE_ISL_OPTIONS_SET_SCHEDULE_SERIALIZE_SCCS
>  #endif
>
>
> -/* Define if isl_schedule_constraints_compute_schedule exists. */
> -#ifndef USED_FOR_TARGET
> -#undef HAVE_ISL_SCHED_CONSTRAINTS_COMPUTE_SCHEDULE
> -#endif
> -
> -
>  /* Define to 1 if you have the `kill' function. */
>  #ifndef USED_FOR_TARGET
>  #undef HAVE_KILL
> diff --git a/gcc/configure b/gcc/configure
> index 23f92c3..f75d69ab 100755
> --- a/gcc/configure
> +++ b/gcc/configure
> @@ -16378,7 +16378,7 @@ _LT_EOF
>         if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
>           export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
>         else
> -         export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
> +         export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
>         fi
>         aix_use_runtimelinking=no
>
> @@ -20864,7 +20864,7 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie
>      if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
>        export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
>      else
> -      export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
> +      export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
>      fi
>      ;;
>    pw32*)
> @@ -28911,29 +28911,6 @@ if test "x${ISLLIBS}" != "x" ; then
>    saved_LIBS="$LIBS"
>    LIBS="$LIBS $ISLLIBS $GMPLIBS"
>
> -  { $as_echo "$as_me:${as_lineno-$LINENO}: checking Checking for isl_schedule_constraints_compute_schedule" >&5
> -$as_echo_n "checking Checking for isl_schedule_constraints_compute_schedule... " >&6; }
> -  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
> -/* end confdefs.h.  */
> -#include <isl/schedule.h>
> -int
> -main ()
> -{
> -isl_schedule_constraints_compute_schedule (NULL);
> -  ;
> -  return 0;
> -}
> -_ACEOF
> -if ac_fn_cxx_try_link "$LINENO"; then :
> -  ac_has_isl_schedule_constraints_compute_schedule=yes
> -else
> -  ac_has_isl_schedule_constraints_compute_schedule=no
> -fi
> -rm -f core conftest.err conftest.$ac_objext \
> -    conftest$ac_exeext conftest.$ac_ext
> -  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_has_isl_schedule_constraints_compute_schedule" >&5
> -$as_echo "$ac_has_isl_schedule_constraints_compute_schedule" >&6; }
> -
>    { $as_echo "$as_me:${as_lineno-$LINENO}: checking Checking for isl_options_set_schedule_serialize_sccs" >&5
>  $as_echo_n "checking Checking for isl_options_set_schedule_serialize_sccs... " >&6; }
>    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
> @@ -28957,48 +28934,14 @@ rm -f core conftest.err conftest.$ac_objext \
>    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_has_isl_options_set_schedule_serialize_sccs" >&5
>  $as_echo "$ac_has_isl_options_set_schedule_serialize_sccs" >&6; }
>
> -  { $as_echo "$as_me:${as_lineno-$LINENO}: checking Checking for isl_ctx_get_max_operations" >&5
> -$as_echo_n "checking Checking for isl_ctx_get_max_operations... " >&6; }
> -  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
> -/* end confdefs.h.  */
> -#include <isl/ctx.h>
> -int
> -main ()
> -{
> -isl_ctx_get_max_operations (isl_ctx_alloc ());
> -  ;
> -  return 0;
> -}
> -_ACEOF
> -if ac_fn_cxx_try_link "$LINENO"; then :
> -  ac_has_isl_ctx_get_max_operations=yes
> -else
> -  ac_has_isl_ctx_get_max_operations=no
> -fi
> -rm -f core conftest.err conftest.$ac_objext \
> -    conftest$ac_exeext conftest.$ac_ext
> -  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_has_isl_ctx_get_max_operations" >&5
> -$as_echo "$ac_has_isl_ctx_get_max_operations" >&6; }
> -
>    LIBS="$saved_LIBS"
>    CXXFLAGS="$saved_CXXFLAGS"
>
> -  if test x"$ac_has_isl_schedule_constraints_compute_schedule" = x"yes"; then
> -
> -$as_echo "#define HAVE_ISL_SCHED_CONSTRAINTS_COMPUTE_SCHEDULE 1" >>confdefs.h
> -
> -  fi
> -
>    if test x"$ac_has_isl_options_set_schedule_serialize_sccs" = x"yes"; then
>
>  $as_echo "#define HAVE_ISL_OPTIONS_SET_SCHEDULE_SERIALIZE_SCCS 1" >>confdefs.h
>
>    fi
> -  if test x"$ac_has_isl_ctx_get_max_operations" = x"yes"; then
> -
> -$as_echo "#define HAVE_ISL_CTX_MAX_OPERATIONS 1" >>confdefs.h
> -
> -  fi
>  fi
>
>  # Check for plugin support
> diff --git a/gcc/configure.ac b/gcc/configure.ac
> index a2caf29..9382ab2 100644
> --- a/gcc/configure.ac
> +++ b/gcc/configure.ac
> @@ -5919,13 +5919,6 @@ if test "x${ISLLIBS}" != "x" ; then
>    saved_LIBS="$LIBS"
>    LIBS="$LIBS $ISLLIBS $GMPLIBS"
>
> -  AC_MSG_CHECKING([Checking for isl_schedule_constraints_compute_schedule])
> -  AC_TRY_LINK([#include <isl/schedule.h>],
> -              [isl_schedule_constraints_compute_schedule (NULL);],
> -              [ac_has_isl_schedule_constraints_compute_schedule=yes],
> -              [ac_has_isl_schedule_constraints_compute_schedule=no])
> -  AC_MSG_RESULT($ac_has_isl_schedule_constraints_compute_schedule)
> -
>    AC_MSG_CHECKING([Checking for isl_options_set_schedule_serialize_sccs])
>    AC_TRY_LINK([#include <isl/schedule.h>],
>                [isl_options_set_schedule_serialize_sccs (NULL, 0);],
> @@ -5933,29 +5926,13 @@ if test "x${ISLLIBS}" != "x" ; then
>                [ac_has_isl_options_set_schedule_serialize_sccs=no])
>    AC_MSG_RESULT($ac_has_isl_options_set_schedule_serialize_sccs)
>
> -  AC_MSG_CHECKING([Checking for isl_ctx_get_max_operations])
> -  AC_TRY_LINK([#include <isl/ctx.h>],
> -              [isl_ctx_get_max_operations (isl_ctx_alloc ());],
> -              [ac_has_isl_ctx_get_max_operations=yes],
> -              [ac_has_isl_ctx_get_max_operations=no])
> -  AC_MSG_RESULT($ac_has_isl_ctx_get_max_operations)
> -
>    LIBS="$saved_LIBS"
>    CXXFLAGS="$saved_CXXFLAGS"
>
> -  if test x"$ac_has_isl_schedule_constraints_compute_schedule" = x"yes"; then
> -     AC_DEFINE(HAVE_ISL_SCHED_CONSTRAINTS_COMPUTE_SCHEDULE, 1,
> -               [Define if isl_schedule_constraints_compute_schedule exists.])
> -  fi
> -
>    if test x"$ac_has_isl_options_set_schedule_serialize_sccs" = x"yes"; then
>       AC_DEFINE(HAVE_ISL_OPTIONS_SET_SCHEDULE_SERIALIZE_SCCS, 1,
>                 [Define if isl_options_set_schedule_serialize_sccs exists.])
>    fi
> -  if test x"$ac_has_isl_ctx_get_max_operations" = x"yes"; then
> -     AC_DEFINE(HAVE_ISL_CTX_MAX_OPERATIONS, 1,
> -               [Define if isl_ctx_get_max_operations exists.])
> -  fi
>  fi
>
>  GCC_ENABLE_PLUGINS
> diff --git a/gcc/graphite-isl-ast-to-gimple.c b/gcc/graphite-isl-ast-to-gimple.c
> index ed2a896..2f04de5 100644
> --- a/gcc/graphite-isl-ast-to-gimple.c
> +++ b/gcc/graphite-isl-ast-to-gimple.c
> @@ -60,15 +60,7 @@ along with GCC; see the file COPYING3.  If not see
>  #include <isl/map.h>
>  #include <isl/union_map.h>
>  #include <isl/ast_build.h>
> -
> -/* Since ISL-0.13, the extern is in val_gmp.h.  */
> -#if !defined(HAVE_ISL_SCHED_CONSTRAINTS_COMPUTE_SCHEDULE) && defined(__cplusplus)
> -extern "C" {
> -#endif
>  #include <isl/val_gmp.h>
> -#if !defined(HAVE_ISL_SCHED_CONSTRAINTS_COMPUTE_SCHEDULE) && defined(__cplusplus)
> -}
> -#endif
>
>  #include "graphite.h"
>
> @@ -589,6 +581,7 @@ binary_op_to_tree (tree type, __isl_take isl_ast_expr *expr, ivs_params &ip)
>        return fold_build2 (TRUNC_DIV_EXPR, type, tree_lhs_expr, tree_rhs_expr);
>
>  #if HAVE_ISL_OPTIONS_SET_SCHEDULE_SERIALIZE_SCCS
> +    /* ISL-0.15 or later.  */
>      case isl_ast_op_zdiv_r:
>  #endif
>      case isl_ast_op_pdiv_r:
> @@ -762,6 +755,7 @@ gcc_expression_from_isl_expr_op (tree type, __isl_take isl_ast_expr *expr,
>      case isl_ast_op_pdiv_r:
>      case isl_ast_op_fdiv_q:
>  #if HAVE_ISL_OPTIONS_SET_SCHEDULE_SERIALIZE_SCCS
> +    /* ISL-0.15 or later.  */
>      case isl_ast_op_zdiv_r:
>  #endif
>      case isl_ast_op_and:
> diff --git a/gcc/graphite-optimize-isl.c b/gcc/graphite-optimize-isl.c
> index 0ae5656..e124d0e 100644
> --- a/gcc/graphite-optimize-isl.c
> +++ b/gcc/graphite-optimize-isl.c
> @@ -49,6 +49,7 @@ along with GCC; see the file COPYING3.  If not see
>  #include <isl/options.h>
>  #include <isl/ctx.h>
>  #ifdef HAVE_ISL_OPTIONS_SET_SCHEDULE_SERIALIZE_SCCS
> +/* ISL-0.15 or later.  */
>  #include <isl/schedule_node.h>
>  #include <isl/ast_build.h>
>  #endif
> @@ -56,6 +57,7 @@ along with GCC; see the file COPYING3.  If not see
>  #include "graphite.h"
>
>  #ifdef HAVE_ISL_OPTIONS_SET_SCHEDULE_SERIALIZE_SCCS
> +/* ISL-0.15 or later.  */
>
>  /* get_schedule_for_node_st - Improve schedule for the schedule node.
>     Only Simple loop tiling is considered.  */
> @@ -371,12 +373,10 @@ static const int CONSTANT_BOUND = 20;
>  bool
>  optimize_isl (scop_p scop)
>  {
> -#ifdef HAVE_ISL_CTX_MAX_OPERATIONS
>    int old_max_operations = isl_ctx_get_max_operations (scop->isl_context);
>    int max_operations = PARAM_VALUE (PARAM_MAX_ISL_OPERATIONS);
>    if (max_operations)
>      isl_ctx_set_max_operations (scop->isl_context, max_operations);
> -#endif
>    isl_options_set_on_error (scop->isl_context, ISL_ON_ERROR_CONTINUE);
>
>    isl_union_set *domain = scop_get_domains (scop);
> @@ -388,20 +388,6 @@ optimize_isl (scop_p scop)
>    isl_union_map *validity = dependences;
>    isl_union_map *proximity = isl_union_map_copy (validity);
>
> -#ifdef HAVE_ISL_SCHED_CONSTRAINTS_COMPUTE_SCHEDULE
> -  isl_schedule_constraints *schedule_constraints;
> -  schedule_constraints = isl_schedule_constraints_on_domain (domain);
> -  schedule_constraints
> -    = isl_schedule_constraints_set_proximity (schedule_constraints,
> -                                             proximity);
> -  schedule_constraints
> -    = isl_schedule_constraints_set_validity (schedule_constraints,
> -                                            isl_union_map_copy (validity));
> -  schedule_constraints
> -    = isl_schedule_constraints_set_coincidence (schedule_constraints,
> -                                               validity);
> -#endif
> -
>    isl_options_set_schedule_max_constant_term (scop->isl_context, CONSTANT_BOUND);
>    isl_options_set_schedule_maximize_band_depth (scop->isl_context, 1);
>  #ifdef HAVE_ISL_OPTIONS_SET_SCHEDULE_SERIALIZE_SCCS
> @@ -418,17 +404,10 @@ optimize_isl (scop_p scop)
>    isl_options_set_schedule_fuse (scop->isl_context, ISL_SCHEDULE_FUSE_MIN);
>  #endif
>
> -#ifdef HAVE_ISL_SCHED_CONSTRAINTS_COMPUTE_SCHEDULE
> -  isl_schedule *schedule
> -    = isl_schedule_constraints_compute_schedule (schedule_constraints);
> -#else
>    isl_schedule *schedule
>      = isl_union_set_compute_schedule (domain, validity, proximity);
> -#endif
> -
>    isl_options_set_on_error (scop->isl_context, ISL_ON_ERROR_ABORT);
>
> -#ifdef HAVE_ISL_CTX_MAX_OPERATIONS
>    isl_ctx_reset_operations (scop->isl_context);
>    isl_ctx_set_max_operations (scop->isl_context, old_max_operations);
>    if (!schedule || isl_ctx_last_error (scop->isl_context) == isl_error_quota)
> @@ -440,12 +419,9 @@ optimize_isl (scop_p scop)
>         isl_schedule_free (schedule);
>        return false;
>      }
> -#else
> -  if (!schedule)
> -    return false;
> -#endif
>
>  #ifdef HAVE_ISL_OPTIONS_SET_SCHEDULE_SERIALIZE_SCCS
> +  /* ISL-0.15 or later.  */
>    isl_union_map *schedule_map = get_schedule_map_st (schedule);
>  #else
>    isl_union_map *schedule_map = get_schedule_map (schedule);
> diff --git a/gcc/graphite-poly.c b/gcc/graphite-poly.c
> index 6c01a4c..44f0241 100644
> --- a/gcc/graphite-poly.c
> +++ b/gcc/graphite-poly.c
> @@ -49,15 +49,7 @@ along with GCC; see the file COPYING3.  If not see
>  #include <isl/ilp.h>
>  #include <isl/aff.h>
>  #include <isl/val.h>
> -
> -/* Since ISL-0.13, the extern is in val_gmp.h.  */
> -#if !defined(HAVE_ISL_SCHED_CONSTRAINTS_COMPUTE_SCHEDULE) && defined(__cplusplus)
> -extern "C" {
> -#endif
>  #include <isl/val_gmp.h>
> -#if !defined(HAVE_ISL_SCHED_CONSTRAINTS_COMPUTE_SCHEDULE) && defined(__cplusplus)
> -}
> -#endif
>
>  #include "graphite.h"
>
> diff --git a/gcc/graphite-sese-to-poly.c b/gcc/graphite-sese-to-poly.c
> index 480c552..43dcb41 100644
> --- a/gcc/graphite-sese-to-poly.c
> +++ b/gcc/graphite-sese-to-poly.c
> @@ -55,15 +55,7 @@ along with GCC; see the file COPYING3.  If not see
>  #include <isl/constraint.h>
>  #include <isl/aff.h>
>  #include <isl/val.h>
> -
> -/* Since ISL-0.13, the extern is in val_gmp.h.  */
> -#if !defined(HAVE_ISL_SCHED_CONSTRAINTS_COMPUTE_SCHEDULE) && defined(__cplusplus)
> -extern "C" {
> -#endif
>  #include <isl/val_gmp.h>
> -#if !defined(HAVE_ISL_SCHED_CONSTRAINTS_COMPUTE_SCHEDULE) && defined(__cplusplus)
> -}
> -#endif
>
>  #include "graphite.h"
>
> diff --git a/gcc/graphite.h b/gcc/graphite.h
> index c7589ba..289c0b4 100644
> --- a/gcc/graphite.h
> +++ b/gcc/graphite.h
> @@ -25,6 +25,7 @@ along with GCC; see the file COPYING3.  If not see
>  #include "sese.h"
>
>  #ifndef HAVE_ISL_OPTIONS_SET_SCHEDULE_SERIALIZE_SCCS
> +  /* ISL-0.14.  */
>  # define isl_stat int
>  # define isl_stat_ok 0
>  #endif
> --
> 1.9.1
>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/2] [graphite] add more dumps on data dependence graph
  2015-12-14 21:48 [PATCH 1/2] [graphite] add more dumps on data dependence graph Sebastian Pop
  2015-12-14 21:48 ` [PATCH 2/2] [graphite] update required isl versions Sebastian Pop
@ 2015-12-25 10:40 ` Gerald Pfeifer
  2015-12-25 21:13   ` Sebastian Pop
  1 sibling, 1 reply; 7+ messages in thread
From: Gerald Pfeifer @ 2015-12-25 10:40 UTC (permalink / raw)
  To: Sebastian Pop; +Cc: sebpop, Richard Guenther, gcc-patches, hiraditya

Hi Sebastian,

On Mon, 14 Dec 2015, Sebastian Pop wrote:
>  gcc/graphite-dependences.c    | 31 +++++++++++++++++++++++++++----
>  gcc/graphite-poly.c           | 15 ++++++++++++++-
>  gcc/graphite-scop-detection.c | 21 ++++++++++++++++-----

on December 17th 2015, my nightly bootstrap (on i386-unknown-freebsd10.1,
but I don't think this is material) started to fail as follows:

  /scratch/tmp/gerald/gcc-HEAD/gcc/graphite-scop-detection.c:1892:17: 
  note: in instantiation of member function 'vec<dr_info, va_heap, vl_ptr>::safe_push'
  requested here
      scop->drs.safe_push (dr_info (dr, pbb));
                ^

From what I can see, this code was added by your patch:

> @@ -1879,7 +1879,18 @@ gather_bbs::before_dom_children (basic_block bb)
>    int i;
>    data_reference_p dr;
>    FOR_EACH_VEC_ELT (gbb->data_refs, i, dr)
> -    scop->drs.safe_push (dr_info (dr, pbb));
> +    {
> +      DEBUG_PRINT (dp << "Adding memory ";
> +		   if (dr->is_read)
> +		     dp << "read: ";
> +		   else
> +		     dp << "write: ";
> +		   print_generic_expr (dump_file, dr->ref, 0);
> +		   dp << "\nFrom stmt: ";
> +		   print_gimple_stmt (dump_file, dr->stmt, 0, 0));
> +
> +      scop->drs.safe_push (dr_info (dr, pbb));
> +    }

The system in question has isl 0.15 installed.

Gerald

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/2] [graphite] add more dumps on data dependence graph
  2015-12-25 10:40 ` [PATCH 1/2] [graphite] add more dumps on data dependence graph Gerald Pfeifer
@ 2015-12-25 21:13   ` Sebastian Pop
  2016-01-09 13:26     ` Gerald Pfeifer
  0 siblings, 1 reply; 7+ messages in thread
From: Sebastian Pop @ 2015-12-25 21:13 UTC (permalink / raw)
  To: Gerald Pfeifer; +Cc: Sebastian Pop, Richard Guenther, GCC Patches, Aditya K

On Fri, Dec 25, 2015 at 4:40 AM, Gerald Pfeifer <gerald@pfeifer.com> wrote:
> Hi Sebastian,
>
> On Mon, 14 Dec 2015, Sebastian Pop wrote:
>>  gcc/graphite-dependences.c    | 31 +++++++++++++++++++++++++++----
>>  gcc/graphite-poly.c           | 15 ++++++++++++++-
>>  gcc/graphite-scop-detection.c | 21 ++++++++++++++++-----
>
> on December 17th 2015, my nightly bootstrap (on i386-unknown-freebsd10.1,
> but I don't think this is material) started to fail as follows:
>
>   /scratch/tmp/gerald/gcc-HEAD/gcc/graphite-scop-detection.c:1892:17:
>   note: in instantiation of member function 'vec<dr_info, va_heap, vl_ptr>::safe_push'
>   requested here
>       scop->drs.safe_push (dr_info (dr, pbb));
>                 ^

I do not see what the error is.  Do you happen to have
the few lines with the error before this note?

>
> From what I can see, this code was added by your patch:
>
>> @@ -1879,7 +1879,18 @@ gather_bbs::before_dom_children (basic_block bb)
>>    int i;
>>    data_reference_p dr;
>>    FOR_EACH_VEC_ELT (gbb->data_refs, i, dr)
>> -    scop->drs.safe_push (dr_info (dr, pbb));
>> +    {
>> +      DEBUG_PRINT (dp << "Adding memory ";
>> +                if (dr->is_read)
>> +                  dp << "read: ";
>> +                else
>> +                  dp << "write: ";
>> +                print_generic_expr (dump_file, dr->ref, 0);
>> +                dp << "\nFrom stmt: ";
>> +                print_gimple_stmt (dump_file, dr->stmt, 0, 0));
>> +
>> +      scop->drs.safe_push (dr_info (dr, pbb));
>> +    }

This code does not change the safe_push call.

Thanks Gerald for reporting this problem.
Sebastian

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/2] [graphite] add more dumps on data dependence graph
  2015-12-25 21:13   ` Sebastian Pop
@ 2016-01-09 13:26     ` Gerald Pfeifer
  2016-01-09 17:14       ` Sebastian Pop
  0 siblings, 1 reply; 7+ messages in thread
From: Gerald Pfeifer @ 2016-01-09 13:26 UTC (permalink / raw)
  To: Sebastian Pop; +Cc: Sebastian Pop, Richard Guenther, gcc-patches, Aditya K

Hi Sebastian,

On Fri, 25 Dec 2015, Sebastian Pop wrote:
>> on December 17th 2015, my nightly bootstrap (on i386-unknown-freebsd10.1,
>> but I don't think this is material) started to fail as follows:
>>
>>   /scratch/tmp/gerald/gcc-HEAD/gcc/graphite-scop-detection.c:1892:17:
>>   note: in instantiation of member function 'vec<dr_info, va_heap, vl_ptr>::safe_push'
>>   requested here
>>       scop->drs.safe_push (dr_info (dr, pbb));
> I do not see what the error is.  Do you happen to have
> the few lines with the error before this note?

thanks for the quick response.  My Internet (non-)connectivity the 
last two weeks did not allow me to debug this further.  Now I'm back 
to normal, and here is what I found:

When I remove the isl package, GCC bootstraps just fine.  As soon as 
I add the package again, things fail again.

From the configure log:

  checking for isl 0.15 (or deprecated 0.14)... yes
  checking Checking for isl_options_set_schedule_serialize_sccs... no

And here is the actual failure, which is different from my original
report (probably due to forcing serial building).  Invocation:

  c++ -std=gnu++98 -fno-PIE -c -g -DIN_GCC -fno-strict-aliasing 
  -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall 
  -Wno-narrowing -Wwrite-string s -Wcast-qual -Wno-format 
  -Wmissing-format-attribute -Woverloaded-virtual -pedantic -Wno-long-long 
  -Wno-variadic-macros -Wno-overlength-strings -fno-common -DHAVE_CONFIG_H 
  :
  -o graphite-dependences.o -MT graphite-dependences.o -MMD -MP -MF 
  ./.deps/graphite-dependences.TPo /scratch/tmp/gerald/gcc-HEAD/gcc/graphite-dependences.c

Error:

  /scratch/tmp/gerald/gcc-HEAD/gcc/graphite-dependences.c:240:3: error: no matching function for call to 'isl_union_map_foreach_map'
  isl_union_map_foreach_map (x, max_number_of_out_dimensions, (void *) &max);
  ^~~~~~~~~~~~~~~~~~~~~~~~~
  /home/gerald/10-i386/include/isl/union_map.h:204:10: note: candidate 
  function not viable: no known conversion from 'int (isl_map *, void *)' 
  to 'isl_stat (*)(isl_map *, void *)' for 2nd argument 
  isl_stat isl_union_map_foreach_map(__isl_keep isl_union_map *umap,


At first I thought this is related to FreeBSD now using clang as the
system compiler, but the same happens using a current GCC 6 build.

Then I started digging into this, wondering why apparently it had
as the return type for the second argument as opposed to "isl_stat".

My .../include/isl/union_map.h has

  isl_stat isl_union_map_foreach_map(__isl_keep isl_union_map *umap,
        isl_stat (*fn)(__isl_take isl_map *map, void *user), void *user);

whereas graphite_dependences.c has

  static isl_stat
  max_number_of_out_dimensions (__isl_take isl_map *map, void *user)

so everything should be fine, shouldn't it?

Turns out gcc/graphite.h is causing all this:

  #ifdef HAVE_ISL_OPTIONS_SET_SCHEDULE_SERIALIZE_SCCS
  /* isl 0.15 or later.  */
  #include <isl/schedule_node.h>

  #else
  /* isl 0.14 or 0.13.  */
  # define isl_stat int
  # define isl_stat_ok 0
  #endif

So, despite actually _having_ type isl_stat we #define isl_stat to int 
and do so after having all the isl/ include files use the proper type.

Digging deeper, there appear to be two issues:

 1. Instead of a feature test (for isl_stat) we use a version check
    based on another feature test (isl_options_set_schedule_serialize_sccs).

 2. That feature test for isl_options_set_schedule_serialize_sccs does
    not work properly.

It would be great could you look into issue 1 in any case, but for the 
time being let's focus on issue 2.  Here is what gcc/config.log shows:

  configure:28943: checking Checking for isl_options_set_schedule_serialize_sccs
  configure:28956: /home/gerald/gcc-ref10-i386/bin/g++ -std=gnu++98 -o conftest -g
    -static-libstdc++ -static-libgcc  conftest.cpp  -lisl 
    -L/home/gerald/10-i386 /lib -lmpc -lmpfr -lgmp >&5
  conftest.cpp:258:26: fatal error: isl/schedule.h: No such file or directory
     #include <isl/schedule.h>
  compilation terminated.
  configure:28956: $? = 1

Note the -L option pointing to /home/gerald/10-i386 (where I have my
local packages for this kind of testing), whereas the associated -I 
option is missing.  And indeed, that's it:  We use GMPLIB in that
configure test, but not GMPINC.

(For MPFR and MPC, the include and library paths for GMP are always
included as well, by the way.  It is only necessary to use --with-gmp=
if one has a non-standard tree structure.)

With the patch allow, my bootstraps in that environment succeed again,
so I went ahead and applied it.

Gerald


2016-01-09  Gerald Pfeifer  <gerald@pfeifer.com>

	* configure.ac (isl_options_set_schedule_serialize_sccs): Also 
	use GMPINC.
	* configure: Regenerate.
 
Index: gcc/configure.ac
===================================================================
--- gcc/configure.ac	(revision 232188)
+++ gcc/configure.ac	(working copy)
@@ -5918,7 +5918,7 @@
 # it's new in isl 0.15.
 if test "x${ISLLIBS}" != "x" ; then
   saved_CXXFLAGS="$CXXFLAGS"
-  CXXFLAGS="$CXXFLAGS $ISLINC"
+  CXXFLAGS="$CXXFLAGS $ISLINC $GMPINC"
   saved_LIBS="$LIBS"
   LIBS="$LIBS $ISLLIBS $GMPLIBS"
 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/2] [graphite] add more dumps on data dependence graph
  2016-01-09 13:26     ` Gerald Pfeifer
@ 2016-01-09 17:14       ` Sebastian Pop
  0 siblings, 0 replies; 7+ messages in thread
From: Sebastian Pop @ 2016-01-09 17:14 UTC (permalink / raw)
  To: Gerald Pfeifer; +Cc: Sebastian Pop, Richard Guenther, GCC Patches, Aditya K

On Sat, Jan 9, 2016 at 7:26 AM, Gerald Pfeifer <gerald@pfeifer.com> wrote:
> Hi Sebastian,
>
> On Fri, 25 Dec 2015, Sebastian Pop wrote:
>>> on December 17th 2015, my nightly bootstrap (on i386-unknown-freebsd10.1,
>>> but I don't think this is material) started to fail as follows:
>>>
>>>   /scratch/tmp/gerald/gcc-HEAD/gcc/graphite-scop-detection.c:1892:17:
>>>   note: in instantiation of member function 'vec<dr_info, va_heap, vl_ptr>::safe_push'
>>>   requested here
>>>       scop->drs.safe_push (dr_info (dr, pbb));
>> I do not see what the error is.  Do you happen to have
>> the few lines with the error before this note?
>
> thanks for the quick response.  My Internet (non-)connectivity the
> last two weeks did not allow me to debug this further.  Now I'm back
> to normal, and here is what I found:
>
> When I remove the isl package, GCC bootstraps just fine.  As soon as
> I add the package again, things fail again.
>
> From the configure log:
>
>   checking for isl 0.15 (or deprecated 0.14)... yes
>   checking Checking for isl_options_set_schedule_serialize_sccs... no
>
> And here is the actual failure, which is different from my original
> report (probably due to forcing serial building).  Invocation:
>
>   c++ -std=gnu++98 -fno-PIE -c -g -DIN_GCC -fno-strict-aliasing
>   -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall
>   -Wno-narrowing -Wwrite-string s -Wcast-qual -Wno-format
>   -Wmissing-format-attribute -Woverloaded-virtual -pedantic -Wno-long-long
>   -Wno-variadic-macros -Wno-overlength-strings -fno-common -DHAVE_CONFIG_H
>   :
>   -o graphite-dependences.o -MT graphite-dependences.o -MMD -MP -MF
>   ./.deps/graphite-dependences.TPo /scratch/tmp/gerald/gcc-HEAD/gcc/graphite-dependences.c
>
> Error:
>
>   /scratch/tmp/gerald/gcc-HEAD/gcc/graphite-dependences.c:240:3: error: no matching function for call to 'isl_union_map_foreach_map'
>   isl_union_map_foreach_map (x, max_number_of_out_dimensions, (void *) &max);
>   ^~~~~~~~~~~~~~~~~~~~~~~~~
>   /home/gerald/10-i386/include/isl/union_map.h:204:10: note: candidate
>   function not viable: no known conversion from 'int (isl_map *, void *)'
>   to 'isl_stat (*)(isl_map *, void *)' for 2nd argument
>   isl_stat isl_union_map_foreach_map(__isl_keep isl_union_map *umap,
>
>
> At first I thought this is related to FreeBSD now using clang as the
> system compiler, but the same happens using a current GCC 6 build.
>
> Then I started digging into this, wondering why apparently it had
> as the return type for the second argument as opposed to "isl_stat".
>
> My .../include/isl/union_map.h has
>
>   isl_stat isl_union_map_foreach_map(__isl_keep isl_union_map *umap,
>         isl_stat (*fn)(__isl_take isl_map *map, void *user), void *user);
>
> whereas graphite_dependences.c has
>
>   static isl_stat
>   max_number_of_out_dimensions (__isl_take isl_map *map, void *user)
>
> so everything should be fine, shouldn't it?
>
> Turns out gcc/graphite.h is causing all this:
>
>   #ifdef HAVE_ISL_OPTIONS_SET_SCHEDULE_SERIALIZE_SCCS
>   /* isl 0.15 or later.  */
>   #include <isl/schedule_node.h>
>
>   #else
>   /* isl 0.14 or 0.13.  */
>   # define isl_stat int
>   # define isl_stat_ok 0
>   #endif
>
> So, despite actually _having_ type isl_stat we #define isl_stat to int
> and do so after having all the isl/ include files use the proper type.
>
> Digging deeper, there appear to be two issues:
>
>  1. Instead of a feature test (for isl_stat) we use a version check
>     based on another feature test (isl_options_set_schedule_serialize_sccs).
>
>  2. That feature test for isl_options_set_schedule_serialize_sccs does
>     not work properly.
>
> It would be great could you look into issue 1 in any case, but for the

I will have a look.
In general I do not like the current status of having that many
#ifdefs in graphite: it makes the code hard to read and to maintain.

> time being let's focus on issue 2.  Here is what gcc/config.log shows:
>
>   configure:28943: checking Checking for isl_options_set_schedule_serialize_sccs
>   configure:28956: /home/gerald/gcc-ref10-i386/bin/g++ -std=gnu++98 -o conftest -g
>     -static-libstdc++ -static-libgcc  conftest.cpp  -lisl
>     -L/home/gerald/10-i386 /lib -lmpc -lmpfr -lgmp >&5
>   conftest.cpp:258:26: fatal error: isl/schedule.h: No such file or directory
>      #include <isl/schedule.h>
>   compilation terminated.
>   configure:28956: $? = 1
>
> Note the -L option pointing to /home/gerald/10-i386 (where I have my
> local packages for this kind of testing), whereas the associated -I
> option is missing.  And indeed, that's it:  We use GMPLIB in that
> configure test, but not GMPINC.
>
> (For MPFR and MPC, the include and library paths for GMP are always
> included as well, by the way.  It is only necessary to use --with-gmp=
> if one has a non-standard tree structure.)
>
> With the patch allow, my bootstraps in that environment succeed again,
> so I went ahead and applied it.
>
> Gerald
>
>
> 2016-01-09  Gerald Pfeifer  <gerald@pfeifer.com>
>
>         * configure.ac (isl_options_set_schedule_serialize_sccs): Also
>         use GMPINC.
>         * configure: Regenerate.
>
> Index: gcc/configure.ac
> ===================================================================
> --- gcc/configure.ac    (revision 232188)
> +++ gcc/configure.ac    (working copy)
> @@ -5918,7 +5918,7 @@
>  # it's new in isl 0.15.
>  if test "x${ISLLIBS}" != "x" ; then
>    saved_CXXFLAGS="$CXXFLAGS"
> -  CXXFLAGS="$CXXFLAGS $ISLINC"
> +  CXXFLAGS="$CXXFLAGS $ISLINC $GMPINC"

The change looks good to me.  Thanks for fixing this problem.

Sebastian

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2016-01-09 17:14 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-14 21:48 [PATCH 1/2] [graphite] add more dumps on data dependence graph Sebastian Pop
2015-12-14 21:48 ` [PATCH 2/2] [graphite] update required isl versions Sebastian Pop
2015-12-16  9:42   ` Richard Biener
2015-12-25 10:40 ` [PATCH 1/2] [graphite] add more dumps on data dependence graph Gerald Pfeifer
2015-12-25 21:13   ` Sebastian Pop
2016-01-09 13:26     ` Gerald Pfeifer
2016-01-09 17:14       ` Sebastian Pop

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).