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
61 Transform/ForwardOpTree.cpp
63 Transform/Simplify.cpp
66 set_target_properties(PollyCore PROPERTIES FOLDER "Polly")
68 # Create the library that can be linked into LLVM's tools and Polly's unittests.
69 # It depends on all library it needs, such that with
70 # LLVM_POLLY_LINK_INTO_TOOLS=ON, its dependencies like PollyISL are linked as
72 add_polly_library(Polly $<TARGET_OBJECTS:PollyCore>)
73 target_link_libraries(Polly
78 # Additional dependencies for Polly-ACC.
80 target_link_libraries(Polly PollyPPCG)
84 # Polly-ACC requires the NVPTX backend to work. Ask LLVM about its libraries.
87 # This call emits an error if they NVPTX backend is not enable.
88 llvm_map_components_to_libnames(nvptx_libs NVPTX)
91 if (LLVM_LINK_LLVM_DYLIB)
92 # The shlib/dylib contains all the LLVM components
93 # (including NVPTX is enabled) already. Adding them to target_link_libraries
94 # would cause them being twice in the address space
95 # (their LLVM*.a/so and their copies in libLLVM.so)
96 # which results in errors when the two instances try to register the same
97 # command-line switches.
98 target_link_libraries(Polly LLVM)
100 target_link_libraries(Polly
111 # The libraries below are required for darwin: http://PR26392
121 # Create a loadable module Polly.so that can be loaded using
122 # LLVM's/clang's "-load" option.
124 # Add dummy target, because loadable modules are not supported on Windows
125 add_custom_target(LLVMPolly)
126 set_target_properties(LLVMPolly PROPERTIES FOLDER "Polly")
128 add_polly_loadable_module(LLVMPolly
130 $<TARGET_OBJECTS:PollyCore>
133 # Only add the dependencies that are not part of LLVM. The latter are assumed
134 # to be already available in the address space the module is loaded into.
135 # Adding them once more would have the effect that both copies try to register
136 # the same command line options, to which LLVM reacts with an error.
137 # If Polly-ACC is enabled, the NVPTX target is also expected to reside in the
138 # hosts. This is not the case for bugpoint. Use LLVM_POLLY_LINK_INTO_TOOLS=ON
139 # instead which will automatically resolve the additional dependencies by
141 target_link_libraries(LLVMPolly ${ISL_TARGET} ${JSONCPP_LIBRARIES})
143 target_link_libraries(LLVMPolly PollyPPCG)
146 set_target_properties(LLVMPolly
152 if (TARGET intrinsics_gen)
153 # Check if we are building as part of an LLVM build
154 add_dependencies(PollyCore intrinsics_gen)