summaryrefslogtreecommitdiffstats
path: root/polly/CMakeLists.txt
Commit message (Collapse)AuthorAgeFilesLines
* [JSONExporter] Replace bundled Jsoncpp with llvm/Support/JSON.h. NFC.Michael Kruse2018-08-011-15/+0
| | | | | | Differential Revision: https://reviews.llvm.org/D49950 llvm-svn: 338461
* Back out of GPU Codegen if NVPTX is not availablePhilip Pfaffe2018-06-071-5/+8
| | | | | | | | | | | | | | | | | Summary: When enabling GPU codegen in polly, CMake will fail if NVPTX is not a target supported by the LLVM polly is being built against. In that case, GPU codegen should be switched off. Reviewers: Meinersbur, grosser, bollu Reviewed By: Meinersbur Subscribers: mgorny, bollu, pollydev, llvm-commits Differential Revision: https://reviews.llvm.org/D47888 llvm-svn: 334233
* [CMake] Use only keyword-version of target_link_library. NFC.Michael Kruse2018-01-121-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | CMake insists that for each target, one uses only the non-keyword version of target_link_library target_link_library(mytarget lib) or the one with PUBLIC/PRIVATE/INTERFACE keyword: target_link_library(mytarget PUBLIC lib) Otherwise, CMake fails with the error message: The keyword signature for target_link_libraries has already been used with the target "mytarget". All uses of target_link_libraries with a target must be either all-keyword or all-plain. Change all occurances of target_link_library to the newer keyworded version to avoid such errors. Some already have been changed in r319840, but might not be sufficient for all build configurations to build the doxygen manual. Reported-by: Tanya Lattner <tanyalattner@llvm.org> llvm-svn: 322376
* [Polly][CMake] Skip unit-tests in lit if gtest is not availablePhilip Pfaffe2017-07-111-0/+1
| | | | | | | | | | | | | | | | | | | | | Summary: There is a bug in the current lit configurations for the unittests. If gtest is not available, the site-config for the unit tests won't be generated. Because lit recurses through the test directory, the lit configuration for the unit tests will be discovered nevertheless, leading to a fatal error in lit. This patch semi-gracefully skips the unittests if gtest is not available. As a result, running lit now prints this: `warning: test suite 'Polly-Unit' contained no test`. If people think that this is too annoying, the alternative would be to pick apart the test directory, so that the lit testsuite discovery will always only find one configuration. In fact, both of these things could be combined. While it's certainly nice that running a single lit command runs all the tests, I suppose people use the `check-polly` make target over lit most of the time, so the difference might not be noticed. Reviewers: Meinersbur, grosser Reviewed By: grosser Subscribers: mgorny, bollu, pollydev, llvm-commits Tags: #polly Differential Revision: https://reviews.llvm.org/D34053 llvm-svn: 307651
* [Polly][CMake] Use the CMake Package instead of llvm-config in out-of-tree ↵Philip Pfaffe2017-07-111-99/+44
| | | | | | | | | | | | | | | | | | | | | | | builds Summary: As of now, Polly uses llvm-config to set up LLVM dependencies in an out-of-tree build. This is problematic for two reasons: 1) Right now, in-tree and out-of-tree builds in fact do different things. E.g., in an in-tree build, libPolly depends on a handful of LLVM libraries, while in an out-of-tree build it depends on all of them. This means that we often need to treat both paths seperately. 2) I'm specifically unhappy with the way libPolly is linked right now, because it just blindly links against all the LLVM libs. That doesn't make a lot of sense. For instance, one of these libs is LLVMTableGen, which contains a command line definition of a -o option. This means that I can not link an out-of-tree libPolly into a tool which might want to offer a -o option as well. This patch (mostly) drop the use of llvm-config in favor of LLVMs exported cmake package. However, building Polly with unittests requires access to the gtest sources (in the LLVM source tree). If we're building against an LLVM installation, this source tree is unavailable and must specified. I'm using llvm-config to provide a default in this case. Reviewers: Meinersbur, grosser Reviewed By: grosser Subscribers: tstellar, bollu, chapuni, mgorny, pollydev, llvm-commits Differential Revision: https://reviews.llvm.org/D33299 llvm-svn: 307650
* [CMake] Retire Polly's FindCUDA.cmake in favour of CMake's default ↵Philip Pfaffe2017-06-061-3/+3
| | | | | | | | | | | | | | | | | | FindCUDA.cmake script. Patch by: Singapuram Sanjay Reviewers: grosser, philip.pfaffe Reviewed By: philip.pfaffe Subscribers: pollydev, mgorny Tags: #polly Differential Revision: https://reviews.llvm.org/D33669 llvm-svn: 304818
* [Polly][CMake] Exclude isl_config from the polly-check-format target.Philip Pfaffe2017-05-151-1/+1
| | | | | | | | | | | | | | | | | | | Summary: The custom `polly-check-format` target runs clang-format over all source files in the directory tree excluding lib/External. `isl_config.h` is a header file that is generated by CMake in the build directory, and it's not correctly formatted (which I also wouldn't consider necessary, as it is a generated file). If the build directory is actually inside the Polly source directory (which it might be if you're building Polly out-of-tree), that check always fails. Hence this patch excludes this file from the check-format target. Reviewers: Meinersbur, grosser Reviewed By: grosser Subscribers: mgorny, llvm-commits, pollydev Tags: #polly Differential Revision: https://reviews.llvm.org/D33192 llvm-svn: 303060
* [Polly] Added OpenCL Runtime to GPURuntime Library for GPGPU CodeGenSiddharth Bhat2017-05-071-2/+8
| | | | | | | | | | | | | | | | | | | | | | | Summary: When compiling for GPU, one can now choose to compile for OpenCL or CUDA, with the corresponding polly-gpu-runtime flag (libopencl / libcudart). The GPURuntime library (GPUJIT) has been extended with the OpenCL Runtime library for that purpose, correctly choosing the corresponding library calls to the option chosen when compiling (via different initialization calls). Additionally, a specific GPU Target architecture can now be chosen with -polly-gpu-arch (only nvptx64 implemented thus far). Reviewers: grosser, bollu, Meinersbur, etherzhhb, singam-sanjay Reviewed By: grosser, Meinersbur Subscribers: singam-sanjay, llvm-commits, pollydev, nemanjai, mgorny, yaxunl, Anastasia Tags: #polly Differential Revision: https://reviews.llvm.org/D32431 llvm-svn: 302379
* [CMake] Introduce POLLY_BUNDLED_JSONCPP.Michael Kruse2017-05-061-1/+15
| | | | | | | | | | | Allow using a system's install jsoncpp library instead of the bundled one with the setting POLLY_BUNDLED_JSONCPP=OFF. This fixes llvm.org/PR32929 Differential Revision: https://reviews.llvm.org/D32922 llvm-svn: 302336
* Revert "[Polly] Added OpenCL Runtime to GPURuntime Library for GPGPU CodeGen"Siddharth Bhat2017-05-051-8/+2
| | | | | | | | | | | | | | | This reverts commit 17a84e414adb51ee375d14836d4c2a817b191933. Patches should have been submitted in the order of: 1. D32852 2. D32854 3. D32431 I mistakenly pushed D32431(3) first. Reverting to push in the correct order. llvm-svn: 302217
* [Polly] Added OpenCL Runtime to GPURuntime Library for GPGPU CodeGenSiddharth Bhat2017-05-051-2/+8
| | | | | | | | | | | | | | | | | | | | | | | Summary: When compiling for GPU, one can now choose to compile for OpenCL or CUDA, with the corresponding polly-gpu-runtime flag (libopencl / libcudart). The GPURuntime library (GPUJIT) has been extended with the OpenCL Runtime library for that purpose, correctly choosing the corresponding library calls to the option chosen when compiling (via different initialization calls). Additionally, a specific GPU Target architecture can now be chosen with -polly-gpu-arch (only nvptx64 implemented thus far). Reviewers: grosser, bollu, Meinersbur, etherzhhb, singam-sanjay Reviewed By: grosser, Meinersbur Subscribers: singam-sanjay, llvm-commits, pollydev, nemanjai, mgorny, yaxunl, Anastasia Tags: #polly Differential Revision: https://reviews.llvm.org/D32431 llvm-svn: 302215
* [CMake] Use object library to build the two flavours of Polly.Michael Kruse2017-04-271-1/+1
| | | | | | | | | | | | | | | | | | | | | Polly comes in two library flavors: One loadable module to use the LLVM framework -load mechanism, and another one that host applications can link to. These have very different requirements for Polly's own dependencies. The loadable module assumes that all its LLVM dependencies are already available in the address space of the host application, and is not allowed to bring in its own copy of any LLVM library (including the NVPTX backend in case of Polly-ACC). The non-module library is intended to be linked to using target_link_libraries. CMake would then resolve all of its dependencies, including NVPTX and ensure that only a single instance of each library will be used. Differential Revision: https://reviews.llvm.org/D32442 llvm-svn: 301558
* [CMake] Fix polly-isl-test execution in out-of-LLVM-tree builds.Michael Kruse2017-04-221-0/+3
| | | | | | | | | | | | | The isl unittest modified its PATH variable to point to the LLVM bin dir. When building out-of-LLVM-tree, it does not contain the polly-isl-test executable, hence the test fails. Ensure that the polly-isl-test is written to a bin directory in the build root, just like it would happen in an inside-LLVM build. Then, change PATH to include that dir such that the executable in it is prioritized before any other location. llvm-svn: 301096
* [CMake] Fix unittests in out-of-LLVM-tree builds.Michael Kruse2017-04-221-0/+5
| | | | | | | | | | | | | Unittests are linked against a subset of LLVM libraries and its transitive dependencies resolved by CMake. The information about indirect library dependency is not available when building separately from LLVM, which result in missing symbol errors while linking. Resolve this issue by querying llvm-config about the available LLVM libraries and link against all of them, since dependence information is still not available. llvm-svn: 301095
* [Cmake] Generate a PollyConfig.cmake.Michael Kruse2017-03-091-0/+1
| | | | | | | | | | | Generate a PollyConfig.cmake for use with Cmake's find_package in out-of-tree projects. Contributed-by: Philip Pfaffe <philip.pfaffe@gmail.com> Differential Revision: https://reviews.llvm.org/D30495 llvm-svn: 297395
* [Cmake] Optionally use a system isl version.Michael Kruse2017-02-271-2/+14
| | | | | | | | | | | | | | | This patch adds an option to build against a version of libisl already installed on the system. The installation is autodetected using the pkg-config file shipped with isl. The detection of the library is in the FindISL.cmake module that creates an imported target. Contributed-by: Philip Pfaffe <philip.pfaffe@gmail.com> Differential Revision: https://reviews.llvm.org/D30043 llvm-svn: 296361
* [Cmake] Bump required cmake version to 3.4.3.Michael Kruse2017-02-201-1/+1
| | | | | | | | This is currently the minimum required version by LLVM. Since LLVM is needed to build Polly, we also require at least that version. Suggested-by: Philip Pfaffe <philip.pfaffe@gmail.com> llvm-svn: 295672
* [External] Move lib/JSON to lib/External/JSON. NFC.Michael Kruse2017-02-051-4/+3
| | | | | | For consistency with isl and ppcg which are already in lib/External. llvm-svn: 294126
* Teach Polly's standalone build to work now that we include the gmockChandler Carruth2017-01-111-2/+13
| | | | | | component of gtest. llvm-svn: 291638
* Remove POLLY_LINK_LIBS, it is not usedHongbin Zheng2016-11-041-2/+0
| | | | llvm-svn: 285976
* Query llvm-config to get system libs required for linking.Michael Kruse2016-08-251-19/+5
| | | | | | | | | Remove the unused function get_system_libs. Instead, run 'llvm-config --system-libs' to determine which libraries are required in addition LLVM's for linking an executable. At the moment these are the unittests that link to gtest and transitively depend on these system libs. llvm-svn: 279743
* Add comment for querying --libdir. NFC.Michael Kruse2016-08-251-0/+1
| | | | llvm-svn: 279742
* Introduce unittests.Michael Kruse2016-08-251-2/+29
| | | | | | | | | | | | | | Add the infrastructure for unittests to Polly and two simple tests for conversion between isl_val and APInt. In addition, a build target check-polly-unittests is added to run only the unittests but not the regression tests. Clang's unittest mechanism served as as a blueprint which then was adapted to Polly. Differential Revision: https://reviews.llvm.org/D23833 llvm-svn: 279734
* Add LLVM libdir to library search path in out-of-tree builds.Michael Kruse2016-08-251-0/+5
| | | | | | | | | This previously was not required because in an out-of-tree build Polly would only build libraries (LLVMPolly, libPolly, libPollyISL, libPollyPPCG), but no executables where the libraries would be linked to. This will change when adding unittests in a follow-up commit. llvm-svn: 279730
* Also warn if llvm-lit is not available.Michael Kruse2016-08-251-6/+6
| | | | | | | The program 'llvm-lit', like 'not' and 'FileCheck' are necessary for running check-polly. Warn of any of the three is not in LLVM_INSTALL_ROOT/bin directory. llvm-svn: 279728
* GPGPU: Shorten ppcg include paths to avoid conflict with cuda.hTobias Grosser2016-07-151-2/+1
| | | | | | | | | | Instead of directly linking to ppcg's main source directory, we link to the parent director. This allows us to access ppcg's include files with 'ppcg/cuda.h' and avoids a conflict with NVIDIA's cuda.h header. Also drop an include directory that is currently not used. llvm-svn: 275536
* GPGPU: create default initialized PPCG scop and gpu programTobias Grosser2016-07-141-0/+6
| | | | | | | | | | | | | | At this stage, we do not yet modify the IR but just generate a default initialized ppcg_scop and gpu_prog and free both immediately. Both will later be filled with data from the polly::Scop and are needed to use PPCG for GPU schedule generation. This commit does not yet perform any GPU code generation, but ensures that the basic infrastructure has been put in place. We also add a simple test case to ensure the new code is run and use this opportunity to verify that GPU_CODEGEN tests are only run if GPU code generation has been enabled in cmake. llvm-svn: 275389
* cmake: do not check-format anything in lib/ExternalTobias Grosser2016-07-051-4/+2
| | | | | | | | | | There is no need to specifically match for isl, but we can exclude anything in lib/External from formatting as we assume that externally contributed code should always match the upstream code. This simplifies the cmake script and allows additional external projects to be added without the need to explicitly exclude them from formatting. llvm-svn: 274557
* Respect LLVM_INSTALL_TOOLCHAIN_ONLY.Eugene Zelenko2016-06-211-14/+16
| | | | | | | | Only shared library should be installed when LLVM_INSTALL_TOOLCHAIN_ONLY=ON. Differential revision: http://reviews.llvm.org/D21543 llvm-svn: 273292
* cmake: Ensure tools/* is still formattedTobias Grosser2016-03-251-3/+2
| | | | | | | | | This got accidentally dropped in r264283. Also, drop the wwwfiles from the removal list. This is not needed any more as we now explicitly list the directories that should be formatted. llvm-svn: 264397
* [CMAKE] Try to find the correct globbing expressionJohannes Doerfert2016-03-241-1/+1
| | | | llvm-svn: 264286
* Restrict clang-format to lib/ [NFC]Johannes Doerfert2016-03-241-1/+1
| | | | llvm-svn: 264283
* Also clang-format *.c run-time library filesTobias Grosser2016-03-081-2/+3
| | | | llvm-svn: 262917
* Add basic doxygen infrastructure for PollyTobias Grosser2016-02-041-0/+1
| | | | llvm-svn: 259764
* Add -sort-includes to our automatic source code formattingTobias Grosser2015-10-151-2/+2
| | | | llvm-svn: 250393
* Compile ISL into its own libraryMichael Kruse2015-09-241-18/+0
| | | | | | | | | | | | | | | | | | | | | | Refactor all ISL-related cmake build instructions into its own CMakeLists.txt and build as a separate library. This is useful to apply ISL-related build flags to ISL only and not to Polly's files. Also, it the separation of both projects becomes clearer. Proposed name of the library is Polly_isl. It is not "isl" to avoid mix-up with potentially installed libisl.{a|so}. Tested configurations: - Windows with cmake 3.2 - Ubuntu with cmake 3.0.2 - Ubuntu with cmake 3.0.2 BUILD_SHARED_LIBS on - Ubuntu with cmake 2.8.12.2 (LLVM minimum version) - Ubuntu out-of-LLVM-tree Differential Revision: http://reviews.llvm.org/D12810 llvm-svn: 248484
* Revise polly-{update|check}-format targetsMichael Kruse2015-09-141-8/+25
| | | | | | | | | | | | | | | | | | Summary: Make clang-format run on each file independently using add_custom_format (instead using a shell script in utils/). The targets polly-{update|check}-format depend on these. The primary motivation is to make them work on Windows, but also improves them generally: - Each file update/check can run in parallel (Although they do not take long to run anyway) - Implicit dependency on clang-format, so it recompiles if necessary - polly-check-format shows the formatting difference if failing Differential Revision: http://reviews.llvm.org/D12837 llvm-svn: 247581
* Introspect llvm-config --assertion-mode in cmake out-of-tree buildsMichael Kruse2015-09-111-0/+28
| | | | | | | | | | | | | | | | | | | | When compiling Polly without LLVM sources but with system-installed LLVM, the build process would not honor the LLVM_ENABLE_ASSERTIONS setting LLVM was compiled with, but effectively assume that it is switched off when compiling. During unit-tests llvm-lit would still query the LLVM_ENABLE_ASSERTIONS flag and enable tests which require assertions. Even if enabled for LLVM, Polly does not output its debug info and statistics in this this mode such that 7 tests fail. To fix, we query llvm-config --assertion-mode and if on, enable assertions as HandleLLVMOptions.cmake would do. We cannot reliably use HandleLLVMOptions.cmake itself as the host's LLVM build might have been built using automake and distributions change file locations (e.g. Debian to /usr/share/llvm-${VERSION}/cmake/HandleLLVMOptions.cmake). llvm-svn: 247470
* Do not use -fvisibility option with Visual CMichael Kruse2015-08-071-1/+3
| | | | | | It doesn't know the option and prints a warning. llvm-svn: 244363
* Unify FOLDER property of Polly targetsMichael Kruse2015-07-211-0/+2
| | | | | | | | | | Put all Polly targets into a single "Polly" category (i.e. solution folder). Previously there was no recognizable scheme and most categories contained just one or two targets or targets didn't belong to any category. Reviewers: grosser llvm-svn: 242779
* Remove header project from Visual Studio buildsMichael Kruse2015-07-211-1/+0
| | | | | | | | | | Remove the polly_headers_do_not_build project. Visual Studio is capable of finding the headers itself, although they are not listed explicitly. For explicit listing, the headers should be added to the relevant target. Reviewers: grosser llvm-svn: 242777
* Remove gcc-specific flags from Visual Studio buildMichael Kruse2015-07-211-2/+5
| | | | | | | | Remove the flags -fno-exceptions -fno-rtti and add the equivalent for compiling with MSVC. Reviewers: grosser llvm-svn: 242775
* Fix autotools buildMichael Kruse2015-06-251-0/+1
| | | | | | | | | | | | There were two issues: * ISL's configure generates include/isl/stdint.h, not isl/stdint.h as assumed. This is also changed in the CMake build. * Need to pass --with-int=imath to ISL's configure; the default is gmp. Polly's configure has been regenerated due to changing configure.ac llvm-svn: 240657
* Prepare replacing ISL by its 'make dist' filesMichael Kruse2015-06-221-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently the Polly repository contains the ISL sources with bogus isl_config.h and gitversion.h. This is problematic. In this state a macro #define __attribute__(x) becomes active in the source, leading to various problems e.g. when included before system header files. This patch will instead generate the two files specific to the host system at configure-time. For CMake, we replicate the tests that ISL's configure performs using try_compile(). In autotools build, we just invoke ISL's configure to generate the two files. This consequently required regenerating autoconf/configure. 'make dist' distributions of ISL contain a file GIT_HEAD_ID which contains the version the distribution is derived from. The repository files themselves do not contain such a hint. In a later commit we will replace the isl directory by the contents of such a .tar.gz. It does not contain the files imdrover.c iprime.c pi.c and rsamath.c currently compiled into Polly, but not used and therefore are removed by this patch. In the long term we plan to generate a dedicated library for ISL instead of adding its files to Polly. This also does not yet include the switch to small-integer optimized ISL nor enabling C99 mode required for the former. Those will come as well in separate patches. Differential version: http://reviews.llvm.org/D10603 Reviewers: grosser llvm-svn: 240301
* [cmake] Remove two unused include pathsTobias Grosser2015-05-061-5/+0
| | | | | | | These include paths are leftovers from times when we used GMP or an external isl installation. They are not longer needed. llvm-svn: 236596
* Drop libpluto supportTobias Grosser2015-03-301-8/+0
| | | | | | | | We do not have buildbots or anything that tests this functionality, hence it most likely bitrots. People interested to use this functionality can always recover it from svn history. llvm-svn: 233570
* Build the isl files as PICTobias Grosser2015-02-041-0/+3
| | | | | | Otherwise we get linker errors. llvm-svn: 228204
* Import isl(+imath) as an external library into PollyTobias Grosser2015-02-041-8/+20
| | | | | | | | | | | | | | | | | | | | | | With this patch Polly is always GPL-free (no dependency on GMP any more). As a result, building and distributing Polly will be easier. Furthermore, there is no need to tightly coordinate isl and Polly releases anymore. We import isl b3e0fa7a05d as well as imath 4d707e5ef2. These are the git versions Polly currently was tested with when using utils/checkout_isl.sh. The imported libraries are both MIT-style licensed. We build isl and imath with -fvisibility=hidden to avoid clashes in case other projects (such as gcc) use conflicting versions of isl. The use of imath can temporarily reduce compile-time performance of Polly. We will work on performance tuning in tree. Patches to isl should be contributed first to the main isl repository and can then later be reimported to Polly. This patch is also a prerequisite for the upcoming isl C++ interface. llvm-svn: 228193
* Drop Cloog supportJohannes Doerfert2014-12-021-13/+0
| | | | | | | | | This commit drops the Cloog support for Polly. The scripts and documentation are changed to only use isl as prerequisity. In the code all Cloog specific parts have been removed and all relevant tests have been ported to the isl backend when it was created. llvm-svn: 223141
* Added arcanist linters and cleaned errors and warningsJohannes Doerfert2014-08-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | Arcanist (arc) will now always run linters before uploading any new commit to Phabricator. All errors/warnings (or their absence) will be shown in the web interface together with a explanation by the commiter (arcanist will ask the commiter if the build was not clean). The linters include: - clang-format - spelling check - permissions check (aka. chmod) - filename check - merge conflict marker check Note, that their scope is sometimes limited (see .arclint for details). This commit also fixes all errors and warnings these linters reported, namely: - spelling mistakes and typos - executable permissions for various text files Differential Revision: http://reviews.llvm.org/D4916 llvm-svn: 215871
OpenPOWER on IntegriCloud