Skip to content

Sync rustc_codegen_cranelift #105713

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 101 commits into from
Dec 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
101 commits
Select commit Hold shift + click to select a range
31792f1
Auto merge of #2583 - RalfJung:rustup, r=oli-obk
bors Oct 8, 2022
55fe2b3
merge rustc history
RalfJung Oct 9, 2022
1e720cd
merge rustc history
RalfJung Oct 21, 2022
9950bd1
Merge commit '266e96785ab71834b917bf474f130a6d8fdecd4b' into sync_cg_…
bjorn3 Oct 23, 2022
4029785
Merge branch 'sync_from_rust'
bjorn3 Oct 23, 2022
63d1bf9
Rustfmt cg_clif's build system
bjorn3 Oct 23, 2022
b345c1e
Sync from rust 1481fd964bac3c750c7e1b21206fdaa60346c456
bjorn3 Oct 24, 2022
e3311e4
Support raw-dylib functions being used inside inlined functions
dpaoliello Oct 12, 2022
5e18725
Auto merge of #103392 - RalfJung:miri, r=oli-obk
bors Oct 25, 2022
43d3e92
Check build system formatting on CI
bjorn3 Oct 26, 2022
33a92bc
Update tooling
WaffleLapkin Oct 27, 2022
d3fe9a8
Update to Cranelift 0.89.1
bjorn3 Oct 27, 2022
5513583
Stop using a deprecated function
bjorn3 Oct 21, 2022
a24213d
Use 2021 edition for y.rs
bjorn3 Oct 28, 2022
bd8be32
Better rust-analyzer.linkedProjects value
bjorn3 Oct 26, 2022
ddc66ff
Make rust-analyzer run flycheck on the build system
bjorn3 Oct 28, 2022
f17dbfc
Add rustdoc-clif wrapper
bjorn3 Oct 28, 2022
e0ba71e
Ignore rustfmt for y.rs
bjorn3 Oct 28, 2022
c57aacf
Update GHA actions for Node.js 12 deprecation
bjorn3 Oct 28, 2022
777d473
Fix transmuting from vector type to ScalarPair type
bjorn3 Oct 29, 2022
b166ad0
Rewrite implementation of `#[alloc_error_handler]`
Amanieu Oct 14, 2022
736fac8
Sync from rust 432b1a427710223b31f65585c352796832af8aa7
bjorn3 Nov 3, 2022
051b6dd
Rustup to rustc 1.67.0-nightly (edf018221 2022-11-02)
bjorn3 Nov 3, 2022
449f95b
Update rustc test suite failure list
bjorn3 Nov 3, 2022
7941cba
Remove some commented out code
bjorn3 Nov 3, 2022
0b37af8
Update `target-lexicon` to fix new targets parsing (#1293)
mati865 Nov 5, 2022
b5523e3
fix cranelift and gcc
RalfJung Nov 6, 2022
ade426f
Fix `rustdoc --version` when used with download-rustc
jyn514 Nov 9, 2022
d1e499a
Rustup to rustc 1.67.0-nightly (e75aab045 2022-11-09)
bjorn3 Nov 10, 2022
f5caaea
add is_sized method on Abi and Layout, and use it
RalfJung Nov 13, 2022
03e3cc5
Auto merge of #104054 - RalfJung:byte-provenance, r=oli-obk
bors Nov 15, 2022
2d0c41a
cleanup and dedupe CTFE and Miri error reporting
RalfJung Nov 15, 2022
268219d
Use `as_deref` in compiler (but only where it makes sense)
WaffleLapkin Nov 16, 2022
6ee9712
Use custom entry name in cranelift
Ayush1325 Nov 17, 2022
5fd3e4d
Rollup merge of #104001 - Ayush1325:custom-entry, r=bjorn3
Dylan-DPC Nov 19, 2022
a3c89a7
deduplicate constant evaluation in cranelift backend
RalfJung Nov 19, 2022
d6b54a5
Sync from rust 5e6de2369c82ed0b36e6b651b041bad5cb5e1ef8
bjorn3 Nov 19, 2022
be1006b
Rustup to rustc 1.67.0-nightly (c5d82ed7a 2022-11-19)
bjorn3 Nov 20, 2022
9723c79
Fix running rustc tests
bjorn3 Nov 20, 2022
d3817e2
Rollup merge of #104605 - RalfJung:clf_consts, r=bjorn3
matthiaskrgr Nov 21, 2022
cf92372
Fix discriminant handling
bjorn3 Nov 21, 2022
a449d0d
Rustfmt
bjorn3 Nov 21, 2022
d23eb65
Sync from rust 66ccf36f161f67b121290e2af2517ead7e695d3b
bjorn3 Nov 22, 2022
d30c1dd
Rustup to rustc 1.67.0-nightly (b7bc90fea 2022-11-21)
bjorn3 Nov 22, 2022
24ebf42
Update rustc test suite failure list
bjorn3 Nov 22, 2022
bcee07e
Add `Mutability::{is_mut,is_not}`
WaffleLapkin Nov 23, 2022
982798f
Auto merge of #104507 - WaffleLapkin:asderefsyou, r=wesleywiser
bors Nov 24, 2022
69a7692
Rollup merge of #104786 - WaffleLapkin:amp-mut-help, r=compiler-errors
GuillaumeGomez Nov 26, 2022
5399526
Rewrite LLVM's archive writer in Rust
bjorn3 May 28, 2022
a085a2a
Prefer doc comments over `//`-comments in compiler
WaffleLapkin Nov 27, 2022
ef6400d
Split x86 specific intrinsics into intrinsics/llvm_x86.rs
bjorn3 Nov 27, 2022
1367983
Begin implementing llvm simd intrinsics for aarch64
bjorn3 Nov 27, 2022
75838d9
Implement more llvm simd intrinsics for AArch64
bjorn3 Nov 27, 2022
f851dfa
Rustfmt
bjorn3 Nov 27, 2022
cdae9ba
Introduce CargoProject type and use it where possible
bjorn3 Oct 26, 2022
f99140e
Merge pull request #1297 from bjorn3/aarch64_simd
bjorn3 Nov 27, 2022
a00c7a0
Merge pull request #1298 from bjorn3/build_system_rework3
bjorn3 Nov 27, 2022
26d48c9
Rename the build/ directory to dist/
bjorn3 Nov 28, 2022
052d5cc
Implement __isb for AArch64
bjorn3 Nov 28, 2022
9c21990
Rename target_dir to dist_dir in a couple of places
bjorn3 Nov 28, 2022
70ba23b
Merge pull request #1300 from bjorn3/rename_build_to_dist
bjorn3 Nov 29, 2022
3cf8994
Ignore out-of-stack test
bjorn3 Dec 1, 2022
6768d0d
Booleans have been removed from Cranelift
bjorn3 Oct 25, 2022
16a2641
Remove all usages of iconst.i128
bjorn3 Oct 25, 2022
777106a
Fix warning
bjorn3 Oct 25, 2022
e9115eb
Use git version of Cranelift
bjorn3 Oct 25, 2022
ae98a2f
Simplify some code based on newly implemented instructions
bjorn3 Nov 2, 2022
83dc7d1
Fix for removal of raw_bitcast
bjorn3 Nov 3, 2022
3df425e
bswap.i128 is now supported
bjorn3 Nov 3, 2022
155f569
Update cranelift to the upcoming release-3.0.0 branch
bjorn3 Nov 10, 2022
202bdc1
Update Cranelift to 0.90.0
bjorn3 Nov 21, 2022
a54a377
Update Cranelift to 0.90.1
bjorn3 Dec 1, 2022
450257c
Merge pull request #1295 from bjorn3/update_cranelift
bjorn3 Dec 1, 2022
5e97a39
Make sure the target dir is always explicitly set when using cargo
bjorn3 Nov 28, 2022
e75dfef
Put all temporary build artifacts in build/
bjorn3 Nov 28, 2022
4529979
Introduce RelPath
bjorn3 Dec 1, 2022
82b2d8e
Introduce Dirs type to avoid hard coding src and dest locations
bjorn3 Dec 1, 2022
d7b02c3
Fix installing hyperfine
bjorn3 Dec 1, 2022
702a293
Fix build dir caching
bjorn3 Dec 1, 2022
b6ac5a3
Allow specifying where build artifacts should be written to
bjorn3 Dec 1, 2022
f73b0b1
Merge pull request #1302 from bjorn3/build_system_rework4
bjorn3 Dec 1, 2022
04eaaa0
Fix crash with TAIT in the call codegen code
bjorn3 Dec 2, 2022
f845eaf
Switch Linux runner to ubuntu-20.04 to unbreak CI
bjorn3 Dec 2, 2022
f1dc349
Auto merge of #97485 - bjorn3:new_archive_writer, r=wesleywiser
bors Dec 3, 2022
e12a882
S390X CI Support (#1304)
afonso360 Dec 3, 2022
b8a3c2d
Sync from rust fd02567705326884ddb94535d2ab230a9595dc2a
bjorn3 Dec 4, 2022
63fab51
Rustup to rustc 1.67.0-nightly (234151769 2022-12-03)
bjorn3 Dec 4, 2022
34336b8
Remove unneeded field from `SwitchTargets`
JakobDegen Dec 4, 2022
8f9a048
Sync from rust b3ddfeb5a88352aa6d157f722976937da7b97307
bjorn3 Dec 11, 2022
ef1cb95
Rustup to rustc 1.68.0-nightly (c6fcdb690 2022-12-10)
bjorn3 Dec 11, 2022
21f4355
Fix for "Support Option and similar enums as type of static variable …
bjorn3 Dec 10, 2022
a89cef5
Update rustc test suite failure list
bjorn3 Dec 11, 2022
7e10f1a
Update dependencies
bjorn3 Dec 11, 2022
f7c76ad
bug! with a better error message for failing Instance::resolve
compiler-errors Dec 11, 2022
e3d70e2
Sync from rust ed620cf9690fdafed65845bf35c455db992fbba1
bjorn3 Dec 13, 2022
6e772b8
Rustup to rustc 1.68.0-nightly (37d7de337 2022-12-12)
bjorn3 Dec 13, 2022
08ba5d4
Remove a couple of module.isa() calls
bjorn3 Dec 14, 2022
a45924c
Explicitly provide dummy git author name and email
bjorn3 Dec 14, 2022
2bb3996
Remove unnecessary git init
bjorn3 Dec 14, 2022
9496999
Merge commit '2bb3996244cf1b89878da9e39841e9f6bf061602' into sync_cg_…
bjorn3 Dec 14, 2022
13e33c0
Add tidy exceptions
bjorn3 Dec 14, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions compiler/rustc_codegen_cranelift/.cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ task:
folder: target
prepare_script:
- . $HOME/.cargo/env
- git config --global user.email "[email protected]"
- git config --global user.name "User"
- ./y.rs prepare
test_script:
- . $HOME/.cargo/env
Expand Down
52 changes: 29 additions & 23 deletions compiler/rustc_codegen_cranelift/.github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ jobs:
- name: Rustfmt
run: |
cargo fmt --check
rustfmt --check build_system/mod.rs

build:
runs-on: ${{ matrix.os }}
Expand All @@ -28,7 +29,7 @@ jobs:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
- os: ubuntu-20.04 # FIXME switch to ubuntu-22.04 once #1303 is fixed
env:
TARGET_TRIPLE: x86_64-unknown-linux-gnu
- os: macos-latest
Expand All @@ -41,28 +42,32 @@ jobs:
- os: ubuntu-latest
env:
TARGET_TRIPLE: aarch64-unknown-linux-gnu
# s390x requires QEMU 6.1 or greater, we could build it from source, but ubuntu 22.04 comes with 6.2 by default
- os: ubuntu-latest
env:
TARGET_TRIPLE: s390x-unknown-linux-gnu

steps:
- uses: actions/checkout@v3

- name: Cache cargo installed crates
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: ~/.cargo/bin
key: ${{ runner.os }}-cargo-installed-crates

- name: Cache cargo registry and index
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: |
~/.cargo/registry
~/.cargo/git
key: ${{ runner.os }}-cargo-registry-and-index-${{ hashFiles('**/Cargo.lock') }}

- name: Cache cargo target dir
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: target
path: build/cg_clif
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('rust-toolchain', '**/Cargo.lock') }}

- name: Install MinGW toolchain and wine
Expand All @@ -78,11 +83,14 @@ jobs:
sudo apt-get update
sudo apt-get install -y gcc-aarch64-linux-gnu qemu-user

- name: Prepare dependencies
- name: Install s390x toolchain and qemu
if: matrix.env.TARGET_TRIPLE == 's390x-unknown-linux-gnu'
run: |
git config --global user.email "[email protected]"
git config --global user.name "User"
./y.rs prepare
sudo apt-get update
sudo apt-get install -y gcc-s390x-linux-gnu qemu-user

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

- name: Build without unstable features
env:
Expand Down Expand Up @@ -110,7 +118,7 @@ jobs:
./y.rs test

- name: Package prebuilt cg_clif
run: tar cvfJ cg_clif.tar.xz build
run: tar cvfJ cg_clif.tar.xz dist

- name: Upload prebuilt cg_clif
if: matrix.env.TARGET_TRIPLE != 'x86_64-pc-windows-gnu'
Expand All @@ -121,7 +129,7 @@ jobs:

- name: Upload prebuilt cg_clif (cross compile)
if: matrix.env.TARGET_TRIPLE == 'x86_64-pc-windows-gnu'
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: cg_clif-${{ runner.os }}-cross-x86_64-mingw
path: cg_clif.tar.xz
Expand All @@ -147,23 +155,23 @@ jobs:
- uses: actions/checkout@v3

- name: Cache cargo installed crates
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: ~/.cargo/bin
key: ${{ runner.os }}-${{ matrix.env.TARGET_TRIPLE }}-cargo-installed-crates

- name: Cache cargo registry and index
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: |
~/.cargo/registry
~/.cargo/git
key: ${{ runner.os }}-${{ matrix.env.TARGET_TRIPLE }}-cargo-registry-and-index-${{ hashFiles('**/Cargo.lock') }}

- name: Cache cargo target dir
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: target
path: build/cg_clif
key: ${{ runner.os }}-${{ matrix.env.TARGET_TRIPLE }}-cargo-build-target-${{ hashFiles('rust-toolchain', '**/Cargo.lock') }}

- name: Set MinGW as the default toolchain
Expand All @@ -172,8 +180,6 @@ jobs:

- name: Prepare dependencies
run: |
git config --global user.email "[email protected]"
git config --global user.name "User"
git config --global core.autocrlf false
rustc y.rs -o y.exe -g
./y.exe prepare
Expand All @@ -198,24 +204,24 @@ jobs:

# Enable extra checks
$Env:CG_CLIF_ENABLE_VERIFIER=1

# WIP Disable some tests

# This fails due to some weird argument handling by hyperfine, not an actual regression
# more of a build system issue
(Get-Content config.txt) -replace '(bench.simple-raytracer)', '# $1' | Out-File config.txt
# This fails with a different output than expected

# This fails with a different output than expected
(Get-Content config.txt) -replace '(test.regex-shootout-regex-dna)', '# $1' | Out-File config.txt

./y.exe test

- name: Package prebuilt cg_clif
# don't use compression as xzip isn't supported by tar on windows and bzip2 hangs
run: tar cvf cg_clif.tar build
run: tar cvf cg_clif.tar dist

- name: Upload prebuilt cg_clif
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: cg_clif-${{ matrix.env.TARGET_TRIPLE }}
path: cg_clif.tar
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- uses: actions/checkout@v3

- name: Cache cargo installed crates
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: ~/.cargo/bin
key: ubuntu-latest-cargo-installed-crates
Expand Down
16 changes: 8 additions & 8 deletions compiler/rustc_codegen_cranelift/.github/workflows/rustc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,23 @@ jobs:
- uses: actions/checkout@v3

- name: Cache cargo installed crates
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: ~/.cargo/bin
key: ${{ runner.os }}-cargo-installed-crates

- name: Cache cargo registry and index
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: |
~/.cargo/registry
~/.cargo/git
key: ${{ runner.os }}-cargo-registry-and-index-${{ hashFiles('**/Cargo.lock') }}

- name: Cache cargo target dir
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: target
path: build/cg_clif
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('rust-toolchain', '**/Cargo.lock') }}

- name: Prepare dependencies
Expand All @@ -49,23 +49,23 @@ jobs:
- uses: actions/checkout@v3

- name: Cache cargo installed crates
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: ~/.cargo/bin
key: ${{ runner.os }}-cargo-installed-crates

- name: Cache cargo registry and index
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: |
~/.cargo/registry
~/.cargo/git
key: ${{ runner.os }}-cargo-registry-and-index-${{ hashFiles('**/Cargo.lock') }}

- name: Cache cargo target dir
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: target
path: build/cg_clif
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('rust-toolchain', '**/Cargo.lock') }}

- name: Prepare dependencies
Expand Down
1 change: 1 addition & 0 deletions compiler/rustc_codegen_cranelift/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@ perf.data.old
/build_sysroot/sysroot_src
/build_sysroot/compiler-builtins
/build_sysroot/rustc_version
/dist
/rust
/download
35 changes: 3 additions & 32 deletions compiler/rustc_codegen_cranelift/.vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,10 @@
"rust-analyzer.imports.granularity.enforce": true,
"rust-analyzer.imports.granularity.group": "module",
"rust-analyzer.imports.prefix": "crate",
"rust-analyzer.cargo.features": ["unstable-features"],
"rust-analyzer.cargo.features": ["unstable-features", "__check_build_system_using_ra"],
"rust-analyzer.linkedProjects": [
"./Cargo.toml",
//"./build_sysroot/sysroot_src/library/std/Cargo.toml",
{
"roots": [
"./example/mini_core.rs",
"./example/mini_core_hello_world.rs",
"./example/mod_bench.rs"
],
"crates": [
{
"root_module": "./example/mini_core.rs",
Expand All @@ -36,34 +30,11 @@
]
},
{
"roots": ["./example/std_example.rs"],
"sysroot_src": "./build_sysroot/sysroot_src/library",
"crates": [
{
"root_module": "./example/std_example.rs",
"edition": "2018",
"deps": [{ "crate": 1, "name": "std" }],
"cfg": [],
},
{
"root_module": "./build_sysroot/sysroot_src/library/std/src/lib.rs",
"edition": "2018",
"deps": [],
"cfg": [],
},
]
},
{
"roots": ["./y.rs"],
"crates": [
{
"root_module": "./y.rs",
"edition": "2018",
"deps": [{ "crate": 1, "name": "std" }],
"cfg": [],
},
{
"root_module": "./build_sysroot/sysroot_src/library/std/src/lib.rs",
"edition": "2018",
"edition": "2015",
"deps": [],
"cfg": [],
},
Expand Down
Loading