Skip to content

Commit

Permalink
Auto merge of #118279 - bjorn3:sync_cg_clif-2023-11-25, r=bjorn3
Browse files Browse the repository at this point in the history
Subtree sync for rustc_codegen_cranelift

The main highlights this time are implementing a bunch of new vendor intrinsics and fixing some existing ones. And fixing polymorphization for coroutines.

r? `@ghost`

`@rustbot` label +A-codegen +A-cranelift +T-compiler
  • Loading branch information
bors committed Nov 25, 2023
2 parents 3668a8a + aa51a27 commit 3166210
Show file tree
Hide file tree
Showing 10 changed files with 452 additions and 71 deletions.
60 changes: 30 additions & 30 deletions compiler/rustc_codegen_cranelift/Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6"

[[package]]
name = "arbitrary"
version = "1.3.0"
version = "1.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e2d098ff73c1ca148721f37baad5ea6a465a13f9573aba8641fbbbae8164a54e"
checksum = "7d5a26814d8dcb93b0e5a0ff3c6d80a8843bafb21b39e8e18a6f05471870e110"

[[package]]
name = "bitflags"
Expand All @@ -45,18 +45,18 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"

[[package]]
name = "cranelift-bforest"
version = "0.101.2"
version = "0.102.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f773437307980ac0f424bf9b9a5d0cd21a0f17248c6860c9a65bec8b5975f3fe"
checksum = "76eb38f2af690b5a4411d9a8782b6d77dabff3ca939e0518453ab9f9a4392d41"
dependencies = [
"cranelift-entity",
]

[[package]]
name = "cranelift-codegen"
version = "0.101.2"
version = "0.102.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "443c2ac50e97fb7de1a0f862753fce3f27215558811a6fcee508eb0c3747fa79"
checksum = "39526c036b92912417e8931f52c1e235796688068d3efdbbd8b164f299d19156"
dependencies = [
"bumpalo",
"cranelift-bforest",
Expand All @@ -75,39 +75,39 @@ dependencies = [

[[package]]
name = "cranelift-codegen-meta"
version = "0.101.2"
version = "0.102.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c5b174c411480c79ce0793c55042fa51bec27e486381d103a53cab3b480cb2db"
checksum = "fdb0deedc9fccf2db53a5a3c9c9d0163e44143b0d004dca9bf6ab6a0024cd79a"
dependencies = [
"cranelift-codegen-shared",
]

[[package]]
name = "cranelift-codegen-shared"
version = "0.101.2"
version = "0.102.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "73fa0151a528066a369de6debeea4d4b23a32aba68b5add8c46d3dc8091ff434"
checksum = "cea2d1b274e45aa8e61e9103efa1ba82d4b5a19d12bd1fd10744c3b7380ba3ff"

[[package]]
name = "cranelift-control"
version = "0.101.2"
version = "0.102.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b8adf1e6398493c9bea1190e37d28a0eb0eca5fddbc80e01e506cda34db92b1f"
checksum = "6ea5977559a71e63db79a263f0e81a89b996e8a38212c4281e37dd1dbaa8b65c"
dependencies = [
"arbitrary",
]

[[package]]
name = "cranelift-entity"
version = "0.101.2"
version = "0.102.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4917e2ed3bb5fe87d0ed88395ca6d644018d119a034faedd1f3e1f2c33cd52b2"
checksum = "2f871ada808b58158d84dfc43a6a2e2d2756baaf4ed1c51fd969ca8330e6ca5c"

[[package]]
name = "cranelift-frontend"
version = "0.101.2"
version = "0.102.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9aaadf1e7cf28886bbf046eaf7ef538997bc8a7e020e578ea4957b39da87d5a1"
checksum = "e8e6890f587ef59824b3debe577e68fdf9b307b3808c54b8d93a18fd0b70941b"
dependencies = [
"cranelift-codegen",
"log",
Expand All @@ -117,15 +117,15 @@ dependencies = [

[[package]]
name = "cranelift-isle"
version = "0.101.2"
version = "0.102.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a67fda31b9d69eaa1c49a2081939454c45857596a9d45af6744680541c628b4c"
checksum = "a8d5fc6d5d3b52d1917002b17a8ecce448c2621b5bf394bb4e77e2f676893537"

[[package]]
name = "cranelift-jit"
version = "0.101.2"
version = "0.102.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d6bf32710628e7ff298739f1ed80a0bfdafc0c6a3e284c4540b23f18e8889d4b"
checksum = "e8a2d7744f743f59d9646d7589ad22ea17ed0d71e04906eb77c31e99bc13bd8b"
dependencies = [
"anyhow",
"cranelift-codegen",
Expand All @@ -143,9 +143,9 @@ dependencies = [

[[package]]
name = "cranelift-module"
version = "0.101.2"
version = "0.102.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4d693e93a0fbf56b4bc93cffe6b107c2e52f070e1111950505fc8c83ac440b9d"
checksum = "b96cb196334698e612c197d7d0ae59af5e07667306ec20d7be414717db400873"
dependencies = [
"anyhow",
"cranelift-codegen",
Expand All @@ -154,9 +154,9 @@ dependencies = [

[[package]]
name = "cranelift-native"
version = "0.101.2"
version = "0.102.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "76fb52ba71be98312f35e798d9e98e45ab2586f27584231bf7c644fa9501e8af"
checksum = "3e10c2e7faa65d4ae7de9a83b44f2c31aca7dc638e17d0a79572fdf8103d720b"
dependencies = [
"cranelift-codegen",
"libc",
Expand All @@ -165,9 +165,9 @@ dependencies = [

[[package]]
name = "cranelift-object"
version = "0.101.2"
version = "0.102.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2551b2e185022b89e9efa5e04c0f17f679b86ef73d9f7feabc48b608ff23120d"
checksum = "83ce94e18756058af8a66e3c0ba1123ae15517c72162d8060d0cb0974642adf2"
dependencies = [
"anyhow",
"cranelift-codegen",
Expand Down Expand Up @@ -295,9 +295,9 @@ checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d"

[[package]]
name = "regalloc2"
version = "0.9.2"
version = "0.9.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5b4dcbd3a2ae7fb94b5813fa0e957c6ab51bf5d0a8ee1b69e0c2d0f1e6eb8485"
checksum = "ad156d539c879b7a24a363a2016d77961786e71f48f2e2fc8302a92abd2429a6"
dependencies = [
"hashbrown 0.13.2",
"log",
Expand Down Expand Up @@ -374,9 +374,9 @@ checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f"

[[package]]
name = "wasmtime-jit-icache-coherence"
version = "14.0.2"
version = "15.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0980a96b16abbdaf829858d2389697b1d6cfc6a903873fd74b7e47a6b1045584"
checksum = "b73ad1395eda136baec5ece7e079e0536a82ef73488e345456cc9b89858ad0ec"
dependencies = [
"cfg-if",
"libc",
Expand Down
12 changes: 6 additions & 6 deletions compiler/rustc_codegen_cranelift/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ crate-type = ["dylib"]

[dependencies]
# These have to be in sync with each other
cranelift-codegen = { version = "0.101.2", default-features = false, features = ["std", "unwind", "all-arch"] }
cranelift-frontend = { version = "0.101.2" }
cranelift-module = { version = "0.101.2" }
cranelift-native = { version = "0.101.2" }
cranelift-jit = { version = "0.101.2", optional = true }
cranelift-object = { version = "0.101.2" }
cranelift-codegen = { version = "0.102", default-features = false, features = ["std", "unwind", "all-arch"] }
cranelift-frontend = { version = "0.102" }
cranelift-module = { version = "0.102" }
cranelift-native = { version = "0.102" }
cranelift-jit = { version = "0.102", optional = true }
cranelift-object = { version = "0.102" }
target-lexicon = "0.12.0"
gimli = { version = "0.28", default-features = false, features = ["write"]}
object = { version = "0.32", default-features = false, features = ["std", "read_core", "write", "archive", "coff", "elf", "macho", "pe"] }
Expand Down
5 changes: 5 additions & 0 deletions compiler/rustc_codegen_cranelift/build_system/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,10 @@ const BASE_SYSROOT_SUITE: &[TestCase] = &[
TestCase::build_bin_and_run("aot.mod_bench", "example/mod_bench.rs", &[]),
TestCase::build_bin_and_run("aot.issue-72793", "example/issue-72793.rs", &[]),
TestCase::build_bin("aot.issue-59326", "example/issue-59326.rs"),
TestCase::custom("aot.polymorphize_coroutine", &|runner| {
runner.run_rustc(&["example/polymorphize_coroutine.rs", "-Zpolymorphize"]);
runner.run_out_command("polymorphize_coroutine", &[]);
}),
TestCase::build_bin_and_run("aot.neon", "example/neon.rs", &[]),
TestCase::custom("aot.gen_block_iterate", &|runner| {
runner.run_rustc([
Expand Down Expand Up @@ -466,6 +470,7 @@ impl<'a> TestRunner<'a> {
cmd.arg("--target");
cmd.arg(&self.target_compiler.triple);
cmd.arg("-Cpanic=abort");
cmd.arg("-Zunstable-options");
cmd.arg("--check-cfg=cfg(no_unstable_features)");
cmd.arg("--check-cfg=cfg(jit)");
cmd.args(args);
Expand Down
1 change: 1 addition & 0 deletions compiler/rustc_codegen_cranelift/config.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ aot.float-minmax-pass
aot.mod_bench
aot.issue-72793
aot.issue-59326
aot.polymorphize_coroutine
aot.neon
aot.gen_block_iterate

Expand Down
16 changes: 16 additions & 0 deletions compiler/rustc_codegen_cranelift/example/polymorphize_coroutine.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#![feature(coroutines, coroutine_trait)]

use std::ops::Coroutine;
use std::pin::Pin;

fn main() {
run_coroutine::<i32>();
}

fn run_coroutine<T>() {
let mut coroutine = || {
yield;
return;
};
Pin::new(&mut coroutine).resume(());
}
2 changes: 1 addition & 1 deletion compiler/rustc_codegen_cranelift/rust-toolchain
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[toolchain]
channel = "nightly-2023-11-16"
channel = "nightly-2023-11-25"
components = ["rust-src", "rustc-dev", "llvm-tools"]
5 changes: 0 additions & 5 deletions compiler/rustc_codegen_cranelift/scripts/test_rustc_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -146,11 +146,6 @@ rm tests/ui/process/nofile-limit.rs # TODO some AArch64 linking issue

rm tests/ui/stdio-is-blocking.rs # really slow with unoptimized libstd

# rustc bugs
# ==========
# https://github.com/rust-lang/rust/pull/116447#issuecomment-1790451463
rm tests/ui/coroutine/gen_block_*.rs

cp ../dist/bin/rustdoc-clif ../dist/bin/rustdoc # some tests expect bin/rustdoc to exist

# prevent $(RUSTDOC) from picking up the sysroot built by x.py. It conflicts with the one used by
Expand Down
Loading

0 comments on commit 3166210

Please sign in to comment.