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")
37 # The libraries below are required for darwin: http://PR26392
46 # Polly-ACC requires the NVPTX backend to work. Ask LLVM about its libraries.
48 # This call emits an error if they NVPTX backend is not enable.
49 list(APPEND POLLY_COMPONENTS NVPTX)
52 # Use an object-library to add the same files to multiple libs without requiring
53 # the sources them to be recompiled for each of them.
54 add_llvm_pass_plugin(Polly
57 Analysis/DependenceInfo.cpp
58 Analysis/PolyhedralInfo.cpp
59 Analysis/ScopDetection.cpp
60 Analysis/ScopDetectionDiagnostic.cpp
62 Analysis/ScopBuilder.cpp
63 Analysis/ScopGraphPrinter.cpp
65 Analysis/PruneUnprofitable.cpp
66 CodeGen/BlockGenerators.cpp
68 CodeGen/LoopGenerators.cpp
69 CodeGen/LoopGeneratorsGOMP.cpp
70 CodeGen/LoopGeneratorsKMP.cpp
73 CodeGen/RuntimeDebugBuilder.cpp
74 CodeGen/CodegenCleanup.cpp
75 CodeGen/PerfMonitor.cpp
76 ${GPGPU_CODEGEN_FILES}
77 Exchange/JSONExporter.cpp
79 Support/SCEVAffinator.cpp
80 Support/SCEVValidator.cpp
81 Support/RegisterPasses.cpp
82 Support/ScopHelper.cpp
83 Support/ScopLocation.cpp
85 Support/DumpModulePass.cpp
86 Support/DumpFunctionPass.cpp
87 Support/VirtualInstruction.cpp
88 Transform/Canonicalization.cpp
89 Transform/CodePreparation.cpp
90 Transform/DeadCodeElimination.cpp
91 Transform/ScheduleOptimizer.cpp
92 Transform/ScheduleTreeTransform.cpp
93 Transform/FlattenSchedule.cpp
94 Transform/FlattenAlgo.cpp
95 Transform/ForwardOpTree.cpp
97 Transform/ZoneAlgo.cpp
98 Transform/Simplify.cpp
99 Transform/MaximalStaticExpansion.cpp
100 Transform/ScopInliner.cpp
101 Transform/ManualOptimizer.cpp
102 Transform/MatmulOptimizer.cpp
103 ${POLLY_HEADER_FILES}
108 set_target_properties(obj.Polly PROPERTIES FOLDER "Polly")
109 set_target_properties(Polly PROPERTIES FOLDER "Polly")
111 if (MSVC_IDE OR XCODE)
112 # Configure source groups for Polly source files. By default, in the IDE there
113 # will be a source and include folder. In the source folder will be all the
114 # source files in a flat list, and in the include folder will be all the
115 # headers in a flat list. Sets the CMake source_group for each folder such
116 # the organization of the sources and headers in the IDE matches how it is
118 setup_polly_source_groups(${CMAKE_CURRENT_LIST_DIR}
119 ${CMAKE_CURRENT_LIST_DIR}/../include/polly)
122 # Create the library that can be linked into LLVM's tools and Polly's unittests.
123 # It depends on all library it needs, such that with
124 # LLVM_POLLY_LINK_INTO_TOOLS=ON, its dependencies like PollyISL are linked as
126 target_link_libraries(Polly PUBLIC
130 # Additional dependencies for Polly-ACC.
132 target_link_libraries(Polly PUBLIC PollyPPCG)
135 if (NOT LLVM_LINK_LLVM_DYLIB AND NOT LLVM_POLLY_LINK_INTO_TOOLS)
136 # Polly-ACC requires the NVPTX target to be present in the executable it is linked to
137 set_property(TARGET bugpoint APPEND PROPERTY LINK_LIBRARIES LLVMTarget)
140 # Create a loadable module Polly.so that can be loaded using
141 # LLVM's/clang's "-load" option.
142 if (WIN32 OR NOT LLVM_ENABLE_PIC)
143 # Add dummy target, either because loadable modules are not supported
144 # as on Windows or because PIC code has been disabled
145 add_custom_target(LLVMPolly)
146 set_target_properties(LLVMPolly PROPERTIES FOLDER "Polly")
148 add_polly_loadable_module(LLVMPolly
150 $<TARGET_OBJECTS:obj.Polly>
153 # Only add the dependencies that are not part of LLVM. The latter are assumed
154 # to be already available in the address space the module is loaded into.
155 # Adding them once more would have the effect that both copies try to register
156 # the same command line options, to which LLVM reacts with an error.
157 # If Polly-ACC is enabled, the NVPTX target is also expected to reside in the
158 # hosts. This is not the case for bugpoint. Use LLVM_POLLY_LINK_INTO_TOOLS=ON
159 # instead which will automatically resolve the additional dependencies by
161 target_link_libraries(LLVMPolly PUBLIC ${ISL_TARGET})
163 target_link_libraries(LLVMPolly PUBLIC PollyPPCG)
166 set_target_properties(LLVMPolly
172 if (TARGET intrinsics_gen)
173 # Check if we are building as part of an LLVM build
174 add_dependencies(obj.Polly intrinsics_gen)