Skip to content

Commit d1c2a82

Browse files
cgh-qtnmjake-arkinstallaborgna-q
authored
feat!: Upgrade LLVM code in tket-qsystem and qis-compiler (#1422)
BREAKING CHANGE: The hugr-llvm LLVM version is being upgraded to 21.1, and code that depends on it here needs to be updated as well. This also includes an MSRV change to 1.91 to match hugr. See [the hugr PR](Quantinuum/hugr#2901) for details. Closes #1421 --------- Co-authored-by: Jake Arkinstall <65358059+jake-arkinstall@users.noreply.github.com> Co-authored-by: Agustín Borgna <agustin.borgna@quantinuum.com>
1 parent 82495c1 commit d1c2a82

247 files changed

Lines changed: 6542 additions & 5856 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci.yml

Lines changed: 38 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,9 @@ env:
2626

2727
# different strings for install action and feature name
2828
# adapted from https://github.com/TheDan64/inkwell/blob/master/.github/workflows/test.yml
29-
LLVM_VERSION: "14.0"
30-
LLVM_FEATURE_NAME: "14-0"
29+
LLVM_MAIN_VERSION: "21"
30+
LLVM_VERSION: "21.1"
31+
LLVM_FEATURE_NAME: "21-1"
3132

3233
# Path to the cached tket-c-api library
3334
# When this envvar is set, the `./.github/actions/tket-c-api` action **must** be run to fetch the artifacts
@@ -76,9 +77,11 @@ jobs:
7677
- name: Check formatting
7778
run: cargo fmt -- --check
7879
- name: Install LLVM and Clang
79-
uses: KyleMayes/install-llvm-action@v2
80-
with:
81-
version: ${{ env.LLVM_VERSION }}
80+
run: |
81+
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
82+
sudo add-apt-repository 'deb http://apt.llvm.org/noble/ llvm-toolchain-noble-${{ env.LLVM_MAIN_VERSION }} main'
83+
sudo apt update
84+
sudo apt install llvm-${{ env.LLVM_MAIN_VERSION }} libpolly-${{ env.LLVM_MAIN_VERSION }}-dev
8285
- name: Run clippy
8386
run: cargo clippy --all-targets --all-features --workspace -- -D warnings
8487
- name: Build docs
@@ -102,10 +105,11 @@ jobs:
102105
version: ${{ env.UV_VERSION }}
103106
enable-cache: true
104107
- name: Install LLVM and Clang
105-
uses: KyleMayes/install-llvm-action@v2
106-
with:
107-
version: ${{ env.LLVM_VERSION }}
108-
directory: ${{ runner.temp }}/llvm
108+
run: |
109+
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
110+
sudo add-apt-repository 'deb http://apt.llvm.org/noble/ llvm-toolchain-noble-${{ env.LLVM_MAIN_VERSION }} main'
111+
sudo apt update
112+
sudo apt install llvm-${{ env.LLVM_MAIN_VERSION }} libpolly-${{ env.LLVM_MAIN_VERSION }}-dev
109113
- name: Install tket-c-api library
110114
uses: ./.github/actions/tket-c-api
111115
with:
@@ -193,9 +197,11 @@ jobs:
193197
- name: Configure default rust toolchain
194198
run: rustup override set ${{steps.toolchain.outputs.name}}
195199
- name: Install LLVM and Clang
196-
uses: KyleMayes/install-llvm-action@v2
197-
with:
198-
version: ${{ env.LLVM_VERSION }}
200+
run: |
201+
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
202+
sudo add-apt-repository 'deb http://apt.llvm.org/noble/ llvm-toolchain-noble-${{ env.LLVM_MAIN_VERSION }} main'
203+
sudo apt update
204+
sudo apt install llvm-${{ env.LLVM_MAIN_VERSION }} libpolly-${{ env.LLVM_MAIN_VERSION }}-dev
199205
- name: Install tket-c-api library
200206
uses: ./.github/actions/tket-c-api
201207
with:
@@ -227,9 +233,11 @@ jobs:
227233
with:
228234
toolchain: ${{ matrix.rust }}
229235
- name: Install LLVM and Clang
230-
uses: KyleMayes/install-llvm-action@v2
231-
with:
232-
version: ${{ env.LLVM_VERSION }}
236+
run: |
237+
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
238+
sudo add-apt-repository 'deb http://apt.llvm.org/noble/ llvm-toolchain-noble-${{ env.LLVM_MAIN_VERSION }} main'
239+
sudo apt update
240+
sudo apt install llvm-${{ env.LLVM_MAIN_VERSION }} libpolly-${{ env.LLVM_MAIN_VERSION }}-dev
233241
- name: Install tket-c-api library
234242
uses: ./.github/actions/tket-c-api
235243
with:
@@ -261,9 +269,11 @@ jobs:
261269
toolchain: "nightly"
262270
components: llvm-tools-preview
263271
- name: Install LLVM and Clang
264-
uses: KyleMayes/install-llvm-action@v2
265-
with:
266-
version: ${{ env.LLVM_VERSION }}
272+
run: |
273+
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
274+
sudo add-apt-repository 'deb http://apt.llvm.org/noble/ llvm-toolchain-noble-${{ env.LLVM_MAIN_VERSION }} main'
275+
sudo apt update
276+
sudo apt install llvm-${{ env.LLVM_MAIN_VERSION }} libpolly-${{ env.LLVM_MAIN_VERSION }}-dev
267277
- name: Install tket-c-api library
268278
uses: ./.github/actions/tket-c-api
269279
with:
@@ -308,9 +318,11 @@ jobs:
308318
- name: Configure default rust toolchain
309319
run: rustup override set ${{steps.toolchain.outputs.name}}
310320
- name: Install LLVM and Clang
311-
uses: KyleMayes/install-llvm-action@v2
312-
with:
313-
version: ${{ env.LLVM_VERSION }}
321+
run: |
322+
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
323+
sudo add-apt-repository 'deb http://apt.llvm.org/noble/ llvm-toolchain-noble-${{ env.LLVM_MAIN_VERSION }} main'
324+
sudo apt update
325+
sudo apt install llvm-${{ env.LLVM_MAIN_VERSION }} libpolly-${{ env.LLVM_MAIN_VERSION }}-dev
314326
- name: Install tket-c-api library
315327
uses: ./.github/actions/tket-c-api
316328
with:
@@ -391,9 +403,11 @@ jobs:
391403
version: ${{ env.UV_VERSION }}
392404
enable-cache: true
393405
- name: Install LLVM and Clang
394-
uses: KyleMayes/install-llvm-action@v2
395-
with:
396-
version: ${{ env.LLVM_VERSION }}
406+
run: |
407+
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
408+
sudo add-apt-repository 'deb http://apt.llvm.org/noble/ llvm-toolchain-noble-${{ env.LLVM_MAIN_VERSION }} main'
409+
sudo apt update
410+
sudo apt install llvm-${{ env.LLVM_MAIN_VERSION }} libpolly-${{ env.LLVM_MAIN_VERSION }}-dev
397411
- name: Install Python ${{ env.PYTHON_LOWEST }}
398412
run: uv python install ${{ env.PYTHON_LOWEST }}
399413
- name: Run qis-compiler tests

.github/workflows/python-qis-wheels.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ jobs:
4646
matrix:
4747
os:
4848
- ubuntu-latest
49-
- ubuntu-24.04-arm
49+
# TODO: Temporarily disabled until we create a manylinux_2_28 compatible docker image for ARM with LLVM 21.
50+
#- ubuntu-24.04-arm
5051
- macos-15
5152
- macos-15-intel
5253
- windows-2022

.github/workflows/python-wheels.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,9 @@ env:
3333
RUSTC_WRAPPER: "sccache"
3434
# different strings for install action and feature name
3535
# adapted from https://github.com/TheDan64/inkwell/blob/master/.github/workflows/test.yml
36-
LLVM_VERSION: "14.0"
37-
LLVM_FEATURE_NAME: "14-0"
36+
LLVM_MAIN_VERSION: "21"
37+
LLVM_VERSION: "21.1"
38+
LLVM_FEATURE_NAME: "21-1"
3839

3940
jobs:
4041
# Check if the tag matches the package name,
@@ -123,9 +124,11 @@ jobs:
123124
version: ${{ env.UV_VERSION }}
124125
enable-cache: true
125126
- name: Install LLVM and Clang
126-
uses: KyleMayes/install-llvm-action@v2
127-
with:
128-
version: ${{ env.LLVM_VERSION }}
127+
run: |
128+
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
129+
sudo add-apt-repository 'deb http://apt.llvm.org/noble/ llvm-toolchain-noble-${{ env.LLVM_MAIN_VERSION }} main'
130+
sudo apt update
131+
sudo apt install llvm-${{ env.LLVM_MAIN_VERSION }} libpolly-${{ env.LLVM_MAIN_VERSION }}-dev
129132
130133
# Set the path to the cached tket-c-api library
131134
# When this envvar is set, the `./.github/actions/tket-c-api` action **must** be run to fetch the artifacts

.github/workflows/unsoundness.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,9 @@ env:
2323

2424
# different strings for install action and feature name
2525
# adapted from https://github.com/TheDan64/inkwell/blob/master/.github/workflows/test.yml
26-
LLVM_VERSION: "14.0"
27-
LLVM_FEATURE_NAME: "14-0"
26+
LLVM_MAIN_VERSION: "21"
27+
LLVM_VERSION: "21.1"
28+
LLVM_FEATURE_NAME: "21-1"
2829

2930
# Path to the cached tket-c-api library
3031
# When this envvar is set, the `./.github/actions/tket-c-api` action **must** be run to fetch the artifacts
@@ -46,9 +47,11 @@ jobs:
4647
rustup override set nightly
4748
cargo miri setup
4849
- name: Install LLVM and Clang
49-
uses: KyleMayes/install-llvm-action@v2
50-
with:
51-
version: ${{ env.LLVM_VERSION }}
50+
run: |
51+
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
52+
sudo add-apt-repository 'deb http://apt.llvm.org/noble/ llvm-toolchain-noble-${{ env.LLVM_MAIN_VERSION }} main'
53+
sudo apt update
54+
sudo apt install llvm-${{ env.LLVM_MAIN_VERSION }} libpolly-${{ env.LLVM_MAIN_VERSION }}-dev
5255
- name: Install tket-c-api library
5356
uses: ./.github/actions/tket-c-api
5457
with:

0 commit comments

Comments
 (0)