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