Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 0 additions & 1 deletion compiler/rustc_interface/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -852,7 +852,6 @@ fn test_unstable_options_tracking_hash() {
tracked!(mir_opt_level, Some(4));
tracked!(mir_preserve_ub, true);
tracked!(move_size_limit, Some(4096));
tracked!(mutable_noalias, false);
tracked!(next_solver, NextSolverConfig { coherence: true, globally: true });
tracked!(no_generate_arange_section, true);
tracked!(no_link, true);
Expand Down
2 changes: 0 additions & 2 deletions compiler/rustc_session/src/options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2568,8 +2568,6 @@ options! {
"Whether to remove some of the MIR debug info from methods. Default: None"),
move_size_limit: Option<usize> = (None, parse_opt_number, [TRACKED],
"the size at which the `large_assignments` lint starts to be emitted"),
mutable_noalias: bool = (true, parse_bool, [TRACKED],
"emit noalias metadata for mutable references (default: yes)"),
namespaced_crates: bool = (false, parse_bool, [TRACKED],
"allow crates to be namespaced by other crates (default: no)"),
next_solver: NextSolverConfig = (NextSolverConfig::default(), parse_next_solver_config, [TRACKED],
Expand Down
7 changes: 1 addition & 6 deletions compiler/rustc_ty_utils/src/abi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -366,11 +366,6 @@ fn arg_attrs_for_rust_scalar<'tcx>(
// See https://github.com/rust-lang/unsafe-code-guidelines/issues/326
let noalias_for_box = tcx.sess.opts.unstable_opts.box_noalias;

// LLVM prior to version 12 had known miscompiles in the presence of noalias attributes
// (see #54878), so it was conditionally disabled, but we don't support earlier
// versions at all anymore. We still support turning it off using -Zmutable-noalias.
let noalias_mut_ref = tcx.sess.opts.unstable_opts.mutable_noalias;

// `&T` where `T` contains no `UnsafeCell<U>` is immutable, and can be marked as both
// `readonly` and `noalias`, as LLVM's definition of `noalias` is based solely on memory
// dependencies rather than pointer equality. However this only applies to arguments,
Expand All @@ -379,7 +374,7 @@ fn arg_attrs_for_rust_scalar<'tcx>(
// `&mut T` and `Box<T>` where `T: Unpin` are unique and hence `noalias`.
let no_alias = match kind {
PointerKind::SharedRef { frozen } => frozen,
PointerKind::MutableRef { unpin } => unpin && noalias_mut_ref,
PointerKind::MutableRef { unpin } => unpin,
PointerKind::Box { unpin, global } => unpin && global && noalias_for_box,
};
// We can never add `noalias` in return position; that LLVM attribute has some very surprising semantics
Expand Down
23 changes: 0 additions & 23 deletions tests/codegen-llvm/noalias-flag.rs

This file was deleted.

2 changes: 1 addition & 1 deletion tests/codegen-llvm/noalias-refcell.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//@ compile-flags: -Copt-level=3 -C no-prepopulate-passes -Z mutable-noalias=yes
//@ compile-flags: -Copt-level=3 -C no-prepopulate-passes

#![crate_type = "lib"]

Expand Down
2 changes: 1 addition & 1 deletion tests/codegen-llvm/noalias-rwlockreadguard.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//@ compile-flags: -Copt-level=3 -C no-prepopulate-passes -Z mutable-noalias=yes
//@ compile-flags: -Copt-level=3 -C no-prepopulate-passes

#![crate_type = "lib"]

Expand Down
2 changes: 1 addition & 1 deletion tests/codegen-llvm/noalias-unpin.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//@ compile-flags: -Copt-level=3 -Z mutable-noalias=yes
//@ compile-flags: -Copt-level=3

#![crate_type = "lib"]

Expand Down
Loading