Skip to content

Commit 3166210

Browse files
committed
Auto merge of #118279 - bjorn3:sync_cg_clif-2023-11-25, r=bjorn3
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
2 parents 3668a8a + aa51a27 commit 3166210

File tree

10 files changed

+452
-71
lines changed

10 files changed

+452
-71
lines changed

compiler/rustc_codegen_cranelift/Cargo.lock

+30-30
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6"
2121

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

2828
[[package]]
2929
name = "bitflags"
@@ -45,18 +45,18 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
4545

4646
[[package]]
4747
name = "cranelift-bforest"
48-
version = "0.101.2"
48+
version = "0.102.0"
4949
source = "registry+https://github.com/rust-lang/crates.io-index"
50-
checksum = "f773437307980ac0f424bf9b9a5d0cd21a0f17248c6860c9a65bec8b5975f3fe"
50+
checksum = "76eb38f2af690b5a4411d9a8782b6d77dabff3ca939e0518453ab9f9a4392d41"
5151
dependencies = [
5252
"cranelift-entity",
5353
]
5454

5555
[[package]]
5656
name = "cranelift-codegen"
57-
version = "0.101.2"
57+
version = "0.102.0"
5858
source = "registry+https://github.com/rust-lang/crates.io-index"
59-
checksum = "443c2ac50e97fb7de1a0f862753fce3f27215558811a6fcee508eb0c3747fa79"
59+
checksum = "39526c036b92912417e8931f52c1e235796688068d3efdbbd8b164f299d19156"
6060
dependencies = [
6161
"bumpalo",
6262
"cranelift-bforest",
@@ -75,39 +75,39 @@ dependencies = [
7575

7676
[[package]]
7777
name = "cranelift-codegen-meta"
78-
version = "0.101.2"
78+
version = "0.102.0"
7979
source = "registry+https://github.com/rust-lang/crates.io-index"
80-
checksum = "c5b174c411480c79ce0793c55042fa51bec27e486381d103a53cab3b480cb2db"
80+
checksum = "fdb0deedc9fccf2db53a5a3c9c9d0163e44143b0d004dca9bf6ab6a0024cd79a"
8181
dependencies = [
8282
"cranelift-codegen-shared",
8383
]
8484

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

9191
[[package]]
9292
name = "cranelift-control"
93-
version = "0.101.2"
93+
version = "0.102.0"
9494
source = "registry+https://github.com/rust-lang/crates.io-index"
95-
checksum = "b8adf1e6398493c9bea1190e37d28a0eb0eca5fddbc80e01e506cda34db92b1f"
95+
checksum = "6ea5977559a71e63db79a263f0e81a89b996e8a38212c4281e37dd1dbaa8b65c"
9696
dependencies = [
9797
"arbitrary",
9898
]
9999

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

106106
[[package]]
107107
name = "cranelift-frontend"
108-
version = "0.101.2"
108+
version = "0.102.0"
109109
source = "registry+https://github.com/rust-lang/crates.io-index"
110-
checksum = "9aaadf1e7cf28886bbf046eaf7ef538997bc8a7e020e578ea4957b39da87d5a1"
110+
checksum = "e8e6890f587ef59824b3debe577e68fdf9b307b3808c54b8d93a18fd0b70941b"
111111
dependencies = [
112112
"cranelift-codegen",
113113
"log",
@@ -117,15 +117,15 @@ dependencies = [
117117

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

124124
[[package]]
125125
name = "cranelift-jit"
126-
version = "0.101.2"
126+
version = "0.102.0"
127127
source = "registry+https://github.com/rust-lang/crates.io-index"
128-
checksum = "d6bf32710628e7ff298739f1ed80a0bfdafc0c6a3e284c4540b23f18e8889d4b"
128+
checksum = "e8a2d7744f743f59d9646d7589ad22ea17ed0d71e04906eb77c31e99bc13bd8b"
129129
dependencies = [
130130
"anyhow",
131131
"cranelift-codegen",
@@ -143,9 +143,9 @@ dependencies = [
143143

144144
[[package]]
145145
name = "cranelift-module"
146-
version = "0.101.2"
146+
version = "0.102.0"
147147
source = "registry+https://github.com/rust-lang/crates.io-index"
148-
checksum = "4d693e93a0fbf56b4bc93cffe6b107c2e52f070e1111950505fc8c83ac440b9d"
148+
checksum = "b96cb196334698e612c197d7d0ae59af5e07667306ec20d7be414717db400873"
149149
dependencies = [
150150
"anyhow",
151151
"cranelift-codegen",
@@ -154,9 +154,9 @@ dependencies = [
154154

155155
[[package]]
156156
name = "cranelift-native"
157-
version = "0.101.2"
157+
version = "0.102.0"
158158
source = "registry+https://github.com/rust-lang/crates.io-index"
159-
checksum = "76fb52ba71be98312f35e798d9e98e45ab2586f27584231bf7c644fa9501e8af"
159+
checksum = "3e10c2e7faa65d4ae7de9a83b44f2c31aca7dc638e17d0a79572fdf8103d720b"
160160
dependencies = [
161161
"cranelift-codegen",
162162
"libc",
@@ -165,9 +165,9 @@ dependencies = [
165165

166166
[[package]]
167167
name = "cranelift-object"
168-
version = "0.101.2"
168+
version = "0.102.0"
169169
source = "registry+https://github.com/rust-lang/crates.io-index"
170-
checksum = "2551b2e185022b89e9efa5e04c0f17f679b86ef73d9f7feabc48b608ff23120d"
170+
checksum = "83ce94e18756058af8a66e3c0ba1123ae15517c72162d8060d0cb0974642adf2"
171171
dependencies = [
172172
"anyhow",
173173
"cranelift-codegen",
@@ -295,9 +295,9 @@ checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d"
295295

296296
[[package]]
297297
name = "regalloc2"
298-
version = "0.9.2"
298+
version = "0.9.3"
299299
source = "registry+https://github.com/rust-lang/crates.io-index"
300-
checksum = "5b4dcbd3a2ae7fb94b5813fa0e957c6ab51bf5d0a8ee1b69e0c2d0f1e6eb8485"
300+
checksum = "ad156d539c879b7a24a363a2016d77961786e71f48f2e2fc8302a92abd2429a6"
301301
dependencies = [
302302
"hashbrown 0.13.2",
303303
"log",
@@ -374,9 +374,9 @@ checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f"
374374

375375
[[package]]
376376
name = "wasmtime-jit-icache-coherence"
377-
version = "14.0.2"
377+
version = "15.0.0"
378378
source = "registry+https://github.com/rust-lang/crates.io-index"
379-
checksum = "0980a96b16abbdaf829858d2389697b1d6cfc6a903873fd74b7e47a6b1045584"
379+
checksum = "b73ad1395eda136baec5ece7e079e0536a82ef73488e345456cc9b89858ad0ec"
380380
dependencies = [
381381
"cfg-if",
382382
"libc",

compiler/rustc_codegen_cranelift/Cargo.toml

+6-6
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ crate-type = ["dylib"]
88

99
[dependencies]
1010
# These have to be in sync with each other
11-
cranelift-codegen = { version = "0.101.2", default-features = false, features = ["std", "unwind", "all-arch"] }
12-
cranelift-frontend = { version = "0.101.2" }
13-
cranelift-module = { version = "0.101.2" }
14-
cranelift-native = { version = "0.101.2" }
15-
cranelift-jit = { version = "0.101.2", optional = true }
16-
cranelift-object = { version = "0.101.2" }
11+
cranelift-codegen = { version = "0.102", default-features = false, features = ["std", "unwind", "all-arch"] }
12+
cranelift-frontend = { version = "0.102" }
13+
cranelift-module = { version = "0.102" }
14+
cranelift-native = { version = "0.102" }
15+
cranelift-jit = { version = "0.102", optional = true }
16+
cranelift-object = { version = "0.102" }
1717
target-lexicon = "0.12.0"
1818
gimli = { version = "0.28", default-features = false, features = ["write"]}
1919
object = { version = "0.32", default-features = false, features = ["std", "read_core", "write", "archive", "coff", "elf", "macho", "pe"] }

compiler/rustc_codegen_cranelift/build_system/tests.rs

+5
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,10 @@ const BASE_SYSROOT_SUITE: &[TestCase] = &[
9999
TestCase::build_bin_and_run("aot.mod_bench", "example/mod_bench.rs", &[]),
100100
TestCase::build_bin_and_run("aot.issue-72793", "example/issue-72793.rs", &[]),
101101
TestCase::build_bin("aot.issue-59326", "example/issue-59326.rs"),
102+
TestCase::custom("aot.polymorphize_coroutine", &|runner| {
103+
runner.run_rustc(&["example/polymorphize_coroutine.rs", "-Zpolymorphize"]);
104+
runner.run_out_command("polymorphize_coroutine", &[]);
105+
}),
102106
TestCase::build_bin_and_run("aot.neon", "example/neon.rs", &[]),
103107
TestCase::custom("aot.gen_block_iterate", &|runner| {
104108
runner.run_rustc([
@@ -466,6 +470,7 @@ impl<'a> TestRunner<'a> {
466470
cmd.arg("--target");
467471
cmd.arg(&self.target_compiler.triple);
468472
cmd.arg("-Cpanic=abort");
473+
cmd.arg("-Zunstable-options");
469474
cmd.arg("--check-cfg=cfg(no_unstable_features)");
470475
cmd.arg("--check-cfg=cfg(jit)");
471476
cmd.args(args);

compiler/rustc_codegen_cranelift/config.txt

+1
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ aot.float-minmax-pass
4242
aot.mod_bench
4343
aot.issue-72793
4444
aot.issue-59326
45+
aot.polymorphize_coroutine
4546
aot.neon
4647
aot.gen_block_iterate
4748

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#![feature(coroutines, coroutine_trait)]
2+
3+
use std::ops::Coroutine;
4+
use std::pin::Pin;
5+
6+
fn main() {
7+
run_coroutine::<i32>();
8+
}
9+
10+
fn run_coroutine<T>() {
11+
let mut coroutine = || {
12+
yield;
13+
return;
14+
};
15+
Pin::new(&mut coroutine).resume(());
16+
}
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[toolchain]
2-
channel = "nightly-2023-11-16"
2+
channel = "nightly-2023-11-25"
33
components = ["rust-src", "rustc-dev", "llvm-tools"]

compiler/rustc_codegen_cranelift/scripts/test_rustc_tests.sh

-5
Original file line numberDiff line numberDiff line change
@@ -146,11 +146,6 @@ rm tests/ui/process/nofile-limit.rs # TODO some AArch64 linking issue
146146

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

149-
# rustc bugs
150-
# ==========
151-
# https://github.com/rust-lang/rust/pull/116447#issuecomment-1790451463
152-
rm tests/ui/coroutine/gen_block_*.rs
153-
154149
cp ../dist/bin/rustdoc-clif ../dist/bin/rustdoc # some tests expect bin/rustdoc to exist
155150

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

0 commit comments

Comments
 (0)