2016-08-25 20:36:15 +08:00
|
|
|
add_custom_target(PollyUnitTests)
|
|
|
|
set_target_properties(PollyUnitTests PROPERTIES FOLDER "Polly")
|
|
|
|
|
|
|
|
# add_polly_unittest(test_dirname file1.cpp file2.cpp)
|
|
|
|
#
|
|
|
|
# Will compile the list of files together and link against Polly and its dependences.
|
|
|
|
function(add_polly_unittest test_name)
|
|
|
|
if(COMMAND add_unittest)
|
|
|
|
add_unittest(PollyUnitTests ${test_name} ${ARGN})
|
|
|
|
else()
|
2016-08-25 22:33:44 +08:00
|
|
|
add_executable(${test_name} EXCLUDE_FROM_ALL ${ARGN})
|
2016-08-25 20:36:15 +08:00
|
|
|
set_target_properties(${test_name} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
|
|
|
|
|
[CMake] Use PRIVATE in target_link_libraries for executables
We currently use target_link_libraries without an explicit scope
specifier (INTERFACE, PRIVATE or PUBLIC) when linking executables.
Dependencies added in this way apply to both the target and its
dependencies, i.e. they become part of the executable's link interface
and are transitive.
Transitive dependencies generally don't make sense for executables,
since you wouldn't normally be linking against an executable. This also
causes issues for generating install export files when using
LLVM_DISTRIBUTION_COMPONENTS. For example, clang has a lot of LLVM
library dependencies, which are currently added as interface
dependencies. If clang is in the distribution components but the LLVM
libraries it depends on aren't (which is a perfectly legitimate use case
if the LLVM libraries are being built static and there are therefore no
run-time dependencies on them), CMake will complain about the LLVM
libraries not being in export set when attempting to generate the
install export file for clang. This is reasonable behavior on CMake's
part, and the right thing is for LLVM's build system to explicitly use
PRIVATE dependencies for executables.
Unfortunately, CMake doesn't allow you to mix and match the keyword and
non-keyword target_link_libraries signatures for a single target; i.e.,
if a single call to target_link_libraries for a particular target uses
one of the INTERFACE, PRIVATE, or PUBLIC keywords, all other calls must
also be updated to use those keywords. This means we must do this change
in a single shot. I also fully expect to have missed some instances; I
tested by enabling all the projects in the monorepo (except dragonegg),
and configuring both with and without shared libraries, on both Darwin
and Linux, but I'm planning to rely on the buildbots for other
configurations (since it should be pretty easy to fix those).
Even after this change, we still have a lot of target_link_libraries
calls that don't specify a scope keyword, mostly for shared libraries.
I'm thinking about addressing those in a follow-up, but that's a
separate change IMO.
Differential Revision: https://reviews.llvm.org/D40823
llvm-svn: 319840
2017-12-06 05:49:56 +08:00
|
|
|
target_link_libraries(${test_name} PRIVATE gtest_main gtest)
|
2016-08-25 20:36:15 +08:00
|
|
|
add_dependencies(PollyUnitTests ${test_name})
|
|
|
|
|
|
|
|
set_property(TARGET ${test_name} PROPERTY FOLDER "Polly")
|
|
|
|
endif()
|
2021-08-24 15:49:06 +08:00
|
|
|
|
|
|
|
if(LLVM_LINK_LLVM_DYLIB AND LLVM_POLLY_LINK_INTO_TOOLS)
|
|
|
|
# In this case Polly is already present in libLLVM,
|
|
|
|
# no need to link it again.
|
|
|
|
else()
|
|
|
|
target_link_libraries(${test_name} PRIVATE Polly)
|
|
|
|
endif()
|
2016-08-25 20:36:15 +08:00
|
|
|
endfunction()
|
|
|
|
|
|
|
|
add_subdirectory(Isl)
|
Add -polly-flatten-schedule pass.
The -polly-flatten-schedule pass reduces the number of scattering
dimensions in its isl_union_map form to make them easier to understand.
It is not meant to be used in production, only for debugging and
regression tests.
To illustrate, how it can make sets simpler, here is a lifetime set
used computed by the porposed DeLICM pass without flattening:
{ Stmt_reduction_for[0, 4] -> [0, 2, o2, o3] : o2 < 0;
Stmt_reduction_for[0, 4] -> [0, 1, o2, o3] : o2 >= 5;
Stmt_reduction_for[0, 4] -> [0, 1, 4, o3] : o3 > 0;
Stmt_reduction_for[0, i1] -> [0, 1, i1, 1] : 0 <= i1 <= 3;
Stmt_reduction_for[0, 4] -> [0, 2, 0, o3] : o3 <= 0 }
And here the same lifetime for a semantically identical one-dimensional
schedule:
{ Stmt_reduction_for[0, i1] -> [2 + 3i1] : 0 <= i1 <= 4 }
Differential Revision: https://reviews.llvm.org/D24310
llvm-svn: 280948
2016-09-08 23:02:36 +08:00
|
|
|
add_subdirectory(Flatten)
|
2017-02-16 00:59:10 +08:00
|
|
|
add_subdirectory(DeLICM)
|
2017-05-23 19:28:50 +08:00
|
|
|
add_subdirectory(ScopPassManager)
|
2017-08-05 17:38:09 +08:00
|
|
|
add_subdirectory(ScheduleOptimizer)
|
Implement an iterator for isl maps, basic_maps, sets, basic_sets
Summary:
Provide an iterator to simplify iteration over some isl collections.
Since these types do not natively support iteration, they have to be converted
to an list first by the caller, but can then be used in a ranged for loop:
```
isl::set S;
for (auto SubSet : S.get_basic_set_list ()) {
// ...
}
```
Reviewers: bollu, Meinersbur, grosser, dexonsmith
Reviewed By: bollu
Subscribers: hfinkel, mgorny, Meinersbur, mehdi_amini, bollu, steven_wu, llvm-commits
Differential Revision: https://reviews.llvm.org/D48136
llvm-svn: 335951
2018-06-29 16:17:03 +08:00
|
|
|
add_subdirectory(Support)
|