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