Skip to content

Commit

Permalink
Update LLVM 19. (#763)
Browse files Browse the repository at this point in the history
* Update LLVM 19.

* update ffi.cpp

* remove unused ffi functions

* Make dependencies non-path-relative.

* change ci

* use lambda repos2

* update all ci

* use oficial deps

* upd readme

* update dockerfile

* update bench script

* relax libc version

* relax libc version

* remove ffi cpp code no longer needed

* remove ffi

* upd env.sh

---------

Co-authored-by: Edgar <[email protected]>
  • Loading branch information
azteca1998 and edg-l authored Sep 25, 2024
1 parent 0e96dff commit 6fb1fec
Show file tree
Hide file tree
Showing 18 changed files with 244 additions and 698 deletions.
52 changes: 26 additions & 26 deletions .github/workflows/bench-hyperfine.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ jobs:
runs-on: ubuntu-latest
env:
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
MLIR_SYS_180_PREFIX: /usr/lib/llvm-18/
TABLEGEN_180_PREFIX: /usr/lib/llvm-18/
LLVM_SYS_181_PREFIX: /usr/lib/llvm-18/
MLIR_SYS_190_PREFIX: /usr/lib/llvm-19/
TABLEGEN_190_PREFIX: /usr/lib/llvm-19/
LLVM_SYS_191_PREFIX: /usr/lib/llvm-19/
steps:
- uses: actions/checkout@v4
- name: check and free hdd space left
Expand Down Expand Up @@ -50,11 +50,11 @@ jobs:
- name: add llvm deb repository
uses: myci-actions/add-deb-repo@11
with:
repo: deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-18 main
repo: deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-19 main
repo-name: llvm-repo
keys-asc: https://apt.llvm.org/llvm-snapshot.gpg.key
- name: Install LLVM
run: sudo apt-get install llvm-18 llvm-18-dev llvm-18-runtime clang-18 clang-tools-18 lld-18 libpolly-18-dev libmlir-18-dev mlir-18-tools
run: sudo apt-get install llvm-19 llvm-19-dev llvm-19-runtime clang-19 clang-tools-19 lld-19 libpolly-19-dev libmlir-19-dev mlir-19-tools
- name: Install hyperfine
uses: taiki-e/install-action@v2
with:
Expand Down Expand Up @@ -86,12 +86,12 @@ jobs:
issue-number: ${{ github.event.pull_request.number }}
body-path: bench-hyperfine.md
edit-mode: replace

build-binaries:
env:
MLIR_SYS_180_PREFIX: /usr/lib/llvm-18/
LLVM_SYS_181_PREFIX: /usr/lib/llvm-18/
TABLEGEN_180_PREFIX: /usr/lib/llvm-18/
MLIR_SYS_190_PREFIX: /usr/lib/llvm-19/
LLVM_SYS_191_PREFIX: /usr/lib/llvm-19/
TABLEGEN_190_PREFIX: /usr/lib/llvm-19/
RUST_LOG: cairo_native=debug,cairo_native_test=debug
strategy:
matrix:
Expand All @@ -101,18 +101,18 @@ jobs:
steps:
- name: Cache binary
uses: actions/cache@v3
id: cache-binary
id: cache-binary
with:
path: bin/cairo-native-run-${{ matrix.branch }}
key: binary-${{ github.event.pull_request[matrix.branch].sha }}

- name: Cache runtime-library
uses: actions/cache@v3
id: cache-library
id: cache-library
with:
path: lib/libcairo-native-runtime-${{ matrix.branch }}.a
key: library-${{ github.event.pull_request[matrix.branch].sha }}
key: library-${{ github.event.pull_request[matrix.branch].sha }}

- name: check and free hdd space left
if: ${{ steps.cache-binary.outputs.cache-hit != 'true' }}
run: |
Expand All @@ -137,37 +137,37 @@ jobs:
- name: Install Rust
if: ${{ steps.cache-binary.outputs.cache-hit != 'true' || steps.cache-library.outputs.cache-hit != 'true' }}
uses: dtolnay/[email protected]

- name: add llvm deb repository
if: ${{ steps.cache-binary.outputs.cache-hit != 'true' || steps.cache-library.outputs.cache-hit != 'true' }}
uses: myci-actions/add-deb-repo@11
with:
repo: deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-18 main
repo: deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-19 main
repo-name: llvm-repo
keys-asc: https://apt.llvm.org/llvm-snapshot.gpg.key

- name: Install LLVM
if: ${{ steps.cache-binary.outputs.cache-hit != 'true' || steps.cache-library.outputs.cache-hit != 'true' }}
run: sudo apt-get update && sudo apt-get install llvm-18 llvm-18-dev llvm-18-runtime clang-18 clang-tools-18 lld-18 libpolly-18-dev libmlir-18-dev mlir-18-tools
run: sudo apt-get update && sudo apt-get install llvm-19 llvm-19-dev llvm-19-runtime clang-19 clang-tools-19 lld-19 libpolly-19-dev libmlir-19-dev mlir-19-tools

- name: Checkout base commit
if: ${{ steps.cache-binary.outputs.cache-hit != 'true' || steps.cache-library.outputs.cache-hit != 'true' }}
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request[matrix.branch].sha }}

- name: Fetch Rust cache
if: ${{ steps.cache-binary.outputs.cache-hit != 'true' || steps.cache-library.outputs.cache-hit != 'true' }}
uses: Swatinem/rust-cache@v2

- name: Build binary
if: ${{ steps.cache-binary.outputs.cache-hit != 'true' || steps.cache-library.outputs.cache-hit != 'true' }}
run: |
make build
mkdir lib bin
cp target/release/cairo-native-run bin/cairo-native-run-${{ matrix.branch }}
cp target/release/libcairo_native_runtime.a lib/libcairo-native-runtime-${{ matrix.branch }}.a
hyperfine-prs:
name: Bench PR (linux, amd64)
needs: [ build-binaries ]
Expand Down Expand Up @@ -219,10 +219,10 @@ jobs:
--export-markdown "${f%.*}.md" \
--export-json "${f%.*}.json" \
--warmup 3 \
-n "head $(basename $f) (JIT)" "./bin/cairo-native-run-head --run-mode=jit -s $f --opt-level 3 --available-gas 18446744073709551615" \
-n "base $(basename $f) (JIT)" "./bin/cairo-native-run-base --run-mode=jit -s $f --opt-level 3 --available-gas 18446744073709551615" \
-n "head $(basename $f) (AOT)" "CAIRO_NATIVE_RUNTIME_LIBRARY=lib/libcairo-native-runtime-head.a ./bin/cairo-native-run-head --run-mode=aot -s $f --opt-level 3 --available-gas 18446744073709551615" \
-n "base $(basename $f) (AOT)" "CAIRO_NATIVE_RUNTIME_LIBRARY=lib/libcairo-native-runtime-base.a ./bin/cairo-native-run-base --run-mode=aot -s $f --opt-level 3 --available-gas 18446744073709551615" \
-n "head $(basename $f) (JIT)" "./bin/cairo-native-run-head --run-mode=jit -s $f --opt-level 3 --available-gas 19446744073709551615" \
-n "base $(basename $f) (JIT)" "./bin/cairo-native-run-base --run-mode=jit -s $f --opt-level 3 --available-gas 19446744073709551615" \
-n "head $(basename $f) (AOT)" "CAIRO_NATIVE_RUNTIME_LIBRARY=lib/libcairo-native-runtime-head.a ./bin/cairo-native-run-head --run-mode=aot -s $f --opt-level 3 --available-gas 19446744073709551615" \
-n "base $(basename $f) (AOT)" "CAIRO_NATIVE_RUNTIME_LIBRARY=lib/libcairo-native-runtime-base.a ./bin/cairo-native-run-base --run-mode=aot -s $f --opt-level 3 --available-gas 19446744073709551615" \
>> /dev/stderr
done
- name: Print tables
Expand All @@ -243,7 +243,7 @@ jobs:
issue-number: ${{ github.event.pull_request.number }}
comment-author: "github-actions[bot]"
body-includes: Benchmarking

- name: Create or update bench comment
continue-on-error: true
uses: peter-evans/create-or-update-comment@v4
Expand Down
46 changes: 23 additions & 23 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ jobs:
name: clippy
runs-on: ubuntu-latest
env:
MLIR_SYS_180_PREFIX: /usr/lib/llvm-18/
LLVM_SYS_181_PREFIX: /usr/lib/llvm-18/
TABLEGEN_180_PREFIX: /usr/lib/llvm-18/
MLIR_SYS_190_PREFIX: /usr/lib/llvm-19/
LLVM_SYS_191_PREFIX: /usr/lib/llvm-19/
TABLEGEN_190_PREFIX: /usr/lib/llvm-19/
steps:
- uses: actions/checkout@v4
- uses: dtolnay/[email protected]
Expand All @@ -28,11 +28,11 @@ jobs:
- name: add llvm deb repository
uses: myci-actions/add-deb-repo@11
with:
repo: deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-18 main
repo: deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-19 main
repo-name: llvm-repo
keys-asc: https://apt.llvm.org/llvm-snapshot.gpg.key
- name: Install LLVM
run: sudo apt-get install llvm-18 llvm-18-dev llvm-18-runtime clang-18 clang-tools-18 lld-18 libpolly-18-dev libmlir-18-dev mlir-18-tools
run: sudo apt-get install llvm-19 llvm-19-dev llvm-19-runtime clang-19 clang-tools-19 lld-19 libpolly-19-dev libmlir-19-dev mlir-19-tools
- name: Clippy
run: make check

Expand Down Expand Up @@ -83,9 +83,9 @@ jobs:
udeps:
runs-on: ubuntu-latest
env:
MLIR_SYS_180_PREFIX: /usr/lib/llvm-18/
LLVM_SYS_181_PREFIX: /usr/lib/llvm-18/
TABLEGEN_180_PREFIX: /usr/lib/llvm-18/
MLIR_SYS_190_PREFIX: /usr/lib/llvm-19/
LLVM_SYS_191_PREFIX: /usr/lib/llvm-19/
TABLEGEN_190_PREFIX: /usr/lib/llvm-19/
RUSTUP_TOOLCHAIN: nightly # udeps needs nightly
steps:
- uses: actions/checkout@v4
Expand All @@ -97,11 +97,11 @@ jobs:
- name: add llvm deb repository
uses: myci-actions/add-deb-repo@11
with:
repo: deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-18 main
repo: deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-19 main
repo-name: llvm-repo
keys-asc: https://apt.llvm.org/llvm-snapshot.gpg.key
- name: Install LLVM
run: sudo apt-get install llvm-18 llvm-18-dev llvm-18-runtime clang-18 clang-tools-18 lld-18 libpolly-18-dev libmlir-18-dev mlir-18-tools
run: sudo apt-get install llvm-19 llvm-19-dev llvm-19-runtime clang-19 clang-tools-19 lld-19 libpolly-19-dev libmlir-19-dev mlir-19-tools
- name: "Download and run cargo-udeps"
run: |
wget -O - -c https://github.com/est31/cargo-udeps/releases/download/v0.1.50/cargo-udeps-v0.1.50-x86_64-unknown-linux-gnu.tar.gz | tar -xz
Expand All @@ -111,9 +111,9 @@ jobs:
name: test (linux, amd64)
runs-on: ubuntu-latest
env:
MLIR_SYS_180_PREFIX: /usr/lib/llvm-18/
LLVM_SYS_181_PREFIX: /usr/lib/llvm-18/
TABLEGEN_180_PREFIX: /usr/lib/llvm-18/
MLIR_SYS_190_PREFIX: /usr/lib/llvm-19/
LLVM_SYS_191_PREFIX: /usr/lib/llvm-19/
TABLEGEN_190_PREFIX: /usr/lib/llvm-19/
RUST_LOG: cairo_native=debug,cairo_native_test=debug
steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -143,12 +143,12 @@ jobs:
- name: add llvm deb repository
uses: myci-actions/add-deb-repo@11
with:
repo: deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-18 main
repo: deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-19 main
repo-name: llvm-repo
keys-asc: https://apt.llvm.org/llvm-snapshot.gpg.key
- run: sudo apt-get update && sudo apt-get upgrade -y
- name: Install LLVM
run: sudo apt-get install llvm-18 llvm-18-dev llvm-18-runtime clang-18 clang-tools-18 lld-18 libpolly-18-dev libmlir-18-dev mlir-18-tools
run: sudo apt-get install llvm-19 llvm-19-dev llvm-19-runtime clang-19 clang-tools-19 lld-19 libpolly-19-dev libmlir-19-dev mlir-19-tools
- name: Install deps
run: make deps
- name: Build cairo-native-runtime library.
Expand All @@ -164,9 +164,9 @@ jobs:
env:
CARGO_TERM_COLOR: always
LIBRARY_PATH: /opt/homebrew/lib
MLIR_SYS_180_PREFIX: /opt/homebrew/opt/llvm@18
LLVM_SYS_181_PREFIX: /opt/homebrew/opt/llvm@18
TABLEGEN_180_PREFIX: /opt/homebrew/opt/llvm@18
MLIR_SYS_190_PREFIX: /opt/homebrew/opt/llvm@19
LLVM_SYS_191_PREFIX: /opt/homebrew/opt/llvm@19
TABLEGEN_190_PREFIX: /opt/homebrew/opt/llvm@19
RUST_LOG: cairo_native=debug,cairo_native_test=debug
steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -207,9 +207,9 @@ jobs:
output: lcov-4.info
env:
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
MLIR_SYS_180_PREFIX: /usr/lib/llvm-18/
LLVM_SYS_181_PREFIX: /usr/lib/llvm-18/
TABLEGEN_180_PREFIX: /usr/lib/llvm-18/
MLIR_SYS_190_PREFIX: /usr/lib/llvm-19/
LLVM_SYS_191_PREFIX: /usr/lib/llvm-19/
TABLEGEN_190_PREFIX: /usr/lib/llvm-19/
RUST_LOG: cairo_native=debug
steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -239,11 +239,11 @@ jobs:
- name: add llvm deb repository
uses: myci-actions/add-deb-repo@11
with:
repo: deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-18 main
repo: deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-19 main
repo-name: llvm-repo
keys-asc: https://apt.llvm.org/llvm-snapshot.gpg.key
- name: Install LLVM
run: sudo apt-get install llvm-18 llvm-18-dev llvm-18-runtime clang-18 clang-tools-18 lld-18 libpolly-18-dev libmlir-18-dev mlir-18-tools
run: sudo apt-get install llvm-19 llvm-19-dev llvm-19-runtime clang-19 clang-tools-19 lld-19 libpolly-19-dev libmlir-19-dev mlir-19-tools
- name: Install testing tools
uses: taiki-e/install-action@v2
with:
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ jobs:
release:
runs-on: ubuntu-latest
env:
MLIR_SYS_180_PREFIX: /usr/lib/llvm-18/
LLVM_SYS_181_PREFIX: /usr/lib/llvm-18/
TABLEGEN_180_PREFIX: /usr/lib/llvm-18/
MLIR_SYS_190_PREFIX: /usr/lib/llvm-19/
LLVM_SYS_191_PREFIX: /usr/lib/llvm-19/
TABLEGEN_190_PREFIX: /usr/lib/llvm-19/
CRATES_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
steps:
- name: Checkout
Expand All @@ -32,11 +32,11 @@ jobs:
- name: add llvm deb repository
uses: myci-actions/add-deb-repo@11
with:
repo: deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-18 main
repo: deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-19 main
repo-name: llvm-repo
keys-asc: https://apt.llvm.org/llvm-snapshot.gpg.key
- name: Install LLVM
run: sudo apt-get install llvm-18 llvm-18-dev llvm-18-runtime clang-18 clang-tools-18 lld-18 libpolly-18-dev libmlir-18-dev mlir-18-tools
run: sudo apt-get install llvm-19 llvm-19-dev llvm-19-runtime clang-19 clang-tools-19 lld-19 libpolly-19-dev libmlir-19-dev mlir-19-tools
- name: publish the runtime
run: cargo publish --token ${CRATES_TOKEN} --all-features -p cairo-native-runtime
- name: publish the crate
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ jobs:
release:
runs-on: ubuntu-latest
env:
MLIR_SYS_180_PREFIX: /usr/lib/llvm-18/
LLVM_SYS_181_PREFIX: /usr/lib/llvm-18/
TABLEGEN_180_PREFIX: /usr/lib/llvm-18/
MLIR_SYS_190_PREFIX: /usr/lib/llvm-19/
LLVM_SYS_191_PREFIX: /usr/lib/llvm-19/
TABLEGEN_190_PREFIX: /usr/lib/llvm-19/
steps:
- name: Checkout
uses: actions/checkout@v3
Expand All @@ -31,11 +31,11 @@ jobs:
- name: add llvm deb repository
uses: myci-actions/add-deb-repo@11
with:
repo: deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-18 main
repo: deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-19 main
repo-name: llvm-repo
keys-asc: https://apt.llvm.org/llvm-snapshot.gpg.key
- name: Install LLVM
run: sudo apt-get install llvm-18 llvm-18-dev llvm-18-runtime clang-18 clang-tools-18 lld-18 libpolly-18-dev libmlir-18-dev mlir-18-tools
run: sudo apt-get install llvm-19 llvm-19-dev llvm-19-runtime clang-19 clang-tools-19 lld-19 libpolly-19-dev libmlir-19-dev mlir-19-tools
- name: build release
run: make build
- name: Release
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/rustdoc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,21 @@ jobs:
name: GitHub Pages
runs-on: ubuntu-latest
env:
MLIR_SYS_180_PREFIX: /usr/lib/llvm-18/
LLVM_SYS_181_PREFIX: /usr/lib/llvm-18/
TABLEGEN_180_PREFIX: /usr/lib/llvm-18/
MLIR_SYS_190_PREFIX: /usr/lib/llvm-19/
LLVM_SYS_191_PREFIX: /usr/lib/llvm-19/
TABLEGEN_190_PREFIX: /usr/lib/llvm-19/
steps:
- uses: actions/checkout@v4
- uses: dtolnay/[email protected]
- uses: Swatinem/rust-cache@v2
- name: add llvm deb repository
uses: myci-actions/add-deb-repo@11
with:
repo: deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-18 main
repo: deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-19 main
repo-name: llvm-repo
keys-asc: https://apt.llvm.org/llvm-snapshot.gpg.key
- name: Install LLVM
run: sudo apt-get install llvm-18 llvm-18-dev llvm-18-runtime clang-18 clang-tools-18 lld-18 libpolly-18-dev libmlir-18-dev mlir-18-tools
run: sudo apt-get install llvm-19 llvm-19-dev llvm-19-runtime clang-19 clang-tools-19 lld-19 libpolly-19-dev libmlir-19-dev mlir-19-tools
- name: Build docs
run: make doc
- name: Deploy Documentation
Expand Down
Loading

0 comments on commit 6fb1fec

Please sign in to comment.