This is an archive of the discontinued LLVM Phabricator instance.

Add isl to LLVM repository.
Needs ReviewPublic

Authored by Meinersbur on Nov 16 2017, 5:10 AM.

Details

Summary

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.

Decision rationales:

  • 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.

Diff Detail

Event Timeline

Meinersbur created this revision.Nov 16 2017, 5:10 AM
fhahn added a subscriber: fhahn.Nov 16 2017, 5:19 AM
maxf added a subscriber: maxf.Nov 16 2017, 6:14 AM
Eugene.Zelenko added inline comments.
lib/ISL/CMakeLists.txt
55

Please remove duplicated empty line.

90

Please remove duplicated empty line.

105

Please remove duplicated empty line.

120

Please remove duplicated empty line.

135

Please remove duplicated empty line.

152

Please remove duplicated empty line.

159

Please remove duplicated empty line.

285

Please remove duplicated empty line.

lib/ISL/isl_config.h.cmake
6

Please remove duplicated empty line.

18

Please remove duplicated empty line.

27

Please remove duplicated empty line.

36

Please remove duplicated empty line.

45

Please remove duplicated empty line.

Remove duplicated empty lines.

philip.pfaffe edited edge metadata.Nov 30 2017, 5:30 AM

I think this should be an RFC on llvm-dev. This needs a wider audience and a discussion that goes beyond the technical.

Meinersbur marked 13 inline comments as done.
Meinersbur edited the summary of this revision. (Show Details)
  • Include isl conditionally using LLVM_INCLUDE_ISL (defaults to OFF)
  • Fix include paths (llvm-config and install)
  • Use -w flag only for gcc/clang
Meinersbur edited the summary of this revision. (Show Details)Jan 15 2018, 8:26 AM
Meinersbur edited the summary of this revision. (Show Details)Jan 15 2018, 8:47 AM
Meinersbur retitled this revision from [WIP] Add isl to LLVM repository. to Add isl to LLVM repository..Jan 15 2018, 9:31 AM
bollu removed a reviewer: bollu.Jan 15 2021, 8:44 PM
Herald added a project: Restricted Project. · View Herald Transcript
contrib/isl-merge.py