bump llvm #186
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: LLVM Build | |
| on: | |
| workflow_dispatch: | |
| push: | |
| paths: | |
| - cmake/llvm-version.txt | |
| - cmake/llvm-version-imex.txt | |
| - .github/workflows/build-llvm.yml | |
| permissions: read-all | |
| jobs: | |
| build: | |
| name: Build | |
| runs-on: [self-hosted] | |
| strategy: | |
| matrix: | |
| build-type: [CPU, IMEX] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set LLVM hash | |
| run: | | |
| if [ "${{ matrix.build-type }}" = "IMEX" ]; then | |
| echo LLVM_HASH=$(cat cmake/llvm-version-imex.txt) >>$GITHUB_ENV | |
| echo IMEX_HASH=$(cat cmake/imex-version.txt) >>$GITHUB_ENV | |
| else | |
| echo LLVM_HASH=$(cat cmake/llvm-version.txt) >>$GITHUB_ENV | |
| fi | |
| - uses: actions/checkout@v4 | |
| with: | |
| repository: intel/mlir-extensions | |
| ref: ${{ env.IMEX_HASH }} | |
| path: mlir-extensions | |
| if: ${{ matrix.build-type == 'IMEX' }} | |
| - uses: actions/checkout@v4 | |
| with: | |
| repository: llvm/llvm-project | |
| ref: ${{ env.LLVM_HASH }} | |
| path: llvm-project | |
| - name: Build | |
| run: | | |
| cd llvm-project | |
| if [ "${{ matrix.build-type }}" = "IMEX" ]; then | |
| git apply ../mlir-extensions/build_tools/patches/* | |
| fi | |
| python3 -m pip install -r mlir/python/requirements.txt | |
| mkdir llvm-install | |
| cmake -G Ninja llvm -B build -DCMAKE_INSTALL_PREFIX=llvm-install -DMLIR_ENABLE_BINDINGS_PYTHON=ON -DPython3_EXECUTABLE=$(which python3) \ | |
| -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_ASSERTIONS=true -DLLVM_ENABLE_PROJECTS="mlir" -DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD="SPIRV" -DLLVM_TARGETS_TO_BUILD="X86" -DLLVM_INSTALL_UTILS=true -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DLLVM_INSTALL_GTEST=ON | |
| cmake --build build --target install | |
| cd llvm-install | |
| tar -zcf ../llvm.tgz . | |
| - name: Upload LLVM for CPU | |
| if: matrix.build-type == 'CPU' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: llvm-${{ env.LLVM_HASH }} | |
| path: ./llvm-project/llvm.tgz | |
| - name: Upload LLVM for IMEX | |
| if: matrix.build-type == 'IMEX' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: llvm-${{ env.LLVM_HASH }}-imex-patched | |
| path: ./llvm-project/llvm.tgz | |