[llvm-commits] [polly] r156305 - in /polly/trunk: Makefile.config.in autoconf/aclocal.m4 autoconf/configure.ac autoconf/m4/find_lib_and_headers.m4 cmake/FindIsl.cmake configure include/polly/Config/config.h.cmake include/polly/Config/config.h.in lib/CodeGen/CMakeLists.txt lib/CodeGen/IslCodeGeneration.cpp
Sebastian Pop
spop at codeaurora.org
Mon May 7 09:20:07 PDT 2012
Author: spop
Date: Mon May 7 11:20:07 2012
New Revision: 156305
URL: http://llvm.org/viewvc/llvm-project?rev=156305&view=rev
Log:
add a check for ISL codegen at configure time
Added:
polly/trunk/lib/CodeGen/IslCodeGeneration.cpp
Modified:
polly/trunk/Makefile.config.in
polly/trunk/autoconf/aclocal.m4
polly/trunk/autoconf/configure.ac
polly/trunk/autoconf/m4/find_lib_and_headers.m4
polly/trunk/cmake/FindIsl.cmake
polly/trunk/configure
polly/trunk/include/polly/Config/config.h.cmake
polly/trunk/include/polly/Config/config.h.in
polly/trunk/lib/CodeGen/CMakeLists.txt
Modified: polly/trunk/Makefile.config.in
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/Makefile.config.in?rev=156305&r1=156304&r2=156305&view=diff
==============================================================================
--- polly/trunk/Makefile.config.in (original)
+++ polly/trunk/Makefile.config.in Mon May 7 11:20:07 2012
@@ -29,6 +29,7 @@
POLLY_CXXFLAGS += "-fno-rtti -fno-exceptions"
CLOOG_FOUND := @cloog_found@
+ISL_CODEGEN_FOUND := @isl_codegen_found@
OPENSCOP_FOUND := @openscop_found@
SCOPLIB_FOUND := @scoplib_found@
Modified: polly/trunk/autoconf/aclocal.m4
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/autoconf/aclocal.m4?rev=156305&r1=156304&r2=156305&view=diff
==============================================================================
--- polly/trunk/autoconf/aclocal.m4 (original)
+++ polly/trunk/autoconf/aclocal.m4 Mon May 7 11:20:07 2012
@@ -36,7 +36,8 @@
given_lib_path=lib_not_give_$1]
)
# Check for library and headers works
- AC_MSG_CHECKING([for $1 in $given_inc_path, $given_lib_path])
+ AC_MSG_CHECKING([for $1: $2 in $given_inc_path, and lib$3 in $given_lib_path])
+
# try to compile a file that includes a header of the library
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <$2>]], [[;]])],
[AC_MSG_RESULT([ok])
Modified: polly/trunk/autoconf/configure.ac
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/autoconf/configure.ac?rev=156305&r1=156304&r2=156305&view=diff
==============================================================================
--- polly/trunk/autoconf/configure.ac (original)
+++ polly/trunk/autoconf/configure.ac Mon May 7 11:20:07 2012
@@ -80,12 +80,17 @@
dnl Find Isl
find_lib_and_headers([isl], [isl/config.h], [isl], [required])
+dnl Find whether ISL has a codegen.h file.
+find_lib_and_headers([isl], [isl/codegen.h], [isl])
+AS_IF([test "x$isl_found" = "xyes"],
+ [AC_DEFINE([ISL_CODEGEN_FOUND],[1],[Define if ISL has a code generator])])
+
dnl Check that we have cloog.
saved_CXXFLAGS=$CXXFLAGS
CXXFLAGS="$CXXFLAGS $gmp_inc $isl_inc"
find_lib_and_headers([cloog], [cloog/isl/cloog.h], [cloog-isl], [required])
CXXFLAGS=$saved_CXXFLAGS
-AS_IF([test "cloog_found" = "xyes"],
+AS_IF([test "x$cloog_found" = "xyes"],
[AC_DEFINE([CLOOG_FOUND],[1],[Define if cloog found])])
dnl Check that we have openscop.
Modified: polly/trunk/autoconf/m4/find_lib_and_headers.m4
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/autoconf/m4/find_lib_and_headers.m4?rev=156305&r1=156304&r2=156305&view=diff
==============================================================================
--- polly/trunk/autoconf/m4/find_lib_and_headers.m4 (original)
+++ polly/trunk/autoconf/m4/find_lib_and_headers.m4 Mon May 7 11:20:07 2012
@@ -23,7 +23,8 @@
given_lib_path=lib_not_give_$1]
)
# Check for library and headers works
- AC_MSG_CHECKING([for $1 in $given_inc_path, $given_lib_path])
+ AC_MSG_CHECKING([for $1: $2 in $given_inc_path, and lib$3 in $given_lib_path])
+
# try to compile a file that includes a header of the library
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <$2>]], [[;]])],
[AC_MSG_RESULT([ok])
Modified: polly/trunk/cmake/FindIsl.cmake
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/cmake/FindIsl.cmake?rev=156305&r1=156304&r2=156305&view=diff
==============================================================================
--- polly/trunk/cmake/FindIsl.cmake (original)
+++ polly/trunk/cmake/FindIsl.cmake Mon May 7 11:20:07 2012
@@ -1,4 +1,9 @@
FIND_PATH(ISL_INCLUDE_DIR isl/set.h)
+FIND_PATH(ISL_CODEGEN_DIR isl/codegen.h)
+
+IF (ISL_CODEGEN_DIR)
+ SET(ISL_CODEGEN_FOUND TRUE)
+ENDIF (ISL_CODEGEN_DIR)
FIND_LIBRARY(ISL_LIBRARY NAMES isl)
Modified: polly/trunk/configure
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/configure?rev=156305&r1=156304&r2=156305&view=diff
==============================================================================
--- polly/trunk/configure (original)
+++ polly/trunk/configure Mon May 7 11:20:07 2012
@@ -2409,8 +2409,9 @@
fi
# Check for library and headers works
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gmp in $given_inc_path, $given_lib_path" >&5
-$as_echo_n "checking for gmp in $given_inc_path, $given_lib_path... " >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gmp: gmp.h in $given_inc_path, and libgmp in $given_lib_path" >&5
+$as_echo_n "checking for gmp: gmp.h in $given_inc_path, and libgmp in $given_lib_path... " >&6; }
+
# try to compile a file that includes a header of the library
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -2488,8 +2489,9 @@
fi
# Check for library and headers works
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for isl in $given_inc_path, $given_lib_path" >&5
-$as_echo_n "checking for isl in $given_inc_path, $given_lib_path... " >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for isl: isl/config.h in $given_inc_path, and libisl in $given_lib_path" >&5
+$as_echo_n "checking for isl: isl/config.h in $given_inc_path, and libisl in $given_lib_path... " >&6; }
+
# try to compile a file that includes a header of the library
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -2541,6 +2543,91 @@
+
+ ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+ OLD_CXXFLAGS=$CXXFLAGS;
+ OLD_LDFLAGS=$LDFLAGS;
+ OLD_LIBS=$LIBS;
+
+ LIBS="$LIBS -lisl";
+
+ # Get include path and lib path
+
+# Check whether --with-isl was given.
+if test "${with_isl+set}" = set; then :
+ withval=$with_isl; given_inc_path="$withval/include"; CXXFLAGS="-I$given_inc_path $CXXFLAGS";
+ given_lib_path="$withval/lib"; LDFLAGS="-L$given_lib_path $LDFLAGS"
+else
+ given_inc_path=inc_not_give_isl;
+ given_lib_path=lib_not_give_isl
+
+fi
+
+ # Check for library and headers works
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for isl: isl/codegen.h in $given_inc_path, and libisl in $given_lib_path" >&5
+$as_echo_n "checking for isl: isl/codegen.h in $given_inc_path, and libisl in $given_lib_path... " >&6; }
+
+ # try to compile a file that includes a header of the library
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <isl/codegen.h>
+int
+main ()
+{
+;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_link "$LINENO"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
+$as_echo "ok" >&6; }
+ isl_found="yes"
+
+ if test "x$given_inc_path" != "xinc_not_give_isl"; then :
+ isl_inc="-I$given_inc_path"
+
+fi
+ isl_lib="-lisl"
+
+ if test "x$given_lib_path" != "xlib_not_give_isl"; then :
+ isl_ld="-L$given_lib_path"
+
+fi
+else
+ if test "x" = "xrequired"; then :
+ as_fn_error $? "isl required but not found" "$LINENO" 5
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5
+$as_echo "not found" >&6; }
+fi
+
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+
+ # reset original CXXFLAGS
+ CXXFLAGS=$OLD_CXXFLAGS
+ LDFLAGS=$OLD_LDFLAGS;
+ LIBS=$OLD_LIBS
+ ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+if test "x$isl_found" = "xyes"; then :
+
+$as_echo "#define ISL_CODEGEN_FOUND 1" >>confdefs.h
+
+fi
+
saved_CXXFLAGS=$CXXFLAGS
CXXFLAGS="$CXXFLAGS $gmp_inc $isl_inc"
@@ -2569,8 +2656,9 @@
fi
# Check for library and headers works
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for cloog in $given_inc_path, $given_lib_path" >&5
-$as_echo_n "checking for cloog in $given_inc_path, $given_lib_path... " >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for cloog: cloog/isl/cloog.h in $given_inc_path, and libcloog-isl in $given_lib_path" >&5
+$as_echo_n "checking for cloog: cloog/isl/cloog.h in $given_inc_path, and libcloog-isl in $given_lib_path... " >&6; }
+
# try to compile a file that includes a header of the library
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -2622,7 +2710,7 @@
CXXFLAGS=$saved_CXXFLAGS
-if test "cloog_found" = "xyes"; then :
+if test "x$cloog_found" = "xyes"; then :
$as_echo "#define CLOOG_FOUND 1" >>confdefs.h
@@ -2654,8 +2742,9 @@
fi
# Check for library and headers works
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for openscop in $given_inc_path, $given_lib_path" >&5
-$as_echo_n "checking for openscop in $given_inc_path, $given_lib_path... " >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for openscop: openscop/scop.h in $given_inc_path, and libopenscop in $given_lib_path" >&5
+$as_echo_n "checking for openscop: openscop/scop.h in $given_inc_path, and libopenscop in $given_lib_path... " >&6; }
+
# try to compile a file that includes a header of the library
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -2738,8 +2827,9 @@
fi
# Check for library and headers works
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for scoplib in $given_inc_path, $given_lib_path" >&5
-$as_echo_n "checking for scoplib in $given_inc_path, $given_lib_path... " >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for scoplib: scoplib/scop.h in $given_inc_path, and libscoplib in $given_lib_path" >&5
+$as_echo_n "checking for scoplib: scoplib/scop.h in $given_inc_path, and libscoplib in $given_lib_path... " >&6; }
+
# try to compile a file that includes a header of the library
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
Modified: polly/trunk/include/polly/Config/config.h.cmake
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/include/polly/Config/config.h.cmake?rev=156305&r1=156304&r2=156305&view=diff
==============================================================================
--- polly/trunk/include/polly/Config/config.h.cmake (original)
+++ polly/trunk/include/polly/Config/config.h.cmake Mon May 7 11:20:07 2012
@@ -14,6 +14,7 @@
#define POLLY_CONFIG_H
#cmakedefine CLOOG_FOUND
+#cmakedefine ISL_CODEGEN_FOUND
#cmakedefine OPENSCOP_FOUND
#cmakedefine SCOPLIB_FOUND
Modified: polly/trunk/include/polly/Config/config.h.in
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/include/polly/Config/config.h.in?rev=156305&r1=156304&r2=156305&view=diff
==============================================================================
--- polly/trunk/include/polly/Config/config.h.in (original)
+++ polly/trunk/include/polly/Config/config.h.in Mon May 7 11:20:07 2012
@@ -1,8 +1,14 @@
/* include/polly/Config/config.h.in. Generated from autoconf/configure.ac by autoheader. */
+/* Define if cloog found */
+#undef CLOOG_FOUND
+
/* Use gmp for isl */
#undef CLOOG_INT_GMP
+/* Define if ISL has a code generator */
+#undef ISL_CODEGEN_FOUND
+
/* Define if openscop found */
#undef OPENSCOP_FOUND
Modified: polly/trunk/lib/CodeGen/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/CodeGen/CMakeLists.txt?rev=156305&r1=156304&r2=156305&view=diff
==============================================================================
--- polly/trunk/lib/CodeGen/CMakeLists.txt (original)
+++ polly/trunk/lib/CodeGen/CMakeLists.txt Mon May 7 11:20:07 2012
@@ -3,8 +3,15 @@
Cloog.cpp
CodeGeneration.cpp)
endif (CLOOG_FOUND)
+
+if (ISL_CODEGEN_FOUND)
+ set(ISL_CODEGEN_FILES
+ IslCodeGeneration.cpp)
+endif (ISL_CODEGEN_FOUND)
+
add_polly_library(PollyCodeGen
BlockGenerators.cpp
${CLOOG_FILES}
+ ${ISL_CODEGEN_FILES}
LoopGenerators.cpp
)
Added: polly/trunk/lib/CodeGen/IslCodeGeneration.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/CodeGen/IslCodeGeneration.cpp?rev=156305&view=auto
==============================================================================
--- polly/trunk/lib/CodeGen/IslCodeGeneration.cpp (added)
+++ polly/trunk/lib/CodeGen/IslCodeGeneration.cpp Mon May 7 11:20:07 2012
@@ -0,0 +1,21 @@
+//===------ IslCodeGeneration.cpp - Code generate the Scops using ISL. ----===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// The IslCodeGeneration pass takes a Scop created by ScopInfo and translates it
+// back to LLVM-IR using the ISL code generator.
+//
+// The Scop describes the high level memory behaviour of a control flow region.
+// Transformation passes can update the schedule (execution order) of statements
+// in the Scop. ISL is used to generate an abstract syntax tree that reflects
+// the updated execution order. This clast is used to create new LLVM-IR that is
+// computationally equivalent to the original control flow region, but executes
+// its code in the new execution order defined by the changed scattering.
+//
+//===----------------------------------------------------------------------===//
+
More information about the llvm-commits
mailing list