acc2bd3f83
Only the innermost scf.parallel is allowed to contain barrier though. Otherwise, we need a mechanism to recursively create local CFGs and inline them into parent regions. |
||
---|---|---|
.github/workflows | ||
cmake/modules | ||
include | ||
lib | ||
llvm-project@9b6c8132d3 | ||
mlir-clang | ||
.clang-format | ||
.clang-tidy | ||
.git-blame-ignore-revs | ||
.gitignore | ||
.gitmodules | ||
AddClang.cmake | ||
CMakeLists.txt | ||
README.md |
README.md
Build instructions
Requirements
- Working C and C++ toolchains(compiler, linker)
- cmake
- make or ninja
0. Clone Polygeist
git clone --recursive https://github.com/wsmoses/Polygeist.git
cd Polygeist
1. Install LLVM, MLIR, Clang, and Polygeist
Option 1: Using pre-built LLVM, MLIR, and Clang
Polygeist can be built by providing paths to a pre-built MLIR and Clang toolchain.
- Build LLVM, MLIR, and Clang:
mkdir llvm-project/build
cd llvm-project/build
cmake -G Ninja ../llvm \
-DLLVM_ENABLE_PROJECTS="mlir;clang" \
-DLLVM_TARGETS_TO_BUILD="host" \
-DLLVM_ENABLE_ASSERTIONS=ON \
-DCMAKE_BUILD_TYPE=DEBUG
ninja
ninja check-mlir
- Build Polygeist:
mkdir build
cd build
cmake -G Ninja .. \
-DMLIR_DIR=$PWD/../llvm-project/build/lib/cmake/mlir \
-DCLANG_DIR=$PWD/../llvm-project/build/lib/cmake/clang \
-DLLVM_TARGETS_TO_BUILD="host" \
-DLLVM_ENABLE_ASSERTIONS=ON \
-DCMAKE_BUILD_TYPE=DEBUG
ninja
ninja check-mlir-clang
Option 2: Using unified LLVM, MLIR, Clang, and Polygeist build
Polygeist can also be built as an external LLVM project using LLVM_EXTERNAL_PROJECTS.
- Build LLVM, MLIR, Clang, and Polygeist:
mkdir build
cd build
cmake -G Ninja ../llvm-project/llvm \
-DLLVM_ENABLE_PROJECTS="clang;mlir" \
-DLLVM_EXTERNAL_PROJECTS="polygeist" \
-DLLVM_EXTERNAL_POLYGEIST_SOURCE_DIR=.. \
-DLLVM_TARGETS_TO_BUILD="host" \
-DLLVM_ENABLE_ASSERTIONS=ON \
-DCMAKE_BUILD_TYPE=DEBUG
ninja
ninja check-mlir-clang