-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Nico Reissmann <[email protected]>
- Loading branch information
Showing
8 changed files
with
631 additions
and
4 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
name: "Build MLIR RVSDG Dialect" | ||
description: "Restore MLIR RVSDG Dialect from cache and build if it's not in there" | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: "Clone MLIR RVSDG dialect" | ||
run: git clone https://github.com/EECS-NTNU/mlir_rvsdg.git ${{ github.workspace }}/mlir-rvsdg | ||
shell: bash | ||
|
||
- name: "Extract the hash for latest commit for use in the cache key" | ||
id: get-mlir-hash | ||
run: | | ||
cd ${{ github.workspace }}/mlir-rvsdg | ||
echo "hash=$(git rev-parse main)" >> $GITHUB_OUTPUT | ||
shell: bash | ||
|
||
- name: "Try to fetch Dialect from the cache" | ||
id: cache-mlir | ||
uses: actions/cache@v4 | ||
with: | ||
path: | | ||
${{ github.workspace }}/lib/mlir-rvsdg | ||
key: ${{ runner.os }}-mlir-${{ steps.get-mlir-hash.outputs.hash }} | ||
|
||
- name: "Install LLVM and Clang" | ||
uses: ./.github/actions/InstallLlvmDependencies | ||
|
||
- name: "Build MLIR RVSDG Dialect if we didn't hit in the cache" | ||
if: steps.cache-mlir.outputs.cache-hit != 'true' | ||
run: | | ||
cd ${{ github.workspace }}/mlir-rvsdg | ||
git checkout 6bfb270607f35b787bc849182f184e83548aa404 | ||
mkdir build | ||
cd build | ||
cmake -G Ninja .. \ | ||
-DCMAKE_C_COMPILER=clang-16 \ | ||
-DCMAKE_CXX_COMPILER=clang++-16 \ | ||
-DLLVM_DIR=/usr/lib/llvm-16/cmake/ \ | ||
-DMLIR_DIR=/usr/lib/llvm-16/lib/cmake/mlir \ | ||
-DCMAKE_INSTALL_PREFIX=../../lib/mlir-rvsdg | ||
cmake --build . | ||
ninja install | ||
shell: bash | ||
|
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Copyright 2024 Magnus Sjalander <[email protected]> | ||
# See COPYING for terms of redistribution. | ||
|
||
libmlir_SOURCES = \ | ||
jlm/mlir/frontend/MlirToJlmConverter.cpp \ | ||
|
||
libmlir_HEADERS = \ | ||
jlm/mlir/frontend/MlirToJlmConverter.hpp \ | ||
|
||
libmlir_TESTS += \ | ||
tests/jlm/mlir/frontend/TestMlirToJlmConverter \ | ||
|
||
libmlir_TEST_LIBS += \ | ||
libmlir \ | ||
libllvm \ | ||
librvsdg \ | ||
libutil \ | ||
libjlmtest \ | ||
|
||
libmlir_TEST_EXTRA_LDFLAGS = \ | ||
$(shell $(LLVMCONFIG) --ldflags --libs --system-libs) \ | ||
-L$(MLIR_PATH)/lib \ | ||
-lMLIR \ | ||
-lMLIRJLM \ | ||
-lMLIRRVSDG \ | ||
|
||
$(eval $(call common_library,libmlir)) |
Oops, something went wrong.