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
56 Transform/Canonicalization.cpp
57 Transform/CodePreparation.cpp
58 Transform/DeadCodeElimination.cpp
59 Transform/ScheduleOptimizer.cpp
60 Transform/FlattenSchedule.cpp
61 Transform/FlattenAlgo.cpp
62 Transform/ForwardOpTree.cpp
64 Transform/ZoneAlgo.cpp
65 Transform/Simplify.cpp
66 Transform/MaximalStaticExpansion.cpp
67 Transform/RewriteByReferenceParameters.cpp
68 Transform/ScopInliner.cpp
71 set_target_properties(PollyCore PROPERTIES FOLDER "Polly")
73 # Create the library that can be linked into LLVM's tools and Polly's unittests.
74 # It depends on all library it needs, such that with
75 # LLVM_POLLY_LINK_INTO_TOOLS=ON, its dependencies like PollyISL are linked as
77 add_polly_library(Polly $<TARGET_OBJECTS:PollyCore>)
78 target_link_libraries(Polly PUBLIC
83 # Additional dependencies for Polly-ACC.
85 target_link_libraries(Polly PUBLIC PollyPPCG)
89 # Polly-ACC requires the NVPTX backend to work. Ask LLVM about its libraries.
92 # This call emits an error if they NVPTX backend is not enable.
93 llvm_map_components_to_libnames(nvptx_libs NVPTX)
96 if (LLVM_LINK_LLVM_DYLIB)
97 # The shlib/dylib contains all the LLVM components
98 # (including NVPTX is enabled) already. Adding them to target_link_libraries
99 # would cause them being twice in the address space
100 # (their LLVM*.a/so and their copies in libLLVM.so)
101 # which results in errors when the two instances try to register the same
102 # command-line switches.
103 target_link_libraries(Polly PUBLIC LLVM)
105 target_link_libraries(Polly PUBLIC
118 # The libraries below are required for darwin: http://PR26392
128 # Create a loadable module Polly.so that can be loaded using
129 # LLVM's/clang's "-load" option.
131 # Add dummy target, because loadable modules are not supported on Windows
132 add_custom_target(LLVMPolly)
133 set_target_properties(LLVMPolly PROPERTIES FOLDER "Polly")
135 add_polly_loadable_module(LLVMPolly
137 $<TARGET_OBJECTS:PollyCore>
140 # Only add the dependencies that are not part of LLVM. The latter are assumed
141 # to be already available in the address space the module is loaded into.
142 # Adding them once more would have the effect that both copies try to register
143 # the same command line options, to which LLVM reacts with an error.
144 # If Polly-ACC is enabled, the NVPTX target is also expected to reside in the
145 # hosts. This is not the case for bugpoint. Use LLVM_POLLY_LINK_INTO_TOOLS=ON
146 # instead which will automatically resolve the additional dependencies by
148 target_link_libraries(LLVMPolly PUBLIC ${ISL_TARGET} ${JSONCPP_LIBRARIES})
150 target_link_libraries(LLVMPolly PUBLIC PollyPPCG)
153 set_target_properties(LLVMPolly
159 if (TARGET intrinsics_gen)
160 # Check if we are building as part of an LLVM build
161 add_dependencies(PollyCore intrinsics_gen)