4 External/JSON/json_reader.cpp
5 External/JSON/json_value.cpp
6 External/JSON/json_writer.cpp
11 CodeGen/IslExprBuilder.cpp
12 CodeGen/IslNodeBuilder.cpp
13 CodeGen/CodeGeneration.cpp)
16 set (GPGPU_CODEGEN_FILES
17 CodeGen/PPCGCodeGeneration.cpp
21 # Compile ISL into a separate library.
22 add_subdirectory(External)
24 set(POLLY_HEADER_FILES)
25 if (MSVC_IDE OR XCODE)
26 file(GLOB_RECURSE POLLY_HEADER_FILES "${POLLY_SOURCE_DIR}/include/polly/*.h")
29 # Use an object-library to add the same files to multiple libs without requiring
30 # the sources them to be recompiled for each of them.
31 add_library(PollyCore OBJECT
32 Analysis/DependenceInfo.cpp
33 Analysis/PolyhedralInfo.cpp
34 Analysis/ScopDetection.cpp
35 Analysis/ScopDetectionDiagnostic.cpp
37 Analysis/ScopBuilder.cpp
38 Analysis/ScopGraphPrinter.cpp
40 Analysis/PruneUnprofitable.cpp
41 CodeGen/BlockGenerators.cpp
43 CodeGen/LoopGenerators.cpp
46 CodeGen/RuntimeDebugBuilder.cpp
47 CodeGen/CodegenCleanup.cpp
48 CodeGen/PerfMonitor.cpp
49 ${GPGPU_CODEGEN_FILES}
50 Exchange/JSONExporter.cpp
52 Support/SCEVAffinator.cpp
53 Support/SCEVValidator.cpp
54 Support/RegisterPasses.cpp
55 Support/ScopHelper.cpp
56 Support/ScopLocation.cpp
58 Support/DumpModulePass.cpp
60 Transform/Canonicalization.cpp
61 Transform/CodePreparation.cpp
62 Transform/DeadCodeElimination.cpp
63 Transform/ScheduleOptimizer.cpp
64 Transform/FlattenSchedule.cpp
65 Transform/FlattenAlgo.cpp
67 Transform/Simplify.cpp
71 # Create the library that can be linked into LLVM's tools and Polly's unittests.
72 # It depends on all library it needs, such that with
73 # LLVM_POLLY_LINK_INTO_TOOLS=ON, its dependencies like PollyISL are linked as
75 add_polly_library(Polly $<TARGET_OBJECTS:PollyCore>)
76 target_link_libraries(Polly
80 # Additional dependencies for Polly-ACC.
82 target_link_libraries(Polly PollyPPCG)
85 # Add Polly's LLVM dependencies.
86 # When built inside the LLVM source tree, these are CMake targets that will
87 # depend on their dependencies and CMake ensures they are added in the right
89 # If Polly is built independently, just add all LLVM libraries. LLVM_ROOT_DIR
90 # might have been configured to compile to individual libraries or a single
91 # libLLVM.so (called dylib), reported by llvm-config, so there is no fixed list
92 # of required libraries.
93 if (DEFINED LLVM_MAIN_SRC_DIR)
95 # Polly-ACC requires the NVPTX backend to work. Ask LLVM about its libraries.
98 # This call emits an error if they NVPTX backend is not enable.
99 llvm_map_components_to_libnames(nvptx_libs NVPTX)
102 if (LLVM_LINK_LLVM_DYLIB)
103 # The shlib/dylib contains all the LLVM components
104 # (including NVPTX is enabled) already. Adding them to target_link_libraries
105 # would cause them being twice in the address space
106 # (their LLVM*.a/so and their copies in libLLVM.so)
107 # which results in errors when the two instances try to register the same
108 # command-line switches.
109 target_link_libraries(Polly LLVM)
111 target_link_libraries(Polly
121 # The libraries below are required for darwin: http://PR26392
131 # When Polly-ACC is enabled, we assume that the host LLVM was also built with
132 # the NVPTX target enabled.
133 target_link_libraries(Polly
139 # Create a loadable module Polly.so that can be loaded using
140 # LLVM's/clang's "-load" option.
142 # Add dummy target, because loadable modules are not supported on Windows
143 add_custom_target(LLVMPolly)
144 set_target_properties(LLVMPolly PROPERTIES FOLDER "Polly")
146 add_polly_loadable_module(LLVMPolly
148 $<TARGET_OBJECTS:PollyCore>
151 # Only add the dependencies that are not part of LLVM. The latter are assumed
152 # to be already available in the address space the module is loaded into.
153 # Adding them once more would have the effect that both copies try to register
154 # the same command line options, to which LLVM reacts with an error.
155 # If Polly-ACC is enabled, the NVPTX target is also expected to reside in the
156 # hosts. This is not the case for bugpoint. Use LLVM_POLLY_LINK_INTO_TOOLS=ON
157 # instead which will automatically resolve the additional dependencies by
159 target_link_libraries(LLVMPolly ${ISL_TARGET})
161 target_link_libraries(LLVMPolly PollyPPCG)
164 set_target_properties(LLVMPolly
170 if (TARGET intrinsics_gen)
171 # Check if we are building as part of an LLVM build
172 add_dependencies(Polly intrinsics_gen)