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_llvm_pass_plugin(Polly
29 Analysis/DependenceInfo.cpp
30 Analysis/PolyhedralInfo.cpp
31 Analysis/ScopDetection.cpp
32 Analysis/ScopDetectionDiagnostic.cpp
34 Analysis/ScopBuilder.cpp
35 Analysis/ScopGraphPrinter.cpp
37 Analysis/PruneUnprofitable.cpp
38 CodeGen/BlockGenerators.cpp
40 CodeGen/LoopGenerators.cpp
41 CodeGen/LoopGeneratorsGOMP.cpp
42 CodeGen/LoopGeneratorsKMP.cpp
45 CodeGen/RuntimeDebugBuilder.cpp
46 CodeGen/CodegenCleanup.cpp
47 CodeGen/PerfMonitor.cpp
48 ${GPGPU_CODEGEN_FILES}
49 Exchange/JSONExporter.cpp
51 Support/SCEVAffinator.cpp
52 Support/SCEVValidator.cpp
53 Support/RegisterPasses.cpp
54 Support/ScopHelper.cpp
55 Support/ScopLocation.cpp
57 Support/DumpModulePass.cpp
58 Support/VirtualInstruction.cpp
59 Transform/Canonicalization.cpp
60 Transform/CodePreparation.cpp
61 Transform/DeadCodeElimination.cpp
62 Transform/ScheduleOptimizer.cpp
63 Transform/ScheduleTreeTransform.cpp
64 Transform/FlattenSchedule.cpp
65 Transform/FlattenAlgo.cpp
66 Transform/ForwardOpTree.cpp
68 Transform/ZoneAlgo.cpp
69 Transform/Simplify.cpp
70 Transform/MaximalStaticExpansion.cpp
71 Transform/RewriteByReferenceParameters.cpp
72 Transform/ScopInliner.cpp
75 set_target_properties(obj.Polly PROPERTIES FOLDER "Polly")
76 set_target_properties(Polly PROPERTIES FOLDER "Polly")
78 if (MSVC_IDE OR XCODE)
79 # Configure source groups for Polly source files. By default, in the IDE there
80 # will be a source and include folder. In the source folder will be all the
81 # source files in a flat list, and in the include folder will be all the
82 # headers in a flat list. Sets the CMake source_group for each folder such
83 # the organization of the sources and headers in the IDE matches how it is
85 setup_polly_source_groups(${CMAKE_CURRENT_LIST_DIR}
86 ${CMAKE_CURRENT_LIST_DIR}/../include/polly)
89 # Create the library that can be linked into LLVM's tools and Polly's unittests.
90 # It depends on all library it needs, such that with
91 # LLVM_POLLY_LINK_INTO_TOOLS=ON, its dependencies like PollyISL are linked as
93 target_link_libraries(Polly PUBLIC
97 # Additional dependencies for Polly-ACC.
99 target_link_libraries(Polly PUBLIC PollyPPCG)
103 # Polly-ACC requires the NVPTX backend to work. Ask LLVM about its libraries.
106 # This call emits an error if they NVPTX backend is not enable.
107 llvm_map_components_to_libnames(nvptx_libs NVPTX)
110 if (LLVM_LINK_LLVM_DYLIB AND NOT LLVM_POLLY_LINK_INTO_TOOLS)
111 # The shlib/dylib contains all the LLVM components
112 # (including NVPTX is enabled) already. Adding them to target_link_libraries
113 # would cause them being twice in the address space
114 # (their LLVM*.a/so and their copies in libLLVM.so)
115 # which results in errors when the two instances try to register the same
116 # command-line switches.
117 target_link_libraries(Polly PUBLIC LLVM)
119 target_link_libraries(Polly PUBLIC
132 # The libraries below are required for darwin: http://PR26392
141 # Polly-ACC requires the NVPTX target to be present in the executable it is linked to
142 set_property(TARGET bugpoint APPEND PROPERTY LINK_LIBRARIES LLVMTarget)
145 # Create a loadable module Polly.so that can be loaded using
146 # LLVM's/clang's "-load" option.
148 # Add dummy target, because loadable modules are not supported on Windows
149 add_custom_target(LLVMPolly)
150 set_target_properties(LLVMPolly PROPERTIES FOLDER "Polly")
152 add_polly_loadable_module(LLVMPolly
154 $<TARGET_OBJECTS:obj.Polly>
157 # Only add the dependencies that are not part of LLVM. The latter are assumed
158 # to be already available in the address space the module is loaded into.
159 # Adding them once more would have the effect that both copies try to register
160 # the same command line options, to which LLVM reacts with an error.
161 # If Polly-ACC is enabled, the NVPTX target is also expected to reside in the
162 # hosts. This is not the case for bugpoint. Use LLVM_POLLY_LINK_INTO_TOOLS=ON
163 # instead which will automatically resolve the additional dependencies by
165 target_link_libraries(LLVMPolly PUBLIC ${ISL_TARGET})
167 target_link_libraries(LLVMPolly PUBLIC PollyPPCG)
170 set_target_properties(LLVMPolly
176 if (TARGET intrinsics_gen)
177 # Check if we are building as part of an LLVM build
178 add_dependencies(obj.Polly intrinsics_gen)