summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--polly/CMakeLists.txt10
-rwxr-xr-xpolly/Makefile.config.in2
-rw-r--r--polly/autoconf/configure.ac9
-rwxr-xr-xpolly/configure22
-rw-r--r--polly/include/polly/Cloog.h6
-rw-r--r--polly/include/polly/CodeGen/CodeGeneration.h6
-rwxr-xr-xpolly/include/polly/Config/config.h.cmake1
-rw-r--r--polly/include/polly/LinkAllPasses.h6
-rwxr-xr-xpolly/lib/CodeGen/CMakeLists.txt8
-rw-r--r--polly/lib/Pocc.cpp1
-rw-r--r--polly/lib/RegisterPasses.cpp4
11 files changed, 55 insertions, 20 deletions
diff --git a/polly/CMakeLists.txt b/polly/CMakeLists.txt
index 4515e8034df..9ac56f7b642 100644
--- a/polly/CMakeLists.txt
+++ b/polly/CMakeLists.txt
@@ -85,7 +85,9 @@ if (POLLY_ENABLE_SCOPLIB)
FIND_PACKAGE(SCoPLib)
endif(POLLY_ENABLE_SCOPLIB)
-INCLUDE_DIRECTORIES( ${CLOOG_INCLUDE_DIR} )
+if (CLOOG_FOUND)
+ INCLUDE_DIRECTORIES( ${CLOOG_INCLUDE_DIR} )
+endif(CLOOG_FOUND)
INCLUDE_DIRECTORIES( ${ISL_INCLUDE_DIR} )
INCLUDE_DIRECTORIES( ${GMP_INCLUDE_DIR} )
@@ -125,7 +127,11 @@ macro(add_polly_library name)
endforeach(lib)
endif( LLVM_USED_LIBS )
- target_link_libraries( ${name} ${CLOOG_LIBRARY} ${ISL_LIBRARY} ${GMP_LIBRARY})
+ target_link_libraries( ${name} ${ISL_LIBRARY} ${GMP_LIBRARY})
+
+ if (CLOOG_FOUND)
+ target_link_libraries( ${name} ${CLOOG_LIBRARY})
+ endif(CLOOG_FOUND)
if (OPENSCOP_FOUND)
target_link_libraries( ${name} ${OPENSCOP_LIBRARY})
endif(OPENSCOP_FOUND)
diff --git a/polly/Makefile.config.in b/polly/Makefile.config.in
index 197a3aa113c..948fcf37cef 100755
--- a/polly/Makefile.config.in
+++ b/polly/Makefile.config.in
@@ -28,7 +28,7 @@ endif
POLLY_CXXFLAGS += "-fno-rtti -fno-exceptions"
-# Do us work with scoplib?
+CLOOG_FOUND := @cloog_found@
OPENSCOP_FOUND := @openscop_found@
SCOPLIB_FOUND := @scoplib_found@
diff --git a/polly/autoconf/configure.ac b/polly/autoconf/configure.ac
index db48a26717f..63600a8e76e 100644
--- a/polly/autoconf/configure.ac
+++ b/polly/autoconf/configure.ac
@@ -80,19 +80,20 @@ find_lib_and_headers([gmp], [gmp.h], [gmp], [required])
dnl Find Isl
find_lib_and_headers([isl], [isl/config.h], [isl], [required])
-dnl Find cloog
+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"],
+ [AC_DEFINE([CLOOG_FOUND],[1],[Define if cloog found])])
-
-dnl Check if Scoplib there
+dnl Check that we have openscop.
find_lib_and_headers([openscop], [openscop/scop.h], [openscop])
AS_IF([test "x$openscop_found" = "xyes"],
[AC_DEFINE([OPENSCOP_FOUND],[1],[Define if openscop found])])
-dnl Check if Scoplib there
+dnl Check that we have scoplib.
find_lib_and_headers([scoplib], [scoplib/scop.h], [scoplib])
AS_IF([test "x$scoplib_found" = "xyes"],
[AC_DEFINE([SCOPLIB_FOUND],[1],[Define if scoplib found])])
diff --git a/polly/configure b/polly/configure
index 6e97251dc57..93aff2ee856 100755
--- a/polly/configure
+++ b/polly/configure
@@ -1700,7 +1700,7 @@ $as_echo "$as_me: loading site script $ac_site_file" >&6;}
|| { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "failed to load site script $ac_site_file
-See \`config.log' for more details" "$LINENO" 5 ; }
+See \`config.log' for more details" "$LINENO" 5; }
fi
done
@@ -2099,7 +2099,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error 77 "C++ compiler cannot create executables
-See \`config.log' for more details" "$LINENO" 5 ; }
+See \`config.log' for more details" "$LINENO" 5; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
@@ -2142,7 +2142,7 @@ else
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "cannot compute suffix of executables: cannot compile and link
-See \`config.log' for more details" "$LINENO" 5 ; }
+See \`config.log' for more details" "$LINENO" 5; }
fi
rm -f conftest conftest$ac_cv_exeext
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
@@ -2201,7 +2201,7 @@ $as_echo "$ac_try_echo"; } >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "cannot run C++ compiled programs.
If you meant to cross compile, use \`--host'.
-See \`config.log' for more details" "$LINENO" 5 ; }
+See \`config.log' for more details" "$LINENO" 5; }
fi
fi
fi
@@ -2253,7 +2253,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "cannot compute suffix of object files: cannot compile
-See \`config.log' for more details" "$LINENO" 5 ; }
+See \`config.log' for more details" "$LINENO" 5; }
fi
rm -f conftest.$ac_cv_objext conftest.$ac_ext
fi
@@ -2622,7 +2622,11 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
CXXFLAGS=$saved_CXXFLAGS
+if test "cloog_found" = "xyes"; then :
+$as_echo "#define CLOOG_FOUND 1" >>confdefs.h
+
+fi
ac_ext=cpp
@@ -3506,7 +3510,7 @@ do
"Makefile.common") CONFIG_FILES="$CONFIG_FILES Makefile.common" ;;
"include/polly/Config/config.h") CONFIG_HEADERS="$CONFIG_HEADERS include/polly/Config/config.h" ;;
- *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5 ;;
+ *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
esac
done
@@ -3822,7 +3826,7 @@ do
esac
case $ac_mode$ac_tag in
:[FHL]*:*);;
- :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5 ;;
+ :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;;
:[FH]-) ac_tag=-:-;;
:[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
esac
@@ -3850,7 +3854,7 @@ do
[\\/$]*) false;;
*) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
esac ||
- as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5 ;;
+ as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;;
esac
case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
as_fn_append ac_file_inputs " '$ac_f'"
@@ -3877,7 +3881,7 @@ $as_echo "$as_me: creating $ac_file" >&6;}
case $ac_tag in
*:-:* | *:-) cat >"$tmp/stdin" \
- || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
+ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
esac
;;
esac
diff --git a/polly/include/polly/Cloog.h b/polly/include/polly/Cloog.h
index ffd6c8f2d87..de0851618a4 100644
--- a/polly/include/polly/Cloog.h
+++ b/polly/include/polly/Cloog.h
@@ -24,6 +24,10 @@
#ifndef POLLY_CLOOG_H
#define POLLY_CLOOG_H
+
+#include "polly/Config/config.h"
+#ifdef CLOOG_FOUND
+
#include "polly/ScopPass.h"
#define CLOOG_INT_GMP 1
@@ -66,4 +70,6 @@ namespace llvm {
class PassRegistry;
void initializeCloogInfoPass(llvm::PassRegistry&);
}
+
+#endif /* CLOOG_FOUND */
#endif /* POLLY_CLOOG_H */
diff --git a/polly/include/polly/CodeGen/CodeGeneration.h b/polly/include/polly/CodeGen/CodeGeneration.h
index 56691437939..8b61daeeba6 100644
--- a/polly/include/polly/CodeGen/CodeGeneration.h
+++ b/polly/include/polly/CodeGen/CodeGeneration.h
@@ -12,9 +12,13 @@
#ifndef POLLY_CODEGENERATION_H
#define POLLY_CODEGENERATION_H
+#include "polly/Config/config.h"
+#ifdef CLOOG_FOUND
+
namespace polly {
extern bool EnablePollyVector;
}
-#endif
+#endif // CLOOG_FOUND
+#endif // POLLY_CODEGENERATION_H
diff --git a/polly/include/polly/Config/config.h.cmake b/polly/include/polly/Config/config.h.cmake
index cba91af8a4c..7ae020c6b3a 100755
--- a/polly/include/polly/Config/config.h.cmake
+++ b/polly/include/polly/Config/config.h.cmake
@@ -13,6 +13,7 @@
#ifndef POLLY_CONFIG_H
#define POLLY_CONFIG_H
+#cmakedefine CLOOG_FOUND
#cmakedefine OPENSCOP_FOUND
#cmakedefine SCOPLIB_FOUND
diff --git a/polly/include/polly/LinkAllPasses.h b/polly/include/polly/LinkAllPasses.h
index 34b6c59abdc..cb725ac8ce7 100644
--- a/polly/include/polly/LinkAllPasses.h
+++ b/polly/include/polly/LinkAllPasses.h
@@ -29,9 +29,11 @@ using namespace llvm;
namespace polly {
Pass *createAffSCEVItTesterPass();
+#ifdef CLOOG_FOUND
Pass *createCloogExporterPass();
Pass *createCloogInfoPass();
Pass *createCodeGenerationPass();
+#endif
Pass *createCodePreparationPass();
Pass *createDeadCodeElimPass();
Pass *createDependencesPass();
@@ -77,9 +79,11 @@ namespace {
return;
createAffSCEVItTesterPass();
+#ifdef CLOOG_FOUND
createCloogExporterPass();
createCloogInfoPass();
createCodeGenerationPass();
+#endif
createCodePreparationPass();
createDeadCodeElimPass();
createDependencesPass();
@@ -113,7 +117,9 @@ namespace {
namespace llvm {
class PassRegistry;
+#ifdef CLOOG_FOUND
void initializeCodeGenerationPass(llvm::PassRegistry&);
+#endif
void initializeCodePreparationPass(llvm::PassRegistry&);
void initializeDeadCodeElimPass(llvm::PassRegistry&);
void initializeIndependentBlocksPass(llvm::PassRegistry&);
diff --git a/polly/lib/CodeGen/CMakeLists.txt b/polly/lib/CodeGen/CMakeLists.txt
index 37ef11a9c49..138f00aa84c 100755
--- a/polly/lib/CodeGen/CMakeLists.txt
+++ b/polly/lib/CodeGen/CMakeLists.txt
@@ -1,6 +1,10 @@
+if (CLOOG_FOUND)
+ set(CLOOG_FILES
+ Cloog.cpp
+ CodeGeneration.cpp)
+endif (CLOOG_FOUND)
add_polly_library(PollyCodeGen
BlockGenerators.cpp
- Cloog.cpp
- CodeGeneration.cpp
+ ${CLOOG_FILES}
LoopGenerators.cpp
)
diff --git a/polly/lib/Pocc.cpp b/polly/lib/Pocc.cpp
index 74aa3463a77..20e07ef4939 100644
--- a/polly/lib/Pocc.cpp
+++ b/polly/lib/Pocc.cpp
@@ -16,7 +16,6 @@
//
//===----------------------------------------------------------------------===//
-#include "polly/Cloog.h"
#include "polly/LinkAllPasses.h"
#ifdef SCOPLIB_FOUND
diff --git a/polly/lib/RegisterPasses.cpp b/polly/lib/RegisterPasses.cpp
index 58381362132..e6ee1f06d7d 100644
--- a/polly/lib/RegisterPasses.cpp
+++ b/polly/lib/RegisterPasses.cpp
@@ -106,8 +106,10 @@ CFGPrinter("polly-view-cfg",
cl::init(false));
static void initializePollyPasses(PassRegistry &Registry) {
+#ifdef CLOOG_FOUND
initializeCloogInfoPass(Registry);
initializeCodeGenerationPass(Registry);
+#endif
initializeCodePreparationPass(Registry);
initializeDeadCodeElimPass(Registry);
initializeDependencesPass(Registry);
@@ -212,8 +214,10 @@ void polly::registerPollyPasses(llvm::PassManagerBase &PM, bool DisableCodegen)
if (ExportJScop)
PM.add(polly::createJSONExporterPass());
+#ifdef CLOOG_FOUND
if (RunCodegen)
PM.add(polly::createCodeGenerationPass());
+#endif
if (CFGPrinter)
PM.add(llvm::createCFGPrinterPass());
OpenPOWER on IntegriCloud