5 CodeGen/IslExprBuilder.cpp
6 CodeGen/IslNodeBuilder.cpp
7 CodeGen/CodeGeneration.cpp)
10 set (GPGPU_CODEGEN_FILES
11 CodeGen/PPCGCodeGeneration.cpp
12 CodeGen/ManagedMemoryRewrite.cpp
16 # Compile ISL into a separate library.
17 add_subdirectory(External)
19 set(POLLY_HEADER_FILES)
20 if (MSVC_IDE OR XCODE)
21 file(GLOB_RECURSE POLLY_HEADER_FILES "${POLLY_SOURCE_DIR}/include/polly/*.h")
24 # Use an object-library to add the same files to multiple libs without requiring
25 # the sources them to be recompiled for each of them.
26 add_library(PollyCore OBJECT
27 Analysis/DependenceInfo.cpp
28 Analysis/PolyhedralInfo.cpp
29 Analysis/ScopDetection.cpp
30 Analysis/ScopDetectionDiagnostic.cpp
32 Analysis/ScopBuilder.cpp
33 Analysis/ScopGraphPrinter.cpp
35 Analysis/PruneUnprofitable.cpp
36 CodeGen/BlockGenerators.cpp
38 CodeGen/LoopGenerators.cpp
41 CodeGen/RuntimeDebugBuilder.cpp
42 CodeGen/CodegenCleanup.cpp
43 CodeGen/PerfMonitor.cpp
44 ${GPGPU_CODEGEN_FILES}
45 Exchange/JSONExporter.cpp
47 Support/SCEVAffinator.cpp
48 Support/SCEVValidator.cpp
49 Support/RegisterPasses.cpp
50 Support/ScopHelper.cpp
51 Support/ScopLocation.cpp
53 Support/DumpModulePass.cpp
54 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
61 Transform/ForwardOpTree.cpp
63 Transform/ZoneAlgo.cpp
64 Transform/Simplify.cpp
65 Transform/MaximalStaticExpansion.cpp
66 Transform/RewriteByReferenceParameters.cpp
67 Transform/ScopInliner.cpp
70 set_target_properties(PollyCore PROPERTIES FOLDER "Polly")
72 # Create the library that can be linked into LLVM's tools and Polly's unittests.
73 # It depends on all library it needs, such that with
74 # LLVM_POLLY_LINK_INTO_TOOLS=ON, its dependencies like PollyISL are linked as
76 add_polly_library(Polly $<TARGET_OBJECTS:PollyCore>)
77 target_link_libraries(Polly PUBLIC
81 # Additional dependencies for Polly-ACC.
83 target_link_libraries(Polly PUBLIC PollyPPCG)
87 # Polly-ACC requires the NVPTX backend to work. Ask LLVM about its libraries.
90 # This call emits an error if they NVPTX backend is not enable.
91 llvm_map_components_to_libnames(nvptx_libs NVPTX)
94 if (LLVM_LINK_LLVM_DYLIB)
95 # The shlib/dylib contains all the LLVM components
96 # (including NVPTX is enabled) already. Adding them to target_link_libraries
97 # would cause them being twice in the address space
98 # (their LLVM*.a/so and their copies in libLLVM.so)
99 # which results in errors when the two instances try to register the same
100 # command-line switches.
101 target_link_libraries(Polly PUBLIC LLVM)
103 target_link_libraries(Polly PUBLIC
116 # The libraries below are required for darwin: http://PR26392
126 # Create a loadable module Polly.so that can be loaded using
127 # LLVM's/clang's "-load" option.
129 # Add dummy target, because loadable modules are not supported on Windows
130 add_custom_target(LLVMPolly)
131 set_target_properties(LLVMPolly PROPERTIES FOLDER "Polly")
133 add_polly_loadable_module(LLVMPolly
135 $<TARGET_OBJECTS:PollyCore>
138 # Only add the dependencies that are not part of LLVM. The latter are assumed
139 # to be already available in the address space the module is loaded into.
140 # Adding them once more would have the effect that both copies try to register
141 # the same command line options, to which LLVM reacts with an error.
142 # If Polly-ACC is enabled, the NVPTX target is also expected to reside in the
143 # hosts. This is not the case for bugpoint. Use LLVM_POLLY_LINK_INTO_TOOLS=ON
144 # instead which will automatically resolve the additional dependencies by
146 target_link_libraries(LLVMPolly PUBLIC ${ISL_TARGET})
148 target_link_libraries(LLVMPolly PUBLIC PollyPPCG)
151 set_target_properties(LLVMPolly
157 if (TARGET intrinsics_gen)
158 # Check if we are building as part of an LLVM build
159 add_dependencies(PollyCore intrinsics_gen)