arcana-lab / noelle

NOELLE Offers Empowering LLVM Extensions
MIT License
72 stars 35 forks source link
compilers llvm optimization

NOELLE Offers Empowering LLVM Extensions

Active Development

Description

NOELLE provides abstractions to help build advanced code analyses and transformations for LLVM IR code. It is built upon SVF, SCAF, and LLVM.

We released NOELLE's source code in the hope of enriching the resources available to the research community and compiler developers. You are kindly asked to acknowledge usage of the tool by citing the following paper:

@inproceedings{NOELLE,
    title={{NOELLE} {O}ffers {E}mpowering {LL}VM {E}xtensions},
    author={Angelo Matni and Enrico Armenio Deiana and Yian Su and Lukas Gross and Souradip Ghosh and Sotiris Apostolakis and Ziyang Xu and Zujun Tan and Ishita Chaturvedi and David I. August and Simone Campanoni},
    booktitle={International Symposium on Code Generation and Optimization, 2022. CGO 2022.},
    year={2022}
}

The following material compose the documentation currently available:

Version

The latest stable version is 9.16.0 (tag = v9.16.0).

Version Numbering Scheme

The version number is in the form of [v Major.Minor.Revision ]

Update Frequency

Status

Next is the status of NOELLE for different LLVM versions.

LLVM NOELLE's branch SVF included SCAF included Working Maintained
18.1.6 v18 :x: :x: :x: :heavy_check_mark:
14.0.6 v14 :heavy_check_mark: :heavy_check_mark: :heavy_check_mark: :heavy_check_mark:
9.0.0 master :heavy_check_mark: :heavy_check_mark: :heavy_check_mark: :heavy_check_mark:

Prerequisites

LLVM 9.0.0

Northwestern users

Those who have access to the Zythos cluster at Northwestern can source LLVM 9.0.0 from any node of the cluster with:

source /project/extra/llvm/9.0.0/enable

Check out the Zythos cluster guide here for more.

Building and Installing

To build and install NOELLE you need to configure it first, unless the default configuration is satisfactory. From the root directory:

make menuconfig     # to customize the installation
make                # set the number of jobs with JOBS=8 (default is 16)

To build with any other generator, e.g. Ninja, use make GENERATOR=Ninja.

Testing

To run all tests, invoke the following commands:

cd tests
make clean    # optional but recommended
make

Uninstalling

To uninstall NOELLE, please run the following commands:

Run make uninstall to uninstall without cleaning the build files.

Run make clean to reset the repository to its initial state. For generality, the install directory is not removed.

Repository structure

NOELLE as an external project

NOELLE can be easily integrated your project with ExternalProject and FetchContent.

By using ExternalProject, cmake will download, compile and install the repository at build time. By the time you compile your project, NOELLE will be already installed.

include(ExternalProject)
ExternalProject_Add(
    noelle
    GIT_REPOSITORY  "https://github.com/arcana-lab/noelle.git"
    GIT_TAG         v9.16.0
    BUILD_COMMAND   ${CMAKE_COMMAND} --build . -j16
    INSTALL_COMMAND ${CMAKE_COMMAND} --install .
    CMAKE_ARGS
        -DCMAKE_INSTALL_PREFIX=${CMAKE_CURRENT_BINARY_DIR}/noelle
        -DNOELLE_SVF=OFF
        -DNOELLE_SCAF=OFF
)
include_directories(${CMAKE_CURRENT_BINARY_DIR}/noelle/include)

By using FetchContent, the repository will be made available as soon as cmake is run. your project and noelle will then be compiled as a single project.

include(FetchContent)
FetchContent_Declare(
    noelle
    GIT_REPOSITORY  "https://github.com/arcana-lab/noelle.git"
    GIT_TAG         v9.16.0
)
set(NOELLE_SVF OFF)
set(NOELLE_SCAF OFF)
FetchContent_MakeAvailable(noelle)
FetchContent_GetProperties(noelle)

# at this point noelle is available but NOT installed
include_directories(${noelle_SOURCE_DIR}/src/core/alloc_aa/include) # for example

Contributing

We welcome contributions from the community to improve this framework and evolve it to cater for more users.

NOELLE uses clang-format to ensure uniform styling across the project's source code. To format all .cpp and .hpp files in the repository run make format from the root. clang-format is run automatically as a pre-commit git hook, meaning that when you commit a file clang-format is automatically run on the file in-place.

Since git doesn't allow for git hooks to be installed when you clone the repository, cmake will install the pre-commit git hook upon installation.

If you have any trouble using this framework feel free to reach out to us for help (contact simone.campanoni@northwestern.edu).

License

NOELLE is licensed under the MIT License.