Skip to content
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

Rollup of 13 pull requests #130731

Closed
wants to merge 105 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
105 commits
Select commit Hold shift + click to select a range
80a7d5f
nontemporal_store: make sure that the intrinsic is truly just a hint
RalfJung Jul 24, 2024
e96ece7
Rename struct_tail_erasing_lifetimes to struct_tail_for_codegen
compiler-errors Aug 8, 2024
b8b3a93
Shrink `TyKind::FnPtr`.
nnethercote Aug 8, 2024
3ea9313
Merge commit '69b3f5a426a5c1c05236a45b36f6679d95fbe01b' into sync_cg_…
bjorn3 Aug 9, 2024
0174cb1
Use ar_archive_writer from sysroot for cg_clif
bjorn3 Aug 9, 2024
78abc36
Merge branch 'sync_from_rust'
bjorn3 Aug 9, 2024
aec3786
Apply missed change from subtree sync
bjorn3 Aug 9, 2024
bb6571f
Rustup to rustc 1.82.0-nightly (ca5d25e2c 2024-08-09)
bjorn3 Aug 10, 2024
3de829e
Fixes in various places
Nadrieril Mar 20, 2024
1b96458
Remove --debug argument of y.sh
bjorn3 Aug 10, 2024
a33f731
Couple of minor build system changes
bjorn3 Aug 10, 2024
e55c630
Add back bench job dependency for the release job
bjorn3 Aug 10, 2024
52aa24e
Move cleaning of y.bin to the "to be removed" section in clean_all.sh
bjorn3 Aug 10, 2024
aa918f0
Stop ignoring some portable-simd tests
bjorn3 Aug 10, 2024
ab1da46
Fix source path for portable-simd
bjorn3 Aug 10, 2024
060811a
Distribute rustc_codegen_cranelift for Windows
bjorn3 Aug 10, 2024
65369af
Sync from rust 730d5d4095a264ef5f7c0a0781eea68c15431d45
bjorn3 Aug 11, 2024
fabb298
Rustup to rustc 1.82.0-nightly (730d5d409 2024-08-10)
bjorn3 Aug 11, 2024
918e11d
Fix clean_all.sh
bjorn3 Aug 11, 2024
b4e46de
Fix clif ir text format emission
bjorn3 Aug 11, 2024
ef74616
Rollup merge of #128149 - RalfJung:nontemporal_store, r=jieyouxu,Aman…
GuillaumeGomez Aug 12, 2024
6906793
simd_shuffle intrinsic: allow argument to be passed as vector (not ju…
RalfJung Aug 6, 2024
e2acda7
Auto merge of #128812 - nnethercote:shrink-TyKind-FnPtr, r=compiler-e…
bors Aug 14, 2024
c7d43c3
Sync from rust 13a52890dde8cfeb95069d77c223ac37c0cf3a46
bjorn3 Aug 15, 2024
69cec6f
Rustup to rustc 1.82.0-nightly (13a52890d 2024-08-14)
bjorn3 Aug 15, 2024
d7198a5
Always use ar_archive_writer for import libs
ChrisDenton Aug 16, 2024
f1fadb8
stabilize raw_ref_op
RalfJung Jul 13, 2024
8e7b3b5
rename AddressOf -> RawBorrow inside the compiler
RalfJung Aug 12, 2024
c1e7b00
Sync from rust 6de928dce9472b864f4e5d590dd7aa2075cb7551
bjorn3 Aug 19, 2024
01f8739
Rustup to rustc 1.82.0-nightly (6de928dce 2024-08-18)
bjorn3 Aug 19, 2024
46b7db1
Sync from rust a32d4a0e822a29a6682e08b75a8df4c29c7fa9f1
bjorn3 Aug 22, 2024
87e74fe
Rustup to rustc 1.82.0-nightly (a32d4a0e8 2024-08-21)
bjorn3 Aug 22, 2024
19757ec
Update Cranelift to 0.111
bjorn3 Aug 11, 2024
8a26d21
Rollup merge of #128731 - RalfJung:simd-shuffle-vector, r=workingjubilee
tgross35 Aug 27, 2024
217b005
Sync from rust 1f12b9b0fdbe735968ac002792a720f0ba4faca6
bjorn3 Aug 28, 2024
36c126f
Rustup to rustc 1.82.0-nightly (1f12b9b0f 2024-08-27)
bjorn3 Aug 28, 2024
7e4cafb
Fix rustc test suite
bjorn3 Aug 28, 2024
0fba9b4
introduce `PrettyPrintMirOptions` for cosmetic MIR dump options
lqd Aug 28, 2024
c31f7b9
Sync from rust bd53aa3bf7a24a70d763182303bd75e5fc51a9af
bjorn3 Sep 3, 2024
39defb1
Rustup to rustc 1.83.0-nightly (bd53aa3bf 2024-09-02)
bjorn3 Sep 3, 2024
b7ed9ad
Remove test exclusion for fixed rustc test
bjorn3 Sep 3, 2024
cf7c055
Auto merge of #128939 - bjorn3:windows_cg_clif_component, r=albertlar…
bors Sep 9, 2024
fe5183e
Fix the examples in cg_clif
scottmcm Aug 23, 2024
b4d55a8
Add missing dbghelp link directive for windows
bjorn3 Sep 11, 2024
17bcb2f
Sync from rust 0ee7cb5e3633502d9a90a85c3c367eccd59a0aba
bjorn3 Sep 11, 2024
dcae9ac
Rustup to rustc 1.83.0-nightly (0ee7cb5e3 2024-09-10)
bjorn3 Sep 11, 2024
ade0e38
Fix building rustc and the rustc test suite
bjorn3 Sep 11, 2024
45be990
Inline prepare_stdlib into the sysroot build code
bjorn3 Sep 12, 2024
1aa0cf9
Unconditionally use git to download test repos
bjorn3 Sep 12, 2024
4e38767
Use plain sh for y.sh, test.sh and clean_all.sh
bjorn3 Sep 12, 2024
f204181
Install git-tiny on Cirrus CI
bjorn3 Sep 12, 2024
bc67321
Reduce usage of RelPath in build_sysroot
bjorn3 Sep 13, 2024
d5e2e23
Misc cleanups
bjorn3 Sep 13, 2024
652b004
Remove unnecessary special case
bjorn3 Sep 13, 2024
41f6d55
Refactor command runner handling
bjorn3 Sep 13, 2024
b7272c2
Remove unnecessary -Zunstable-options
bjorn3 Sep 13, 2024
15848f3
simd_shuffle: require index argument to be a vector
RalfJung Sep 12, 2024
6fbe4d9
Rename remove_dir_if_exists to ensure_empty_dir and create the dir in…
bjorn3 Sep 14, 2024
ab989ac
Sync from rust 9b72238eb813e9d06e9e9d270168512fbffd7ee7
bjorn3 Sep 15, 2024
61d3b59
Rustup to rustc 1.83.0-nightly (9b72238eb 2024-09-14)
bjorn3 Sep 15, 2024
c7b4998
Fix rustc test suite
bjorn3 Sep 15, 2024
cebdfe4
Slightly simplify the simd_shuffle impl
bjorn3 Sep 15, 2024
1e96021
Add test for _mm_cmpestri
bjorn3 Sep 15, 2024
16cee89
Avoid mir_operand_get_const_val hack for simd_insert and simd_extract
bjorn3 Sep 15, 2024
eee42f2
Fix rustc test suite
bjorn3 Sep 15, 2024
5349365
Use unconditional download-ci-llvm in setup_rust_fork.sh
bjorn3 Sep 15, 2024
37204ee
Use associative type defaults in `{Layout,FnAbi}OfHelpers`.
nnethercote Sep 16, 2024
3dcb5a3
Add str.as_str() for easy dereferencing of Box<str>
kornelski Aug 25, 2024
753271c
aarch64 neon intrinsics: vmaxq_f32, vminq_f32, vaddvq_f32, vrndnq_f32…
tjamaan Sep 19, 2024
c2ccd89
handle unsized consts with type `str` in v0 symbol mangling
Jaic1 Sep 14, 2024
460abea
Do not unnecessarily eval consts in codegen
compiler-errors Sep 21, 2024
019435b
Remove x86_64-fuchsia and aarch64-fuchsia target aliases
arttet Sep 21, 2024
f48c5ec
Mark and implement 'char::encode_utf16' as const; Rewrite 'encode_utf…
bjoernager Sep 21, 2024
f5686e3
Write return value for `ptr_mask` intrinsic (#1536)
Noratrieb Sep 22, 2024
b511592
std: implement the `random` feature
joboet Aug 15, 2024
9e9bd9e
std: switch to faster random sources on macOS and most BSDs
joboet Aug 17, 2024
2dbc190
miri: shim `CCRandomGenerateBytes`
joboet Aug 18, 2024
b3af6b6
random: add tracking issue, address other comments
joboet Sep 22, 2024
95469dc
No longer mark RTN as incomplete
compiler-errors Sep 21, 2024
f95e4c9
update miri test
joboet Sep 22, 2024
1d53572
Sync from rust 1d68e6dd1deef26c5aeb91aee554edbee8b6d5e2
bjorn3 Sep 22, 2024
27b21af
Rustup to rustc 1.83.0-nightly (1d68e6dd1 2024-09-21)
bjorn3 Sep 22, 2024
3b8089a
Introduce structurally_normalize_const, use it in hir_typeck
compiler-errors Sep 22, 2024
2daf076
Mark 'make_ascii_uppercase' and 'make_ascii_lowercase' in 'u8' as con…
bjoernager Sep 22, 2024
8f57949
Don't call const normalize in error reporting
compiler-errors Sep 22, 2024
01d19d7
Don't call try_eval_target_usize in error reporting
compiler-errors Sep 22, 2024
ab7777f
Fix rustc test suite
bjorn3 Sep 22, 2024
2273aee
Replace calls to Const::eval in mir build
compiler-errors Sep 22, 2024
2eba81a
Merge commit 'ab7777f9827e09c36ccdbb7e90b5c39eb1748f31' into sync_cg_…
bjorn3 Sep 22, 2024
afad3fb
Revert change to apply_patches to fix panic
bjorn3 Sep 22, 2024
e9b0bc9
Add test for `available_parallelism()`
Sep 22, 2024
ff3a9f4
tests: Remove spuriously failing vec-tryinto-array codegen test
workingjubilee Sep 22, 2024
467ed3c
Rollup merge of #129201 - joboet:random_faster_sources, r=joshtriplett
workingjubilee Sep 23, 2024
6743ad1
Rollup merge of #129550 - kornelski:boxasstr, r=joshtriplett,dtolnay
workingjubilee Sep 23, 2024
76afa09
Rollup merge of #130344 - Jaic1:fix-116306, r=BoxyUwU
workingjubilee Sep 23, 2024
c51bb32
Rollup merge of #130657 - arttet:fix/fuchsia, r=jieyouxu
workingjubilee Sep 23, 2024
d29c70b
Rollup merge of #130659 - bjoernager:const-char-encode-utf16, r=dtolnay
workingjubilee Sep 23, 2024
01a4d75
Rollup merge of #130705 - compiler-errors:rtn-complete, r=jackh726
workingjubilee Sep 23, 2024
3cb0ee5
Rollup merge of #130712 - compiler-errors:const-eval-error-reporting,…
workingjubilee Sep 23, 2024
d6481a1
Rollup merge of #130713 - bjoernager:const-char-make-ascii, r=Noratrieb
workingjubilee Sep 23, 2024
bd4d93f
Rollup merge of #130714 - compiler-errors:try-structurally-resolve-co…
workingjubilee Sep 23, 2024
fc5b4d3
Rollup merge of #130715 - compiler-errors:mir-build-const-eval, r=Box…
workingjubilee Sep 23, 2024
9546c83
Rollup merge of #130716 - bjorn3:sync_cg_clif-2024-09-22, r=bjorn3
workingjubilee Sep 23, 2024
7359463
Rollup merge of #130723 - D0liphin:master, r=workingjubilee
workingjubilee Sep 23, 2024
9aa065d
Rollup merge of #130726 - workingjubilee:put-the-spurs-to-this-test, …
workingjubilee Sep 23, 2024
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: 1 addition & 1 deletion compiler/rustc_codegen_cranelift/.cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ task:
freebsd_instance:
image: freebsd-13-2-release-amd64
setup_rust_script:
- pkg install -y git bash binutils
- pkg install -y git-tiny binutils
- curl https://sh.rustup.rs -sSf --output rustup.sh
- sh rustup.sh --default-toolchain none -y --profile=minimal
target_cache:
Expand Down
3 changes: 1 addition & 2 deletions compiler/rustc_codegen_cranelift/.github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -279,8 +279,7 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 10
if: ${{ github.ref == 'refs/heads/master' }}
# FIXME add the bench job back to the dependency list once rust-lang/rust#125493 gets merged
needs: [rustfmt, test, dist]
needs: [rustfmt, test, bench, dist]

permissions:
contents: write # for creating the dev tag and release
Expand Down
64 changes: 32 additions & 32 deletions compiler/rustc_codegen_cranelift/Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -46,24 +46,24 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"

[[package]]
name = "cranelift-bforest"
version = "0.110.1"
version = "0.111.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "effa84ab2023f7138045ece6b326588c17447ca22e66db71ec15cb0a6c0c4ad2"
checksum = "b80c3a50b9c4c7e5b5f73c0ed746687774fc9e36ef652b110da8daebf0c6e0e6"
dependencies = [
"cranelift-entity",
]

[[package]]
name = "cranelift-bitset"
version = "0.110.1"
version = "0.111.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "38a1dfc50dca188a15d938867c4400589530bcb0138f7022aae6d059d1d8c309"
checksum = "38778758c2ca918b05acb2199134e0c561fb577c50574259b26190b6c2d95ded"

[[package]]
name = "cranelift-codegen"
version = "0.110.1"
version = "0.111.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "821c20c639350158ecca928dc2a244d0d1c9cef2377a378fc62a445a286eb1ca"
checksum = "58258667ad10e468bfc13a8d620f50dfcd4bb35d668123e97defa2549b9ad397"
dependencies = [
"bumpalo",
"cranelift-bforest",
Expand All @@ -84,42 +84,42 @@ dependencies = [

[[package]]
name = "cranelift-codegen-meta"
version = "0.110.1"
version = "0.111.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "064473f2fd59b44fa2c9aaa60de1f9c44db5e13521e28bc85d2b92ee535ef625"
checksum = "043f0b702e529dcb07ff92bd7d40e7d5317b5493595172c5eb0983343751ee06"
dependencies = [
"cranelift-codegen-shared",
]

[[package]]
name = "cranelift-codegen-shared"
version = "0.110.1"
version = "0.111.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d0f39b9ebfd2febdc2acfb9a0fca110665bcd5a6839502576307735ed07b2177"
checksum = "7763578888ab53eca5ce7da141953f828e82c2bfadcffc106d10d1866094ffbb"

[[package]]
name = "cranelift-control"
version = "0.110.1"
version = "0.111.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "94e125c189c3a1ca8dfe209fc6f46edba058a6d24e0b92aff69459a15f4711e7"
checksum = "32db15f08c05df570f11e8ab33cb1ec449a64b37c8a3498377b77650bef33d8b"
dependencies = [
"arbitrary",
]

[[package]]
name = "cranelift-entity"
version = "0.110.1"
version = "0.111.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ea62eb109baec2247e1a6fa7b74c0f584b1e76e289cfd7017385b4b031fc8450"
checksum = "5289cdb399381a27e7bbfa1b42185916007c3d49aeef70b1d01cb4caa8010130"
dependencies = [
"cranelift-bitset",
]

[[package]]
name = "cranelift-frontend"
version = "0.110.1"
version = "0.111.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "722b089357aacb6c7528b2e59a5fe00917d61ce63448b25a3e477a5b7819fac8"
checksum = "31ba8ab24eb9470477e98ddfa3c799a649ac5a0d9a2042868c4c952133c234e8"
dependencies = [
"cranelift-codegen",
"log",
Expand All @@ -129,15 +129,15 @@ dependencies = [

[[package]]
name = "cranelift-isle"
version = "0.110.1"
version = "0.111.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c4b5005a48288e7fc2a2991a377831c534e26929b063c379c018060727785a9b"
checksum = "2b72a3c5c166a70426dcb209bdd0bb71a787c1ea76023dc0974fbabca770e8f9"

[[package]]
name = "cranelift-jit"
version = "0.110.1"
version = "0.111.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f843932baf8d1025c5f114b929eda172d74b7163d058e0de2597c308b567c7e9"
checksum = "df32578a47582e49b4fc1f9a5786839d9be1fedaa9f00bea7612c54425663c6b"
dependencies = [
"anyhow",
"cranelift-codegen",
Expand All @@ -155,9 +155,9 @@ dependencies = [

[[package]]
name = "cranelift-module"
version = "0.110.1"
version = "0.111.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "449819ef1c4af139cf1b9717916fcaea0e23248853d3e95135139773a842d3eb"
checksum = "96094a758cdb543c9143f70817cd31069fecd49f50981a0fac06820ac011dc2f"
dependencies = [
"anyhow",
"cranelift-codegen",
Expand All @@ -166,9 +166,9 @@ dependencies = [

[[package]]
name = "cranelift-native"
version = "0.110.1"
version = "0.111.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3ae2d48f38081a9e679ad795bd36bb29bedeb5552fc1c195185bf9885fa1b16e"
checksum = "46a42424c956bbc31fc5c2706073df896156c5420ae8fa2a5d48dbc7b295d71b"
dependencies = [
"cranelift-codegen",
"libc",
Expand All @@ -177,9 +177,9 @@ dependencies = [

[[package]]
name = "cranelift-object"
version = "0.110.1"
version = "0.111.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3a39ee2cfd0ec485eca76f6b4dc17701a280fa406bc05137bb43f1635ed12c9f"
checksum = "1cf5e2484ab47fe38a3150747cdd2016535f13542a925acca152b63383a6591b"
dependencies = [
"anyhow",
"cranelift-codegen",
Expand Down Expand Up @@ -213,9 +213,9 @@ checksum = "2acce4a10f12dc2fb14a218589d4f1f62ef011b2d0cc4b3cb1bba8e94da14649"

[[package]]
name = "gimli"
version = "0.28.1"
version = "0.29.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253"
checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd"
dependencies = [
"fallible-iterator",
"indexmap",
Expand Down Expand Up @@ -403,9 +403,9 @@ dependencies = [

[[package]]
name = "target-lexicon"
version = "0.12.15"
version = "0.12.16"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4873307b7c257eddcb50c9bedf158eb669578359fb28428bef438fec8e6ba7c2"
checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1"

[[package]]
name = "unicode-ident"
Expand All @@ -421,9 +421,9 @@ checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f"

[[package]]
name = "wasmtime-jit-icache-coherence"
version = "23.0.1"
version = "24.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7fddf3e2980fb1d123d1fcac55189e417fdd3dba4f62139b5a0a1f9efe5669d5"
checksum = "d15de8429db996f0d17a4163a35eccc3f874cbfb50f29c379951ea1bbb39452e"
dependencies = [
"anyhow",
"cfg-if",
Expand Down
14 changes: 7 additions & 7 deletions compiler/rustc_codegen_cranelift/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ crate-type = ["dylib"]

[dependencies]
# These have to be in sync with each other
cranelift-codegen = { version = "0.110.1", default-features = false, features = ["std", "unwind", "all-arch"] }
cranelift-frontend = { version = "0.110.1" }
cranelift-module = { version = "0.110.1" }
cranelift-native = { version = "0.110.1" }
cranelift-jit = { version = "0.110.1", optional = true }
cranelift-object = { version = "0.110.1" }
cranelift-codegen = { version = "0.111.0", default-features = false, features = ["std", "unwind", "all-arch"] }
cranelift-frontend = { version = "0.111.0" }
cranelift-module = { version = "0.111.0" }
cranelift-native = { version = "0.111.0" }
cranelift-jit = { version = "0.111.0", optional = true }
cranelift-object = { version = "0.111.0" }
target-lexicon = "0.12.0"
gimli = { version = "0.28", default-features = false, features = ["write"]}
gimli = { version = "0.29", default-features = false, features = ["write"] }
object = { version = "0.36", default-features = false, features = ["std", "read_core", "write", "archive", "coff", "elf", "macho", "pe"] }

indexmap = "2.0.0"
Expand Down
9 changes: 3 additions & 6 deletions compiler/rustc_codegen_cranelift/build_system/abi_cafe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ static ABI_CAFE_REPO: GitRepo = GitRepo::github(
static ABI_CAFE: CargoProject = CargoProject::new(&ABI_CAFE_REPO.source_dir(), "abi_cafe_target");

pub(crate) fn run(
channel: &str,
sysroot_kind: SysrootKind,
dirs: &Dirs,
cg_clif_dylib: &CodegenBackend,
Expand All @@ -28,7 +27,6 @@ pub(crate) fn run(
eprintln!("Building sysroot for abi-cafe");
build_sysroot::build_sysroot(
dirs,
channel,
sysroot_kind,
cg_clif_dylib,
bootstrap_host_compiler,
Expand All @@ -38,12 +36,11 @@ pub(crate) fn run(

eprintln!("Running abi-cafe");

let pairs = ["rustc_calls_cgclif", "cgclif_calls_rustc", "cgclif_calls_cc", "cc_calls_cgclif"];
let pairs =
let pairs: &[_] =
if cfg!(not(any(target_os = "macos", all(target_os = "windows", target_env = "msvc")))) {
&pairs[..]
&["rustc_calls_cgclif", "cgclif_calls_rustc", "cgclif_calls_cc", "cc_calls_cgclif"]
} else {
&pairs[..2]
&["rustc_calls_cgclif", "cgclif_calls_rustc"]
};

let mut cmd = ABI_CAFE.run(bootstrap_host_compiler, dirs);
Expand Down
37 changes: 36 additions & 1 deletion compiler/rustc_codegen_cranelift/build_system/bench.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
use std::env;
use std::io::Write;
use std::path::Path;
use std::process::Command;

use crate::path::{Dirs, RelPath};
use crate::prepare::GitRepo;
use crate::rustc_info::get_file_name;
use crate::utils::{hyperfine_command, spawn_and_wait, Compiler};
use crate::utils::{spawn_and_wait, Compiler};

static SIMPLE_RAYTRACER_REPO: GitRepo = GitRepo::github(
"ebobby",
Expand Down Expand Up @@ -128,3 +129,37 @@ fn benchmark_simple_raytracer(dirs: &Dirs, bootstrap_host_compiler: &Compiler) {
gha_step_summary.write_all(b"\n").unwrap();
}
}

#[must_use]
fn hyperfine_command(
warmup: u64,
runs: u64,
prepare: Option<&str>,
cmds: &[(&str, &str)],
markdown_export: &Path,
) -> Command {
let mut bench = Command::new("hyperfine");

bench.arg("--export-markdown").arg(markdown_export);

if warmup != 0 {
bench.arg("--warmup").arg(warmup.to_string());
}

if runs != 0 {
bench.arg("--runs").arg(runs.to_string());
}

if let Some(prepare) = prepare {
bench.arg("--prepare").arg(prepare);
}

for &(name, cmd) in cmds {
if name != "" {
bench.arg("-n").arg(name);
}
bench.arg(cmd);
}

bench
}
17 changes: 4 additions & 13 deletions compiler/rustc_codegen_cranelift/build_system/build_backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@ use crate::rustc_info::get_file_name;
use crate::shared_utils::{rustflags_from_env, rustflags_to_cmd_env};
use crate::utils::{CargoProject, Compiler, LogGroup};

pub(crate) static CG_CLIF: CargoProject = CargoProject::new(&RelPath::SOURCE, "cg_clif");
static CG_CLIF: CargoProject = CargoProject::new(&RelPath::SOURCE, "cg_clif");

pub(crate) fn build_backend(
dirs: &Dirs,
channel: &str,
bootstrap_host_compiler: &Compiler,
use_unstable_features: bool,
) -> PathBuf {
Expand All @@ -19,8 +18,8 @@ pub(crate) fn build_backend(
let mut cmd = CG_CLIF.build(&bootstrap_host_compiler, dirs);

let mut rustflags = rustflags_from_env("RUSTFLAGS");

rustflags.push("-Zallow-features=rustc_private".to_owned());
rustflags_to_cmd_env(&mut cmd, "RUSTFLAGS", &rustflags);

if env::var("CG_CLIF_EXPENSIVE_CHECKS").is_ok() {
// Enabling debug assertions implicitly enables the clif ir verifier
Expand All @@ -32,22 +31,14 @@ pub(crate) fn build_backend(
cmd.arg("--features").arg("unstable-features");
}

match channel {
"debug" => {}
"release" => {
cmd.arg("--release");
}
_ => unreachable!(),
}

rustflags_to_cmd_env(&mut cmd, "RUSTFLAGS", &rustflags);
cmd.arg("--release");

eprintln!("[BUILD] rustc_codegen_cranelift");
crate::utils::spawn_and_wait(cmd);

CG_CLIF
.target_dir(dirs)
.join(&bootstrap_host_compiler.triple)
.join(channel)
.join("release")
.join(get_file_name(&bootstrap_host_compiler.rustc, "rustc_codegen_cranelift", "dylib"))
}
Loading
Loading