Skip to content

Commit

Permalink
Auto merge of #112671 - bjorn3:sync_cg_clif-2023-06-15, r=bjorn3
Browse files Browse the repository at this point in the history
Sync rustc_codegen_cranelift

The main highlights this time are a cranelift update, some x86 vendor intrinsic implementations and preparations for testing cg_clif in CI here.

r? `@ghost`

`@rustbot` label +A-codegen +A-cranelift +T-compiler
  • Loading branch information
bors committed Jun 15, 2023
2 parents 331249a + 8a120cc commit 114fb86
Show file tree
Hide file tree
Showing 57 changed files with 2,526 additions and 598 deletions.
8 changes: 4 additions & 4 deletions compiler/rustc_codegen_cranelift/.cirrus.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
task:
name: freebsd
freebsd_instance:
image: freebsd-13-1-release-amd64
image: freebsd-13-2-release-amd64
setup_rust_script:
- pkg install -y curl git bash
- pkg install -y git bash
- curl https://sh.rustup.rs -sSf --output rustup.sh
- sh rustup.sh --default-toolchain none -y --profile=minimal
target_cache:
folder: target
prepare_script:
- . $HOME/.cargo/env
- ./y.rs prepare
- ./y.sh prepare
test_script:
- . $HOME/.cargo/env
- ./y.rs test
- ./y.sh test
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@ jobs:
run: rustup set default-host x86_64-pc-windows-gnu

- name: Prepare dependencies
run: ./y.rs prepare
run: ./y.sh prepare

- name: Build
run: ./y.rs build --sysroot none
run: ./y.sh build --sysroot none

- name: Test abi-cafe
env:
TARGET_TRIPLE: ${{ matrix.env.TARGET_TRIPLE }}
run: ./y.rs abi-cafe
run: ./y.sh abi-cafe
60 changes: 45 additions & 15 deletions compiler/rustc_codegen_cranelift/.github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: Rustfmt
run: |
cargo fmt --check
rustfmt --check build_system/mod.rs
rustfmt --check build_system/main.rs
rustfmt --check example/*
Expand Down Expand Up @@ -91,22 +91,52 @@ jobs:
sudo apt-get install -y gcc-s390x-linux-gnu qemu-user
- name: Prepare dependencies
run: ./y.rs prepare
run: ./y.sh prepare

- name: Build
run: ./y.sh build --sysroot none

- name: Build without unstable features
- name: Test
env:
TARGET_TRIPLE: ${{ matrix.env.TARGET_TRIPLE }}
# This is the config rust-lang/rust uses for builds
run: ./y.rs build --no-unstable-features
run: ./y.sh test

- name: Build
run: ./y.rs build --sysroot none
- name: Install LLVM standard library
run: rustup target add ${{ matrix.env.TARGET_TRIPLE }}

- name: Test
# This is roughly config rust-lang/rust uses for testing
- name: Test with LLVM sysroot
# Skip native x86_64-pc-windows-gnu. It is way too slow and cross-compiled
# x86_64-pc-windows-gnu covers at least part of the tests.
if: matrix.os != 'windows-latest' || matrix.env.TARGET_TRIPLE != 'x86_64-pc-windows-gnu'
env:
TARGET_TRIPLE: ${{ matrix.env.TARGET_TRIPLE }}
run: ./y.rs test
run: ./y.sh test --sysroot llvm --no-unstable-features


# This job doesn't use cg_clif in any way. It checks that all cg_clif tests work with cg_llvm too.
test_llvm:
runs-on: ubuntu-latest
timeout-minutes: 60

defaults:
run:
shell: bash

steps:
- uses: actions/checkout@v3

- name: Prepare dependencies
run: ./y.rs prepare

- name: Disable JIT tests
run: |
sed -i 's/jit./#jit./' config.txt
- name: Test
env:
TARGET_TRIPLE: x86_64-unknown-linux-gnu
run: ./y.rs test --use-backend llvm

bench:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -135,13 +165,13 @@ jobs:
run: cargo install hyperfine || true

- name: Prepare dependencies
run: ./y.rs prepare
run: ./y.sh prepare

- name: Build
run: CI_OPT=1 ./y.rs build --sysroot none
run: CI_OPT=1 ./y.sh build --sysroot none

- name: Benchmark
run: CI_OPT=1 ./y.rs bench
run: CI_OPT=1 ./y.sh bench


dist:
Expand Down Expand Up @@ -194,13 +224,13 @@ jobs:
sudo apt-get install -y gcc-mingw-w64-x86-64 wine-stable
- name: Prepare dependencies
run: ./y.rs prepare
run: ./y.sh prepare

- name: Build backend
run: CI_OPT=1 ./y.rs build --sysroot none
run: CI_OPT=1 ./y.sh build --sysroot none

- name: Build sysroot
run: CI_OPT=1 ./y.rs build
run: CI_OPT=1 ./y.sh build

- name: Package prebuilt cg_clif
run: tar cvfJ cg_clif.tar.xz dist
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_codegen_cranelift/.github/workflows/rustc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('rust-toolchain', '**/Cargo.lock') }}

- name: Prepare dependencies
run: ./y.rs prepare
run: ./y.sh prepare

- name: Test
run: ./scripts/test_bootstrap.sh
Expand All @@ -38,7 +38,7 @@ jobs:
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('rust-toolchain', '**/Cargo.lock') }}

- name: Prepare dependencies
run: ./y.rs prepare
run: ./y.sh prepare

- name: Test
run: ./scripts/test_rustc_tests.sh
1 change: 1 addition & 0 deletions compiler/rustc_codegen_cranelift/.gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/target
/build_system/target
**/*.rs.bk
*.rlib
*.o
Expand Down
3 changes: 2 additions & 1 deletion compiler/rustc_codegen_cranelift/.vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@
"rust-analyzer.imports.granularity.enforce": true,
"rust-analyzer.imports.granularity.group": "module",
"rust-analyzer.imports.prefix": "crate",
"rust-analyzer.cargo.features": ["unstable-features", "__check_build_system_using_ra"],
"rust-analyzer.cargo.features": ["unstable-features"],
"rust-analyzer.linkedProjects": [
"./Cargo.toml",
"./build_system/Cargo.toml",
{
"crates": [
{
Expand Down
Loading

0 comments on commit 114fb86

Please sign in to comment.