Commit Graph

89 Commits

Author SHA1 Message Date
Rainer Orth 15a3476f3f [polly][unittests] Link DeLICMTests with libLLVMCore
A `-DBUILD_SHARED_LIBS=ON` build on Solaris/amd64 failed with

  Undefined                       first referenced
   symbol                             in file
  _ZNK4llvm3cfg6UpdateIPNS_10BasicBlockEE4dumpEv tools/polly/unittests/DeLICM/CMakeFiles/DeLICMTests.dir/DeLICMTest.cpp.o  (symbol belongs to implicit dependency /var/llvm/local-amd64-release-stage2-shared-A/bin/../lib/libLLVMCore.so.14git)
  ld: fatal: symbol referencing errors

Solaris `ld` requires to directly link with dependant libraries, so this
patch explicitly adds `libLLVMCore`.

Tested on `amd64-pc-solaris2.11` and `x86_64-pc-linux-gnu`.

Differential Revision: https://reviews.llvm.org/D118452
2022-01-28 21:58:40 +01:00
Riccardo Mori 44596fe6a9 [Polly][Isl] Use the function unsignedFromIslSize to manage a isl::size object. NFCI
This is part of an effort to reduce the differences between the custom C++ bindings used right now by polly in lib/External/isl/include/isl/isl-noxceptions.h and the official isl C++ interface.
In the official interface the type `isl::size` cannot be casted to an unsigned without previously having checked if it contains a valid value with the function `isl::size::is_error()`.
For this reason two helping functions have been added:
 - `IslAssert`: assert that no errors are present in debug builds and just disables the mandatory error check in non-debug builds
 - `unisgnedFromIslSIze`: cast the `isl::size` object to `unsigned`

Changes made:
 - Add the functions `IslAssert` and `unsignedFromIslSize`
 - Add the utility function `rangeIslSize()`
 - Retype `MaxDisjunctsInDomain` from `int` to `unsigned`
 - Retype `RunTimeChecksMaxAccessDisjuncts` from `int` to `unsigned`
 - Retype `MaxDimensionsInAccessRange` from `int` to `unsigned`
 - Replaced some usages of `isl_size` to `unsigned` since we aim not to use `isl_size` anymore
 - `isl-noexceptions.h` has been generated by e704f73c88

No functional change intended.

Reviewed By: Meinersbur

Differential Revision: https://reviews.llvm.org/D113101
2021-11-05 11:15:22 +01:00
Michael Kruse cdbc86dd22 [Polly] Don't redundantly link libPolly into unittests.
With LLVM_LINK_LLVM_DYLIB and LLVM_POLLY_LINK_INTO_TOOLS, Polly is
already linked into libLLVM.so, linking libPolly.a as well into
unittests results in duplicate command line registration errors.
2021-08-24 03:07:30 -05:00
Riccardo Mori ce8272afb3 [Polly][Isl] Use isl::val::sub instead of isl::val::sub_ui. NFC
This is part of an effort to reduce the differences between the custom C++ bindings used right now by polly in `lib/External/isl/include/isl/isl-noxceptions.h` and the official isl C++ interface.

Changes made:
 -  Use `isl::val::sub` instead of `isl::val::sub_ui`
 - `isl-noexceptions.h` has been generated by 355e84163a

Depends on D107225

Reviewed By: Meinersbur

Differential Revision: https://reviews.llvm.org/D107293
2021-08-17 09:34:52 +02:00
Riccardo Mori d3fdbda6b0 [Polly][Isl] Move to the new-polly-generator branch version of isl-noexceptions.h. NFCI
This is part of an effort to reduce the differences between the custom C++ bindings used right now by polly in `lib/External/isl/include/isl/isl-noxceptions.h` and the official isl C++ interface.

With this commit we are moving from the `polly-generator` branch to the `new-polly-generator` branch that is more mantainable and is based on the official C++ interface `cpp-checked.h`.

Changes made:
 - There are now many sublcasses for `isl::ast_node` representing different isl types. Use `isl::ast_node_for`, `isl::ast_node_user`, `isl::ast_node_block` and `isl::ast_node_mark` where needed.
 - There are now many sublcasses for `isl::schedule_node` representing different isl types. Use `isl::schedule_node_mark`, `isl::schedule_node_extension`, `isl::schedule_node_band` and `isl::schedule_node_filter` where needed.
 - Replace the `isl::*::dump` with `dumpIslObj` since the isl dump method is not exposed in the C++ interface.
 - `isl::schedule_node::get_child` has been renamed to `isl::schedule_node::child`
 - `isl::pw_multi_aff::get_pw_aff` has been renamed to `isl::pw_multi_aff::at`
 - The constructor `isl::union_map(isl::union_pw_multi_aff)` has been replaced with the static method `isl::union_map::from()`
 - Replace usages of `isl::val::add_ui` with `isl::val::add`
 - `isl::union_set_list::alloc` is now a constructor
 - All the `isl_size` values are now wrapped inside the class `isl::size` use `isl::size::release` to get the internal `isl_size` value where needed.
 - `isl-noexceptions.h` has been generated by 73f5ed1f4d

No functional change intended.

Reviewed By: Meinersbur

Differential Revision: https://reviews.llvm.org/D107225
2021-08-16 15:53:26 +02:00
Michael Kruse 5a6d770651 [Polly] Fix compiler warnings. NFC. 2021-08-12 13:35:20 -05:00
Michael Kruse 0f50ffb336 [Polly][test] Add tests for IslMaxOperationsGuard.
Add unittests for IslMaxOperationsGuard and the behaviour of the isl-noexception.h wrapper under exceeded max_operations.

Reviewed By: patacca

Differential Revision: https://reviews.llvm.org/D107401
2021-08-05 14:52:39 -05:00
Michael Kruse 50eaa82cdb [Polly][test] Test difference between isl::stat:ok() and isl::stat::error().
The foreach callback wrappers tests check the return values of isl::stat:ok() and isl::stat::error() separately. However, due to the the container they are iterating over containing just one element, they are actually not testing the difference between them.

This patch changes to set to be iterated over to contain 2 element to make returning sl::stat:ok (continue iterating the next element) and isl::stat::error (break after current element) have different effects other than the return value of the foreach itself.

Reviewed By: patacca

Differential Revision: https://reviews.llvm.org/D107395
2021-08-05 14:49:31 -05:00
Riccardo Mori d5ee355f89 [Polly][Isl] Use isl::union_map::unite() instead of isl::union_map::add_map(). NFC
This is part of an effort to reduce the differences between the custom C++ bindings used right now by polly in `lib/External/isl/include/isl/isl-noxceptions.h` and the official isl C++ interface.

Changes made:
 - Use `isl::union_map::unite()` instead of `isl::union_map::add_map()`
 - `isl-noexceptions.h` has been generated by this 3f43ae29fa

Depends on D106059

Reviewed By: Meinersbur

Differential Revision: https://reviews.llvm.org/D106061
2021-07-19 12:11:00 +02:00
Riccardo Mori bad3ebbaae [Polly][Isl] Stop generating isl::union_{set,map} from isl::space. NFC
This is part of an effort to reduce the differences between the custom C++ bindings used right now by polly in `lib/External/isl/include/isl/isl-noxceptions.h` and the official isl C++ interface.

Changes made:
 - Stop generating `isl::union_set` and isl::union_map` from `isl::space` and instead generate them from `isl::ctx`
 - Disable clang-format on `isl-noexceptions.h`
 - Removed `isl::union_{set,map}` generator from `isl::space` from `isl-noexceptions.h`
 - `isl-noexceptions.h` has been generated by this 87c3413b6f

Reviewed By: Meinersbur

Differential Revision: https://reviews.llvm.org/D106059
2021-07-19 11:24:53 +02:00
patacca b55aedd0b8 [Polly][Isl] Use isl::union_set::unite() instead of isl::union_set::add_set(). NFC
This is part of an effort to reduce the differences between the custom C++ bindings used right now by polly in `lib/External/isl/include/isl/isl-noxceptions.h` and the official isl C++ interface.

Changes made:
 - Use `isl::union_set::unite()` instead of `isl::union_set::add_set()`
 - `isl-noexceptions.h` has been generated by this 390c44982b

Depends on D104994

Reviewed By: Meinersbur

Differential Revision: https://reviews.llvm.org/D105444
2021-07-07 16:26:55 +02:00
patacca 7c7978a122 [Polly][Isl] Removing explicit operator bool() from isl C++ bindings. NFC.
This is part of an effort to reduce the differences between the custom C++ bindings used right now by polly in `lib/External/isl/include/isl/isl-noxceptions.h` and the official isl C++ interface.

Changes made:
 - Removing explicit operator bool() from all the classes in the isl C++ bindings.
 - Replace each call to operator bool() to method `is_null()`.
 - isl-noexceptions.h has been generated by this 27396daac5

Reviewed By: Meinersbur

Differential Revision: https://reviews.llvm.org/D103976
2021-06-11 14:44:24 +02:00
patacca 9b41d0958e [Polly][Isl] Removing nullptr constructor from C++ bindings. NFC.
[Polly][Isl] Removing nullptr constructor from C++ bindings. NFC.

This is part of an effort to reduce the differences between the custom C++ bindings used right now by polly in `lib/External/isl/include/isl/isl-noxceptions.h` and the official isl C++ interface.

Changes made:
 - Removed `std::nullptr_t` constructor from all the classes in the isl C++ bindings.
 - `isl-noexceptions.h` has been generated by this a7e00bea38

Reviewed By: Meinersbur

Differential Revision: https://reviews.llvm.org/D103751
2021-06-08 23:46:28 +02:00
patacca f60ea691a9 Revert "[Polly][Isl] Removing nullptr constructor from C++ bindings. NFC."
This reverts commit be5e2fc7bf.

This introduced a building error for polly. https://lab.llvm.org/buildbot#builders/10/builds/4951
2021-06-08 17:12:10 +02:00
patacca be5e2fc7bf [Polly][Isl] Removing nullptr constructor from C++ bindings. NFC.
[Polly][Isl] Removing nullptr constructor from C++ bindings. NFC.

This is part of an effort to reduce the differences between the custom C++ bindings used right now by polly in `lib/External/isl/include/isl/isl-noxceptions.h` and the official isl C++ interface.

Changes made:
 - Removed `std::nullptr_t` constructor from all the classes in the isl C++ bindings.
 - `isl-noexceptions.h` has been generated by this a7e00bea38

Reviewed By: Meinersbur

Differential Revision: https://reviews.llvm.org/D103751
2021-06-08 15:28:20 +02:00
Michael Kruse d123e983b3 [Polly] Move MatMul optimization into its own file. NFC.
Functions shared between generalized matrix-multiplication optimization
and other post-reschedule optimizations (tiling, prevect) are moved into
the schedule tree transformation utility ScheduleTreeTransform.
2021-06-04 23:22:30 -05:00
Michael Kruse ab0556bb20 [Polly] Regenerate isl-noexceptions.h.
Regenerate the C++ wrapper header from the current isl version's
headers.

The most notable change is that some dimension sizes are represented by
an isl_size (instead of unsigned), which is a signed int. Additionally,
some function may return -1 in case of an error which already had been
fixed in the past. The C++ may no return -1 instead of UINT_MAX which
caused the problems.

Some types in Polly had been changed from unsigned to isl_size
(that were not already auto) and some loops/comparision had to be
changed to avoid unsigned/signed comparison warnings.
2021-02-14 19:17:54 -06:00
Michael Kruse 7387f33bfe [Polly] Hide IslScheduleOptimizer implementation from header. NFC.
These are implementation details of the IslScheduleOptimizer pass
implementation and not use anywhere else. Hence, we can move them to the
cpp file and into an anonymous namespace.

Only getPartialTilePrefixes is, aside from the pass itself, used
externally (by the ScheduleOptimizerTest) and moved into the polly
namespace.
2021-02-11 21:02:29 -06:00
Michał Górny 96b02808af [Polly] Support linking ScopPassManager against LLVM dylib
Link ScopPassManager to LLVM dylib target if LLVM_LINK_LLVM_DYLIB
is enabled.  This fixes build failures on systems where static LLVM
libraries are not installed.

Differential Revision: https://reviews.llvm.org/D85281
2020-08-07 06:46:35 +02:00
Logan Smith a52aea0ba6 Use INTERFACE_COMPILE_OPTIONS to disable -Wsuggest-override for any target that links to gtest
This cleans up several CMakeLists.txt's where -Wno-suggest-override was manually specified. These test targets now inherit this flag from the gtest target.

Some unittests CMakeLists.txt's, in particular Flang and LLDB, are not touched by this patch. Flang manually adds the gtest sources itself in some configurations, rather than linking to LLVM's gtest target, so this fix would be insufficient to cover those cases. Similarly, LLDB has subdirectories that manually add the gtest headers to their include path without linking to the gtest target, so those subdirectories still need -Wno-suggest-override to be manually specified to compile without warnings.

Differential Revision: https://reviews.llvm.org/D84554
2020-07-27 08:37:01 -07:00
Logan Smith 77e0e9e17d Reapply "Try enabling -Wsuggest-override again, using add_compile_options instead of add_compile_definitions for disabling it in unittests/ directories."
add_compile_options is more sensitive to its location in the file than add_definitions--it only takes effect for sources that are added after it. This updated patch ensures that the add_compile_options is done before adding any source files that depend on it.

Using add_definitions caused the flag to be passed to rc.exe on Windows and thus broke Windows builds.
2020-07-22 17:50:19 -07:00
Logan Smith 97a0f80c46 Revert "Try enabling -Wsuggest-override again, using add_compile_options instead of add_compile_definitions for disabling it in unittests/ directories."
This reverts commit 388c9fb1af.
2020-07-22 15:07:01 -07:00
Logan Smith 388c9fb1af Try enabling -Wsuggest-override again, using add_compile_options instead of add_compile_definitions for disabling it in unittests/ directories.
Using add_compile_definitions caused the flag to be passed to rc.exe on Windows and thus broke Windows builds.
2020-07-22 14:19:34 -07:00
Hans Wennborg 3eec657825 Revert "Enable -Wsuggest-override in the LLVM build" and the follow-ups.
After lots of follow-up fixes, there are still problems, such as
-Wno-suggest-override getting passed to the Windows Resource Compiler
because it was added with add_definitions in the CMake file.

Rather than piling on another fix, let's revert so this can be re-landed
when there's a proper fix.

This reverts commit 21c0b4c1e8.
This reverts commit 81d68ad27b.
This reverts commit a361aa5249.
This reverts commit fa42b7cf29.
This reverts commit 955f87f947.
This reverts commit 8b16e45f66.
This reverts commit 308a127a38.
This reverts commit 274b6b0c7a.
This reverts commit 1c7037a2a5.
2020-07-22 20:23:58 +02:00
Logan Smith 21c0b4c1e8 Disable -Wsuggest-override for all remaining unittests/ directories 2020-07-21 17:48:36 -07:00
serge-sans-paille 8ceee08de1 Make Polly tests dependencies explicit
Due to libPolly now using the component infrastructure, it no longer carries all
dependencies as it used to do.

Differential Revision: https://reviews.llvm.org/D79295
2020-05-04 08:06:39 +02:00
Chandler Carruth 2946cd7010 Update the file headers across all of the LLVM projects in the monorepo
to reflect the new license.

We understand that people may be surprised that we're moving the header
entirely to discuss the new license. We checked this carefully with the
Foundation's lawyer and we believe this is the correct approach.

Essentially, all code in the project is now made available by the LLVM
project under our new license, so you will see that the license headers
include that license only. Some of our contributors have contributed
code under our old license, and accordingly, we have retained a copy of
our old license notice in the top-level files in each project and
repository.

llvm-svn: 351636
2019-01-19 08:50:56 +00:00
Tobias Grosser 7164b7d347 Update isl-cpp bindings
We upstreamed the export of isl_val_2exp, to the official cpp bindings.
In this process, we concluded that pow2 is a better and more widely used
name for this functionality. Hence, both the official isl-cpp bindings
and our derived variant use now the term pow2.

llvm-svn: 339312
2018-08-09 05:07:14 +00:00
Tobias Grosser a2fd441989 Rebase C++ bindings on top of latest isl bindings
The main difference in this change is that isl_stat is now always
checked by default. As we elminiated most used of isl_stat, thanks to
Philip Pfaffe's implementation of foreach, only a small set of changes
is needed.

This change does not include the following recent changes to isl's C++
bindings:

  - stricter error handling for isl_bool
  - dropping of the isl::namespace qualifiers

The former requires a larger patch in Polly and consequently should go
through a patch-review. The latter will be applied in the next commit to
keep this commit free from noise.

We also still apply a couple of other changes on top of the official isl
bindings. This delta is expected to shrink over time.

llvm-svn: 338504
2018-08-01 09:57:10 +00:00
Tobias Grosser 046c97876a [unittest/DeLICM] Replace isl foreach calls with for loops
llvm-svn: 337237
2018-07-17 06:08:04 +00:00
Tobias Grosser da82da8a20 Add missing namespace specifier
llvm-svn: 335966
2018-06-29 11:49:34 +00:00
Philip Pfaffe 52025af1da 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 08:17:03 +00:00
Tobias Grosser d3d3d6b75d Remove the last uses of isl::give and isl::take
llvm-svn: 331126
2018-04-29 00:28:26 +00:00
Tobias Grosser 72018edae7 Fix one unit test
llvm-svn: 331125
2018-04-29 00:28:14 +00:00
Tobias Grosser da3e8c4ba7 [DeLICM] Remove uses of isl::give
llvm-svn: 331122
2018-04-28 22:11:55 +00:00
Tobias Grosser 0ba8c4a868 [islpp] Remove use of isl::give from unittests
We do this mostly by just moving directly to pure C++ code.

llvm-svn: 331119
2018-04-28 21:06:14 +00:00
Tobias Grosser be483ae665 Add isl operator overloads for isl::pw_aff (Try II)
Piecewise affine expressions have directly corresponding mathematical
operators. Introduce these operators as overloads as this makes writing
code with isl::pw_aff expressions more directly readable.

We can now write:

  A = B + C    instead of    A = B.add(C)

Reviewers: Meinersbur, bollu, sebpop

Reviewed By: Meinersbur

Subscribers: philip.pfaffe, pollydev, llvm-commits

Differential Revision: https://reviews.llvm.org/D45534

llvm-svn: 329880
2018-04-12 06:15:17 +00:00
Tobias Grosser 7bbacbf4ca Revert r327216 'Add isl operator overloads for isl::pw_aff'
This commit requires further discussions.

llvm-svn: 329825
2018-04-11 16:58:08 +00:00
Tobias Grosser 3a99893618 Adjust to clang-format changes
llvm-svn: 328005
2018-03-20 17:16:32 +00:00
Tobias Grosser a1da86b224 Add isl operator overloads for isl::pw_aff
Piecewise affine expressions have directly corresponding mathematical
operators. Introduce these operators as overloads as this makes writing
code with isl::pw_aff expressions more directly readable.

We can now write:

  A = B + C    instead of    A = B.add(C)

llvm-svn: 327216
2018-03-10 18:07:03 +00:00
Shoaib Meenai d806af3499 [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-05 21:49:56 +00:00
Michael Kruse f281ae5992 [test] Add some test cases for computeArrayUnused.
llvm-svn: 311404
2017-08-21 23:04:55 +00:00
Michael Kruse ade14269cd [DeLICM] Fix unused zone for writes without in-between read.
The implementation of computeArrayUnused did not consider writes without
reads before, except for the first write in the SCoP. This caused it to
'forget' writes directly following another write.

This patch re-adds the entire reaching defintion of a write that has not
been covered before by a read.

This fixes Polybench 4.2 2mm where only one of the matrix-multiplication
was detected.

llvm-svn: 311403
2017-08-21 23:04:45 +00:00
Tobias Grosser f9308489eb Add forgotten CMakeLists.txt file in unit-test
llvm-svn: 310177
2017-08-05 09:44:11 +00:00
Tobias Grosser 00f25d0915 Fix spelling error in previous commit
llvm-svn: 310176
2017-08-05 09:39:00 +00:00
Tobias Grosser feae3dfe9f [unittests] Add unittest for getPartialTilePrefixes
In https://reviews.llvm.org/D36278 it was pointed out that the behavior of
getPartialTilePrefixes is not very well understood. To allow for a better
understanding, we first provide some basic unittests.

llvm-svn: 310175
2017-08-05 09:38:09 +00:00
Chandler Carruth 16879be0da Update Polly to reflect a change to a clang-format patch. I'm not sure
this is a great test file name based on this update, but I'll let Polly
folks sort out how they want this to work long-term, I just want tho
bots back.

llvm-svn: 306767
2017-06-29 23:58:03 +00:00
Philip Pfaffe 483340bb83 [Polly][NewPM] Reenable ScopPassManager unittest
llvm-svn: 303629
2017-05-23 11:28:50 +00:00
Tobias Grosser e890d5ba1b Drop nonexisting ScopPassManager directory
llvm-svn: 303066
2017-05-15 14:12:30 +00:00
Philip Pfaffe 762ec5a3eb [Polly][NewPM] Add missing Unittests
llvm-svn: 303064
2017-05-15 13:52:10 +00:00