From a8a7f847b9a58e57baf80e2a7160eaa3c29a8945 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Mon, 6 Mar 2023 09:14:13 +0100 Subject: [PATCH 1/4] Update host compiler to LLVM 16 This updates the host compiler for dist-x86_64-linux to LLVM 16, pulling in the BOLT fix at https://github.com/llvm/llvm-project/commit/1de305da428598d79b7d2d9e70962130142f7ca4, which is needed to update Rust to LLVM 16. --- src/ci/docker/host-x86_64/dist-x86_64-linux/build-clang.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ci/docker/host-x86_64/dist-x86_64-linux/build-clang.sh b/src/ci/docker/host-x86_64/dist-x86_64-linux/build-clang.sh index 9abfd4e9731..de0fb95efd0 100755 --- a/src/ci/docker/host-x86_64/dist-x86_64-linux/build-clang.sh +++ b/src/ci/docker/host-x86_64/dist-x86_64-linux/build-clang.sh @@ -4,7 +4,7 @@ set -ex source shared.sh -LLVM=llvmorg-15.0.0 +LLVM=llvmorg-16.0.0-rc4 mkdir llvm-project cd llvm-project From f4f322c6741f3fc3221642516dd9838eeadc8e57 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Mon, 23 Jan 2023 11:33:33 +0100 Subject: [PATCH 2/4] Upgrade to LLVM 16 --- .gitmodules | 2 +- src/llvm-project | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitmodules b/.gitmodules index e79f2f089c1..0bbccb57130 100644 --- a/.gitmodules +++ b/.gitmodules @@ -25,7 +25,7 @@ [submodule "src/llvm-project"] path = src/llvm-project url = https://github.com/rust-lang/llvm-project.git - branch = rustc/15.0-2022-12-07 + branch = rustc/16.0-2023-03-06 [submodule "src/doc/embedded-book"] path = src/doc/embedded-book url = https://github.com/rust-embedded/book.git diff --git a/src/llvm-project b/src/llvm-project index fd949f3034f..4bb5eab6ac3 160000 --- a/src/llvm-project +++ b/src/llvm-project @@ -1 +1 @@ -Subproject commit fd949f3034f8a422ecfffa889c2823485dde4bdd +Subproject commit 4bb5eab6ac3faea4ab4e53c432a1643c3acec87e From 183f00c25e209f3dc8912cf505833d519344d726 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Sat, 11 Mar 2023 16:51:33 +0100 Subject: [PATCH 3/4] Initialize rust_info before is_ci_llvm_available() --- src/bootstrap/config.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/bootstrap/config.rs b/src/bootstrap/config.rs index 58729f396f0..0fee094c222 100644 --- a/src/bootstrap/config.rs +++ b/src/bootstrap/config.rs @@ -1153,6 +1153,11 @@ fn parse_inner<'a>(args: &[String], get_toml: impl 'a + Fn(&Path) -> TomlConfig) config.rust_profile_generate = flags.rust_profile_generate; } + // rust_info must be set before is_ci_llvm_available() is called. + let default = config.channel == "dev"; + config.ignore_git = ignore_git.unwrap_or(default); + config.rust_info = GitInfo::new(config.ignore_git, &config.src); + if let Some(llvm) = toml.llvm { match llvm.ccache { Some(StringOrBool::String(ref s)) => config.ccache = Some(s.to_string()), @@ -1346,10 +1351,6 @@ fn parse_inner<'a>(args: &[String], get_toml: impl 'a + Fn(&Path) -> TomlConfig) config.rust_debuginfo_level_tools = with_defaults(debuginfo_level_tools); config.rust_debuginfo_level_tests = debuginfo_level_tests.unwrap_or(0); - let default = config.channel == "dev"; - config.ignore_git = ignore_git.unwrap_or(default); - config.rust_info = GitInfo::new(config.ignore_git, &config.src); - let download_rustc = config.download_rustc_commit.is_some(); // See https://github.com/rust-lang/compiler-team/issues/326 config.stage = match config.cmd { From b238a76f652390a486e5480b791abe0cd427add5 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Wed, 15 Mar 2023 17:20:56 +0100 Subject: [PATCH 4/4] Increase array size in array-map.rs Make sure that the loop is not fully unrolled (which allows eliminating the allocas) in LLVM 16 either. --- tests/codegen/array-map.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/codegen/array-map.rs b/tests/codegen/array-map.rs index 9298e89e397..7b8ab2c79a7 100644 --- a/tests/codegen/array-map.rs +++ b/tests/codegen/array-map.rs @@ -38,10 +38,10 @@ // // CHECK-LABEL: @long_integer_map #[no_mangle] -pub fn long_integer_map(x: [u32; 64]) -> [u32; 64] { +pub fn long_integer_map(x: [u32; 512]) -> [u32; 512] { // CHECK: start: - // CHECK-NEXT: alloca [64 x i32] - // CHECK-NEXT: alloca %"core::mem::manually_drop::ManuallyDrop<[u32; 64]>" + // CHECK-NEXT: alloca [512 x i32] + // CHECK-NEXT: alloca %"core::mem::manually_drop::ManuallyDrop<[u32; 512]>" // CHECK-NOT: alloca // CHECK: mul <{{[0-9]+}} x i32> // CHECK: add <{{[0-9]+}} x i32>