Skip to content

Commit

Permalink
Auto merge of rust-lang#127513 - nikic:llvm-19, r=cuviper
Browse files Browse the repository at this point in the history
Update to LLVM 19

The LLVM 19.1.0 final release is planned for Sep 3rd. The rustc 1.82 stable release will be on Oct 17th.

The unstable MC/DC coverage support is temporarily broken by this update. It will be restored by rust-lang#126733. The implementation changed substantially in LLVM 19, and there are no plans to support both the LLVM 18 and LLVM 19 implementation at the same time.

Compatibility note for wasm:

> WebAssembly target support for the `multivalue` target feature has changed when upgrading to LLVM 19. Support for generating functions with multiple returns no longer works and `-Ctarget-feature=+multivalue` has a different meaning than it did in LLVM 18 and prior. The WebAssembly target features `multivalue` and `reference-types` are now both enabled by default, but generated code is not affected by default. These features being enabled are encoded in the `target_features` custom section and may affect downstream tooling such as `wasm-opt` consuming the module, but the actual generated WebAssembly will continue to not use either `multivalue` or `reference-types` by default. There is no longer any supported means to generate a module that has a function with multiple returns.

Related changes:
 * rust-lang#127605
 * rust-lang#127613
 * rust-lang#127654
 * rust-lang#128141
 * llvm/llvm-project#98933

Fixes rust-lang#121444.
Fixes rust-lang#128212.
  • Loading branch information
bors committed Jul 31, 2024
2 parents 249cf71 + b960390 commit 9bb7e05
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
[submodule "src/llvm-project"]
path = src/llvm-project
url = https://github.com/rust-lang/llvm-project.git
branch = rustc/18.1-2024-05-19
branch = rustc/19.1-2024-07-30
shallow = true
[submodule "src/doc/embedded-book"]
path = src/doc/embedded-book
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1555,7 +1555,7 @@ 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
Expand Down
2 changes: 1 addition & 1 deletion src/llvm-project
1 change: 1 addition & 0 deletions tests/coverage/mcdc/condition-limit.rs
Original file line number Diff line number Diff line change
@@ -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

Expand Down
1 change: 1 addition & 0 deletions tests/coverage/mcdc/if.rs
Original file line number Diff line number Diff line change
@@ -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

Expand Down
1 change: 1 addition & 0 deletions tests/coverage/mcdc/inlined_expressions.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#![feature(coverage_attribute)]
//@ edition: 2021
//@ min-llvm-version: 18
//@ ignore-llvm-version: 19 - 99
//@ compile-flags: -Zcoverage-options=mcdc -Copt-level=z -Cllvm-args=--inline-threshold=0
//@ llvm-cov-flags: --show-branches=count --show-mcdc

Expand Down
1 change: 1 addition & 0 deletions tests/coverage/mcdc/nested_if.rs
Original file line number Diff line number Diff line change
@@ -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

Expand Down
1 change: 1 addition & 0 deletions tests/coverage/mcdc/non_control_flow.rs
Original file line number Diff line number Diff line change
@@ -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

Expand Down
6 changes: 4 additions & 2 deletions tests/crashes/121444.rs → tests/ui/abi/large-byval-align.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
//@ known-bug: #121444
//@ compile-flags: -Copt-level=0
//@ edition:2021
//@ only-x86_64
//@ ignore-windows
//@ min-llvm-version: 19
//@ build-pass

#[repr(align(536870912))]
pub struct A(i64);

#[allow(improper_ctypes_definitions)]
pub extern "C" fn foo(x: A) {}

fn main() {
Expand Down

0 comments on commit 9bb7e05

Please sign in to comment.