From 03e0e42d690b937e4ed3400021e8f10a9cd7460e Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Tue, 9 Jul 2024 09:34:59 +0200 Subject: [PATCH 1/5] Update to LLVM 19 --- src/llvm-project | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/llvm-project b/src/llvm-project index c54cff0e6e4d1..7c93dc08e874b 160000 --- a/src/llvm-project +++ b/src/llvm-project @@ -1 +1 @@ -Subproject commit c54cff0e6e4d1a0d0a2df7c1ce3d96cdd554763e +Subproject commit 7c93dc08e874b5253a8721f1ee37b22fbe02b6b5 From 85b5e5aa5d699ed60049023cf99c995b2af6d74d Mon Sep 17 00:00:00 2001 From: Krasimir Georgiev Date: Mon, 17 Jun 2024 09:35:38 +0000 Subject: [PATCH 2/5] llvm-wrapper: adapt for LLVM 19 API change No functional changes intended. The instrprof_mcdc_condbitmap_update intrinsic was dropped in LLVM 19: * https://github.com/llvm/llvm-project/commit/85a7bba7d28365ff98dae74f20ebf9f53d42023a --- compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp b/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp index b6790b7df500b..959efb0befe4e 100644 --- a/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp +++ b/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp @@ -1562,11 +1562,11 @@ LLVMRustGetInstrProfMCDCTVBitmapUpdateIntrinsic(LLVMModuleRef M) { extern "C" LLVMValueRef LLVMRustGetInstrProfMCDCCondBitmapIntrinsic(LLVMModuleRef M) { -#if LLVM_VERSION_GE(18, 0) +#if LLVM_VERSION_GE(18, 0) && LLVM_VERSION_LT(19, 0) return wrap(llvm::Intrinsic::getDeclaration( unwrap(M), llvm::Intrinsic::instrprof_mcdc_condbitmap_update)); #else - report_fatal_error("LLVM 18.0 is required for mcdc intrinsic functions"); + report_fatal_error("The instrprof_mcdc_condbitmap_update only exists in LLVM 18"); #endif } From 8bbc58205a817772b011357bcbe68ecf9f0fb358 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Tue, 9 Jul 2024 10:56:46 +0200 Subject: [PATCH 3/5] Disable mcdc tests --- tests/coverage/mcdc/condition-limit.rs | 1 + tests/coverage/mcdc_if.rs | 1 + tests/coverage/mcdc_nested_if.rs | 1 + tests/coverage/mcdc_non_control_flow.rs | 1 + 4 files changed, 4 insertions(+) diff --git a/tests/coverage/mcdc/condition-limit.rs b/tests/coverage/mcdc/condition-limit.rs index 571c600ebd096..f30672c7b045c 100644 --- a/tests/coverage/mcdc/condition-limit.rs +++ b/tests/coverage/mcdc/condition-limit.rs @@ -1,6 +1,7 @@ #![feature(coverage_attribute)] //@ edition: 2021 //@ min-llvm-version: 18 +//@ ignore-llvm-version: 19-99 //@ compile-flags: -Zcoverage-options=mcdc //@ llvm-cov-flags: --show-branches=count --show-mcdc diff --git a/tests/coverage/mcdc_if.rs b/tests/coverage/mcdc_if.rs index a85843721c6ce..8c8099bf12962 100644 --- a/tests/coverage/mcdc_if.rs +++ b/tests/coverage/mcdc_if.rs @@ -1,6 +1,7 @@ #![feature(coverage_attribute)] //@ edition: 2021 //@ min-llvm-version: 18 +//@ ignore-llvm-version: 19-99 //@ compile-flags: -Zcoverage-options=mcdc //@ llvm-cov-flags: --show-mcdc diff --git a/tests/coverage/mcdc_nested_if.rs b/tests/coverage/mcdc_nested_if.rs index 3d869771f75b5..611618491c875 100644 --- a/tests/coverage/mcdc_nested_if.rs +++ b/tests/coverage/mcdc_nested_if.rs @@ -1,6 +1,7 @@ #![feature(coverage_attribute)] //@ edition: 2021 //@ min-llvm-version: 18 +//@ ignore-llvm-version: 19-99 //@ compile-flags: -Zcoverage-options=mcdc //@ llvm-cov-flags: --show-mcdc diff --git a/tests/coverage/mcdc_non_control_flow.rs b/tests/coverage/mcdc_non_control_flow.rs index 85c0a6c6ae58a..ce252e095da16 100644 --- a/tests/coverage/mcdc_non_control_flow.rs +++ b/tests/coverage/mcdc_non_control_flow.rs @@ -1,6 +1,7 @@ #![feature(coverage_attribute)] //@ edition: 2021 //@ min-llvm-version: 18 +//@ ignore-llvm-version: 19-99 //@ compile-flags: -Zcoverage-options=mcdc //@ llvm-cov-flags: --show-mcdc From 4d352f4a4d53bed56fd7f500ac4fbc9b422c2daa Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Tue, 9 Jul 2024 11:00:47 +0200 Subject: [PATCH 4/5] Ignore failing vec-in-place.rs test --- tests/codegen/vec-in-place.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/codegen/vec-in-place.rs b/tests/codegen/vec-in-place.rs index c6b77363a4e50..f257f6b4528e4 100644 --- a/tests/codegen/vec-in-place.rs +++ b/tests/codegen/vec-in-place.rs @@ -1,5 +1,6 @@ //@ ignore-debug: FIXME: checks for call detect scoped noalias metadata //@ compile-flags: -O -Z merge-functions=disabled +//@ ignore-llvm-version: 19-99 #![crate_type = "lib"] // Ensure that trivial casts of vec elements are O(1) From a23e9a52b81a9609fb8c9ac761f10faad5a16617 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Tue, 9 Jul 2024 11:37:31 +0200 Subject: [PATCH 5/5] update submodule reference --- .gitmodules | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitmodules b/.gitmodules index 9ad207a0d5226..dea2f144bede6 100644 --- a/.gitmodules +++ b/.gitmodules @@ -32,8 +32,8 @@ shallow = true [submodule "src/llvm-project"] path = src/llvm-project - url = https://github.com/rust-lang/llvm-project.git - branch = rustc/18.1-2024-05-19 + url = https://github.com/nikic/llvm-project.git + branch = rust-llvm-19 shallow = true [submodule "src/doc/embedded-book"] path = src/doc/embedded-book