File tree Expand file tree Collapse file tree 2 files changed +6
-13
lines changed
compiler/rustc_codegen_llvm/src Expand file tree Collapse file tree 2 files changed +6
-13
lines changed Original file line number Diff line number Diff line change 11use crate :: builder:: Builder ;
22use crate :: context:: CodegenCx ;
33use crate :: llvm:: { self , AttributePlace } ;
4- use crate :: llvm_util;
54use crate :: type_:: Type ;
65use crate :: type_of:: LayoutLlvmExt ;
76use crate :: value:: Value ;
@@ -52,15 +51,9 @@ pub trait ArgAttributesExt {
5251}
5352
5453fn should_use_mutable_noalias ( cx : & CodegenCx < ' _ , ' _ > ) -> bool {
55- // LLVM prior to version 12 has known miscompiles in the presence of
56- // noalias attributes (see #54878). Only enable mutable noalias by
57- // default for versions we believe to be safe.
58- cx. tcx
59- . sess
60- . opts
61- . debugging_opts
62- . mutable_noalias
63- . unwrap_or_else ( || llvm_util:: get_version ( ) >= ( 12 , 0 , 0 ) )
54+ // While #84958 has been fixed, mutable noalias is not enabled by default
55+ // in Rust 1.53 out of an abundance of caution.
56+ cx. tcx . sess . opts . debugging_opts . mutable_noalias . unwrap_or ( false )
6457}
6558
6659impl ArgAttributesExt for ArgAttributes {
Original file line number Diff line number Diff line change @@ -43,13 +43,13 @@ pub fn named_borrow<'r>(_: &'r i32) {
4343pub fn unsafe_borrow ( _: & UnsafeInner ) {
4444}
4545
46- // CHECK: @mutable_unsafe_borrow(i16* noalias align 2 dereferenceable(2) %_1)
46+ // CHECK: @mutable_unsafe_borrow(i16* align 2 dereferenceable(2) %_1)
4747// ... unless this is a mutable borrow, those never alias
4848#[ no_mangle]
4949pub fn mutable_unsafe_borrow ( _: & mut UnsafeInner ) {
5050}
5151
52- // CHECK: @mutable_borrow(i32* noalias align 4 dereferenceable(4) %_1)
52+ // CHECK: @mutable_borrow(i32* align 4 dereferenceable(4) %_1)
5353// FIXME #25759 This should also have `nocapture`
5454#[ no_mangle]
5555pub fn mutable_borrow ( _: & mut i32 ) {
@@ -94,7 +94,7 @@ pub fn helper(_: usize) {
9494pub fn slice ( _: & [ u8 ] ) {
9595}
9696
97- // CHECK: @mutable_slice([0 x i8]* noalias nonnull align 1 %_1.0, [[USIZE]] %_1.1)
97+ // CHECK: @mutable_slice([0 x i8]* nonnull align 1 %_1.0, [[USIZE]] %_1.1)
9898// FIXME #25759 This should also have `nocapture`
9999#[ no_mangle]
100100pub fn mutable_slice ( _: & mut [ u8 ] ) {
You can’t perform that action at this time.
0 commit comments