Auto merge of #154455 - jhpratt:rollup-I3JcUWU, r=jhpratt

Rollup of 6 pull requests

Successful merges:

 - rust-lang/rust#152457 (Pass -pg to linker when using -Zinstrument-mcount)
 - rust-lang/rust#154031 (Remove divergence check from check_expr_array)
 - rust-lang/rust#154418 (move many tests out of `ui/unsafe`)
 - rust-lang/rust#154441 (bootstrap: force a CI LLVM stamp bump)
 - rust-lang/rust#153675 (simd_add/sub/mul/neg: document overflow behavior)
 - rust-lang/rust#154430 (Create GPU target notification group)
This commit is contained in:
bors
2026-03-27 09:03:50 +00:00
48 changed files with 65 additions and 11 deletions
@@ -2767,6 +2767,10 @@ fn add_order_independent_options(
cmd.pgo_gen();
}
if sess.opts.unstable_opts.instrument_mcount {
cmd.enable_profiling();
}
if sess.opts.cg.control_flow_guard != CFGuard::Disabled {
cmd.control_flow_guard();
}
@@ -352,6 +352,7 @@ fn add_eh_frame_header(&mut self) {}
fn add_no_exec(&mut self) {}
fn add_as_needed(&mut self) {}
fn reset_per_library_state(&mut self) {}
fn enable_profiling(&mut self) {}
}
impl dyn Linker + '_ {
@@ -732,6 +733,19 @@ fn pgo_gen(&mut self) {
self.link_or_cc_args(&["-u", "__llvm_profile_runtime"]);
}
fn enable_profiling(&mut self) {
// This flag is also used when linking to choose target specific
// libraries needed to enable profiling.
self.cc_arg("-pg");
// On windows-gnu targets, libgmon also needs to be linked, and this
// requires readding libraries to satisfy its dependencies.
if self.sess.target.is_like_windows {
self.cc_arg("-lgmon");
self.cc_arg("-lkernel32");
self.cc_arg("-lmsvcrt");
}
}
fn control_flow_guard(&mut self) {}
fn ehcont_guard(&mut self) {}
-8
View File
@@ -1660,14 +1660,6 @@ fn check_expr_array(
expr: &'tcx hir::Expr<'tcx>,
) -> Ty<'tcx> {
let element_ty = if !args.is_empty() {
// This shouldn't happen unless there's another error
// (e.g., never patterns in inappropriate contexts).
if self.diverges.get() != Diverges::Maybe {
self.dcx()
.struct_span_err(expr.span, "unexpected divergence state in checking array")
.delay_as_bug();
}
let coerce_to = expected
.to_option(self)
.and_then(|uty| {
@@ -106,6 +106,7 @@ pub(crate) fn opts() -> TargetOptions {
// FIXME(davidtwco): Support Split DWARF on Windows GNU - may require LLVM changes to
// output DWO, despite using DWARF, doesn't use ELF..
supported_split_debuginfo: Cow::Borrowed(&[SplitDebuginfo::Off]),
mcount: "_mcount".into(),
..Default::default()
}
}
@@ -53,6 +53,7 @@ pub(crate) fn opts() -> TargetOptions {
// FIXME(davidtwco): Support Split DWARF on Windows GNU - may require LLVM changes to
// output DWO, despite using DWARF, doesn't use ELF..
supported_split_debuginfo: Cow::Borrowed(&[SplitDebuginfo::Off]),
mcount: "_mcount".into(),
..Default::default()
}
}
+4 -2
View File
@@ -62,6 +62,7 @@
/// Adds two simd vectors elementwise.
///
/// `T` must be a vector of integers or floats.
/// For integers, wrapping arithmetic is used.
#[rustc_intrinsic]
#[rustc_nounwind]
pub const unsafe fn simd_add<T>(x: T, y: T) -> T;
@@ -69,6 +70,7 @@
/// Subtracts `rhs` from `lhs` elementwise.
///
/// `T` must be a vector of integers or floats.
/// For integers, wrapping arithmetic is used.
#[rustc_intrinsic]
#[rustc_nounwind]
pub const unsafe fn simd_sub<T>(lhs: T, rhs: T) -> T;
@@ -76,6 +78,7 @@
/// Multiplies two simd vectors elementwise.
///
/// `T` must be a vector of integers or floats.
/// For integers, wrapping arithmetic is used.
#[rustc_intrinsic]
#[rustc_nounwind]
pub const unsafe fn simd_mul<T>(x: T, y: T) -> T;
@@ -233,8 +236,7 @@
/// Negates a vector elementwise.
///
/// `T` must be a vector of integers or floats.
///
/// Rust panics for `-<int>::Min` due to overflow, but it is not UB with this intrinsic.
/// For integers, wrapping arithmetic is used.
#[rustc_intrinsic]
#[rustc_nounwind]
pub const unsafe fn simd_neg<T>(x: T) -> T;
+1 -1
View File
@@ -1,4 +1,4 @@
Change this file to make users of the `download-ci-llvm` configuration download
a new version of LLVM from CI, even if the LLVM submodule hasnt changed.
Last change is for: https://github.com/rust-lang/rust/pull/153179
Last change is for: https://github.com/rust-lang/rust/pull/151063
@@ -0,0 +1,3 @@
fn main() {
println!("Hello World!");
}
@@ -0,0 +1,19 @@
// When building a binary instrumented with mcount, verify the
// binary is linked with the correct crt to enable profiling.
//
//@ only-gnu
//@ ignore-cross-compile
use run_make_support::{path, run, rustc};
fn main() {
// Compile instrumentation enabled binary, and verify -pg is passed
let link_args =
rustc().input("main.rs").arg("-Zinstrument-mcount").print("link-args").run().stdout_utf8();
assert!(link_args.contains("\"-pg\""));
// Run it, and verify gmon.out is created
assert!(!path("gmon.out").exists());
run("main");
assert!(path("gmon.out").exists());
}
@@ -0,0 +1,13 @@
//@ check-pass
//@ edition: 2024
#![feature(never_patterns)]
#![allow(incomplete_features)]
#![allow(unreachable_code)]
fn main() {
let _ = Some({
return;
})
.map(|!| [1]);
}
+5
View File
@@ -194,6 +194,11 @@ Hi relnotes-interest-group, this issue/PR could use some help in reviewing /
adjusting release notes. Could you take a look if available? Thanks <3
"""
[ping.gpu-target]
message = """\
Hi GPU experts, this issue/PR could use some guidance on how this should be
resolved/implemented. Could you take a look if available? Thanks <3
"""
# ------------------------------------------------------------------------------
# Autolabels