Add the integer set library ("isl", http://isl.gforge.inria.fr, MIT-licensed) into the contrib/isl directory and add a new component "LLVMISL".
The integer set library contains functions for polyhedral (integer and rational) vector sets and program transformations. Polly uses it to implement its analysis and optimization. The isl source is already included in Polly (in lib/External/isl) and this patch is derived from that. For upstreaming Polly into the main LLVM repository, it is necessary to include isl as well.
This is marked as Work-In-Progress; depending on feedback given the following might be added:
- An option to use the isl installed on the host system
- Polly requires an additional header file isl-noexecptions.h which is a C++ wrapper around isl's C API. It is generated from the public headers using a python script by make dist. However, vanilla isl only generates a version that does not contain all functionality required by Polly. We are working upstream to change that, but in the meantime Polly comes with its own isl-noexceptions.h, i.e. Polly keeps a slightly modified version of isl that requires merging ("merging" here means that we just discard isl's isl-noexceptions.h und use Polly's). I did not integrate this file in this patch, we can either maintain a slightly modified version of isl, or put our custom isl-noexceptions.h in a different folder.
- The library is named LLVMISL and contained in the lib/ISL folder to work best with LLVM's component system. The component's name "ISL" was chosen over "isl" as it matches the capitalization of other two/three-letter-acronym components.
- Isl's headers are installed into $PREFIX/include/llvm/ISL/isl. This is to not conflict with potentially user/system-installed isl headers. Please note that this means that MIT-licensed headers land on the target system.
- The source of isl itself is added to the contrib/isl directory. This is to keep the source in one directory rather than spreading it into the lib and include directories, facilitating integration of upstream changes. There is a script "isl-merge.py" that automates this. It currently requires LLVM being checked out using git. The new subfolder "contrib" should make it clear that this is downstream code and maybe one shouldn't run clang-format over it which would make the next merge difficult.
- There is an additional "GIT_HEAD_ID" file containing the upstream's revision. It is used by isl-merge.py to determine the common ancestor and CMakeLists.txt to determine the version. Normally isl's make dist would generate this file, it is done manually here to not require a configure/make/make dist cycle when merging the latest isl. Due to different Autotools versions being installed on the different systems, this might lead to spurious conflicts with the generated configure etc. files. However, due to the need of an isl-noexeceptions.h, I may need to include such a cycle in isl-merge.py anyway.
- Isl has its own unittest "isl_test.c". It is put into bin/ (but not installed) and run by llvm-lit on llvm-check. This was just the simplest to do since it doesn't require any additional lit.site.cfg in order to find the isl_test in a different directory.