2011-04-29 14:27:02 +08:00
|
|
|
set(LLVM_NO_RTTI 1)
|
|
|
|
|
2014-03-04 03:30:19 +08:00
|
|
|
set(POLLY_JSON_FILES
|
|
|
|
JSON/json_reader.cpp
|
|
|
|
JSON/json_value.cpp
|
|
|
|
JSON/json_writer.cpp
|
|
|
|
)
|
|
|
|
|
|
|
|
set(ISL_CODEGEN_FILES
|
|
|
|
CodeGen/IslAst.cpp
|
2014-07-30 04:50:09 +08:00
|
|
|
CodeGen/IslExprBuilder.cpp
|
2015-04-27 20:32:24 +08:00
|
|
|
CodeGen/IslNodeBuilder.cpp
|
2015-05-12 15:45:52 +08:00
|
|
|
CodeGen/CodeGeneration.cpp)
|
2014-03-04 03:30:19 +08:00
|
|
|
|
|
|
|
if (GPU_CODEGEN)
|
2015-05-15 23:41:14 +08:00
|
|
|
set (GPGPU_CODEGEN_FILES)
|
2014-03-04 03:30:19 +08:00
|
|
|
endif (GPU_CODEGEN)
|
2011-04-29 14:27:02 +08:00
|
|
|
|
2015-09-24 19:30:22 +08:00
|
|
|
# Compile ISL into a separate library.
|
|
|
|
add_subdirectory(External)
|
2015-02-05 04:55:43 +08:00
|
|
|
|
2015-09-11 17:01:55 +08:00
|
|
|
set(POLLY_HEADER_FILES)
|
|
|
|
if (MSVC_IDE OR XCODE)
|
|
|
|
file(GLOB_RECURSE POLLY_HEADER_FILES "${POLLY_SOURCE_DIR}/include/polly/*.h")
|
|
|
|
endif ()
|
2015-02-05 04:55:43 +08:00
|
|
|
|
2014-03-12 05:26:02 +08:00
|
|
|
add_polly_library(Polly
|
2015-03-05 06:43:40 +08:00
|
|
|
Analysis/DependenceInfo.cpp
|
2014-03-04 03:30:19 +08:00
|
|
|
Analysis/ScopDetection.cpp
|
2014-05-24 17:24:53 +08:00
|
|
|
Analysis/ScopDetectionDiagnostic.cpp
|
2014-03-04 03:30:19 +08:00
|
|
|
Analysis/ScopInfo.cpp
|
|
|
|
Analysis/ScopGraphPrinter.cpp
|
|
|
|
Analysis/ScopPass.cpp
|
|
|
|
CodeGen/BlockGenerators.cpp
|
|
|
|
${ISL_CODEGEN_FILES}
|
|
|
|
CodeGen/LoopGenerators.cpp
|
2014-03-04 22:59:00 +08:00
|
|
|
CodeGen/IRBuilder.cpp
|
2014-03-04 03:30:19 +08:00
|
|
|
CodeGen/Utils.cpp
|
2014-07-26 01:49:55 +08:00
|
|
|
CodeGen/RuntimeDebugBuilder.cpp
|
2015-11-26 20:36:25 +08:00
|
|
|
CodeGen/CodegenCleanup.cpp
|
2014-03-04 03:30:19 +08:00
|
|
|
${GPGPU_CODEGEN_FILES}
|
2014-03-12 05:25:59 +08:00
|
|
|
Exchange/JSONExporter.cpp
|
2014-03-04 03:30:19 +08:00
|
|
|
Support/GICHelper.cpp
|
2015-08-12 18:19:50 +08:00
|
|
|
Support/SCEVAffinator.cpp
|
2014-03-04 03:30:19 +08:00
|
|
|
Support/SCEVValidator.cpp
|
2014-03-12 05:26:06 +08:00
|
|
|
Support/RegisterPasses.cpp
|
2014-03-04 03:30:19 +08:00
|
|
|
Support/ScopHelper.cpp
|
2015-05-03 13:21:36 +08:00
|
|
|
Support/ScopLocation.cpp
|
2014-03-04 03:30:19 +08:00
|
|
|
${POLLY_JSON_FILES}
|
2014-03-12 05:25:59 +08:00
|
|
|
Transform/Canonicalization.cpp
|
|
|
|
Transform/CodePreparation.cpp
|
|
|
|
Transform/DeadCodeElimination.cpp
|
|
|
|
Transform/ScheduleOptimizer.cpp
|
2015-09-11 17:01:55 +08:00
|
|
|
${POLLY_HEADER_FILES}
|
2011-04-29 14:27:02 +08:00
|
|
|
)
|
|
|
|
|
2015-09-24 20:38:49 +08:00
|
|
|
target_link_libraries(Polly PollyISL)
|
2015-06-23 04:31:16 +08:00
|
|
|
|
2015-02-12 16:27:19 +08:00
|
|
|
if (BUILD_SHARED_LIBS)
|
|
|
|
target_link_libraries(Polly
|
|
|
|
LLVMSupport
|
|
|
|
LLVMCore
|
|
|
|
LLVMScalarOpts
|
|
|
|
LLVMInstCombine
|
|
|
|
LLVMTransformUtils
|
|
|
|
LLVMAnalysis
|
|
|
|
LLVMipo
|
2015-03-09 21:35:19 +08:00
|
|
|
LLVMMC
|
2016-02-01 04:25:46 +08:00
|
|
|
# The libraries below are required for darwin: http://PR26392
|
|
|
|
LLVMBitReader
|
|
|
|
LLVMMCParser
|
|
|
|
LLVMObject
|
|
|
|
LLVMProfileData
|
|
|
|
LLVMTarget
|
|
|
|
LLVMVectorize
|
2015-02-12 16:27:19 +08:00
|
|
|
)
|
2015-03-05 02:51:27 +08:00
|
|
|
link_directories(
|
|
|
|
${LLVM_LIBRARY_DIR}
|
|
|
|
)
|
2016-02-04 00:29:04 +08:00
|
|
|
elseif (LLVM_LINK_LLVM_DYLIB)
|
|
|
|
target_link_libraries(Polly
|
|
|
|
LLVM
|
|
|
|
)
|
|
|
|
link_directories(
|
|
|
|
${LLVM_LIBRARY_DIR}
|
|
|
|
)
|
2015-02-12 16:27:19 +08:00
|
|
|
endif()
|
|
|
|
|
2014-03-14 06:07:17 +08:00
|
|
|
# Build a monolithic Polly.a and a thin module LLVMPolly.moduleext that links to
|
|
|
|
# that static library.
|
2015-07-21 20:29:02 +08:00
|
|
|
if (MSVC)
|
|
|
|
# Add dummy target, because loadable modules are not supported on Windows
|
|
|
|
add_custom_target(LLVMPolly)
|
2015-07-21 20:40:01 +08:00
|
|
|
set_target_properties(LLVMPolly PROPERTIES FOLDER "Polly")
|
2015-07-21 20:29:02 +08:00
|
|
|
else ()
|
|
|
|
add_polly_loadable_module(LLVMPolly
|
|
|
|
Polly.cpp
|
|
|
|
)
|
|
|
|
|
|
|
|
target_link_libraries(LLVMPolly Polly)
|
|
|
|
|
|
|
|
set_target_properties(LLVMPolly
|
|
|
|
PROPERTIES
|
|
|
|
LINKER_LANGUAGE CXX
|
|
|
|
PREFIX "")
|
|
|
|
endif ()
|
2014-03-04 03:30:19 +08:00
|
|
|
|
2012-09-04 16:19:12 +08:00
|
|
|
if (TARGET intrinsics_gen)
|
|
|
|
# Check if we are building as part of an LLVM build
|
2014-03-14 04:29:19 +08:00
|
|
|
add_dependencies(Polly intrinsics_gen)
|
2012-09-04 16:19:12 +08:00
|
|
|
endif()
|
|
|
|
|