compile cloog code only when CLOOG_FOUND is set

llvm-svn: 156199
This commit is contained in:
Sebastian Pop 2012-05-04 20:30:03 +00:00
parent ae556d3ef7
commit c200977905
11 changed files with 55 additions and 20 deletions

View File

@ -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)

View File

@ -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@

View File

@ -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])])

22
polly/configure vendored
View File

@ -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

View File

@ -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 */

View File

@ -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

View File

@ -13,6 +13,7 @@
#ifndef POLLY_CONFIG_H
#define POLLY_CONFIG_H
#cmakedefine CLOOG_FOUND
#cmakedefine OPENSCOP_FOUND
#cmakedefine SCOPLIB_FOUND

View File

@ -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&);

View File

@ -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
)

View File

@ -16,7 +16,6 @@
//
//===----------------------------------------------------------------------===//
#include "polly/Cloog.h"
#include "polly/LinkAllPasses.h"
#ifdef SCOPLIB_FOUND

View File

@ -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());