blob: c4ae26f9f44df4b7d1071ba2a2e0253183407266 [file] [log] [blame]
Tobias Grosser75805372011-04-29 06:27:021set(LLVM_NO_RTTI 1)
2
Tobias Grosser23f16b12014-03-03 19:30:193set(POLLY_JSON_FILES
4 JSON/json_reader.cpp
5 JSON/json_value.cpp
6 JSON/json_writer.cpp
7)
Tobias Grosser75805372011-04-29 06:27:028
Tobias Grosser23f16b12014-03-03 19:30:199set(ISL_CODEGEN_FILES
10 CodeGen/IslAst.cpp
Johannes Doerfert48cf6ec2014-07-29 20:50:0911 CodeGen/IslExprBuilder.cpp
Tobias Grosser0c55cb62015-04-27 12:32:2412 CodeGen/IslNodeBuilder.cpp
Tobias Grosser09d30692015-05-12 07:45:5213 CodeGen/CodeGeneration.cpp)
Tobias Grosser23f16b12014-03-03 19:30:1914
15if (GPU_CODEGEN)
Tobias Grosser9dfe4e72016-07-13 15:54:5816 set (GPGPU_CODEGEN_FILES
17 CodeGen/PPCGCodeGeneration.cpp
18 )
Tobias Grosser23f16b12014-03-03 19:30:1919endif (GPU_CODEGEN)
20
Michael Kruse519b3cf2015-09-24 11:30:2221# Compile ISL into a separate library.
22add_subdirectory(External)
Tobias Grosser52a25232015-02-04 20:55:4323
Michael Kruseef3cf012015-09-11 09:01:5524set(POLLY_HEADER_FILES)
25if (MSVC_IDE OR XCODE)
26 file(GLOB_RECURSE POLLY_HEADER_FILES "${POLLY_SOURCE_DIR}/include/polly/*.h")
27endif ()
Tobias Grosser52a25232015-02-04 20:55:4328
Andreas Simbuerger7f97f8c2014-03-11 21:26:0229add_polly_library(Polly
Johannes Doerfertf6557f92015-03-04 22:43:4030 Analysis/DependenceInfo.cpp
Johannes Doerfert80312382016-07-25 12:48:4531 Analysis/PolyhedralInfo.cpp
Tobias Grosser23f16b12014-03-03 19:30:1932 Analysis/ScopDetection.cpp
Andreas Simbuerger320af4052014-05-24 09:24:5333 Analysis/ScopDetectionDiagnostic.cpp
Tobias Grosser23f16b12014-03-03 19:30:1934 Analysis/ScopInfo.cpp
Michael Kruse2133cb92016-06-28 01:37:2035 Analysis/ScopBuilder.cpp
Tobias Grosser23f16b12014-03-03 19:30:1936 Analysis/ScopGraphPrinter.cpp
37 Analysis/ScopPass.cpp
Tobias Grosser23f16b12014-03-03 19:30:1938 CodeGen/BlockGenerators.cpp
Tobias Grosser23f16b12014-03-03 19:30:1939 ${ISL_CODEGEN_FILES}
40 CodeGen/LoopGenerators.cpp
Tobias Grosser37c9b8e2014-03-04 14:59:0041 CodeGen/IRBuilder.cpp
Tobias Grosser23f16b12014-03-03 19:30:1942 CodeGen/Utils.cpp
Johannes Doerfertefa850402014-07-25 17:49:5543 CodeGen/RuntimeDebugBuilder.cpp
Michael Kruse4c86a1d2015-11-26 12:36:2544 CodeGen/CodegenCleanup.cpp
Tobias Grosser23f16b12014-03-03 19:30:1945 ${GPGPU_CODEGEN_FILES}
Andreas Simbuerger19523ed2014-03-11 21:25:5946 Exchange/JSONExporter.cpp
Tobias Grosser23f16b12014-03-03 19:30:1947 Support/GICHelper.cpp
Johannes Doerfert574182d2015-08-12 10:19:5048 Support/SCEVAffinator.cpp
Tobias Grosser23f16b12014-03-03 19:30:1949 Support/SCEVValidator.cpp
Andreas Simbuerger8dbe3382014-03-11 21:26:0650 Support/RegisterPasses.cpp
Tobias Grosser23f16b12014-03-03 19:30:1951 Support/ScopHelper.cpp
Tobias Grossera63b7ce2015-05-03 05:21:3652 Support/ScopLocation.cpp
Tobias Grosser23f16b12014-03-03 19:30:1953 ${POLLY_JSON_FILES}
Andreas Simbuerger19523ed2014-03-11 21:25:5954 Transform/Canonicalization.cpp
55 Transform/CodePreparation.cpp
56 Transform/DeadCodeElimination.cpp
Andreas Simbuerger19523ed2014-03-11 21:25:5957 Transform/ScheduleOptimizer.cpp
Michael Kruse7886bd72016-09-08 15:02:3658 Transform/FlattenSchedule.cpp
59 Transform/FlattenAlgo.cpp
Michael Kruse36e79ec2016-11-29 16:41:2160 Transform/DeLICM.cpp
Michael Kruseef3cf012015-09-11 09:01:5561 ${POLLY_HEADER_FILES}
Tobias Grosser75805372011-04-29 06:27:0262 )
63
Tobias Grossera0412392016-07-13 15:54:4764if (GPU_CODEGEN)
65 target_link_libraries(Polly PollyPPCG)
66endif (GPU_CODEGEN)
67
Michael Kruseb280ded2015-09-24 12:38:4968target_link_libraries(Polly PollyISL)
Michael Krusef2285502015-06-22 20:31:1669
Tobias Grossercf33c932015-02-12 08:27:1970if (BUILD_SHARED_LIBS)
71 target_link_libraries(Polly
72 LLVMSupport
73 LLVMCore
74 LLVMScalarOpts
75 LLVMInstCombine
76 LLVMTransformUtils
77 LLVMAnalysis
78 LLVMipo
Tobias Grossered61e1f2015-03-09 13:35:1979 LLVMMC
Tobias Grossered873cd2016-01-31 20:25:4680# The libraries below are required for darwin: http://PR26392
81 LLVMBitReader
82 LLVMMCParser
83 LLVMObject
84 LLVMProfileData
85 LLVMTarget
86 LLVMVectorize
Tobias Grossercf33c932015-02-12 08:27:1987 )
Tobias Grosser3027fed2015-03-04 18:51:2788 link_directories(
89 ${LLVM_LIBRARY_DIR}
90 )
Tobias Grosserbea6c542016-02-03 16:29:0491elseif (LLVM_LINK_LLVM_DYLIB)
92 target_link_libraries(Polly
93 LLVM
94 )
95 link_directories(
96 ${LLVM_LIBRARY_DIR}
97 )
Tobias Grossercf33c932015-02-12 08:27:1998endif()
99
Sebastian Popee605bc2014-03-13 22:07:17100# Build a monolithic Polly.a and a thin module LLVMPolly.moduleext that links to
101# that static library.
Michael Krusec4ad8822015-07-21 12:29:02102if (MSVC)
103 # Add dummy target, because loadable modules are not supported on Windows
104 add_custom_target(LLVMPolly)
Michael Kruse6362f5a2015-07-21 12:40:01105 set_target_properties(LLVMPolly PROPERTIES FOLDER "Polly")
Michael Krusec4ad8822015-07-21 12:29:02106else ()
107 add_polly_loadable_module(LLVMPolly
108 Polly.cpp
109 )
110
111 target_link_libraries(LLVMPolly Polly)
112
113 set_target_properties(LLVMPolly
114 PROPERTIES
115 LINKER_LANGUAGE CXX
116 PREFIX "")
117endif ()
Tobias Grosser23f16b12014-03-03 19:30:19118
Tobias Grosserad41c4c2012-09-04 08:19:12119if (TARGET intrinsics_gen)
120 # Check if we are building as part of an LLVM build
Sebastian Pop96e9ed72014-03-13 20:29:19121 add_dependencies(Polly intrinsics_gen)
Tobias Grosserad41c4c2012-09-04 08:19:12122endif()
123