File tree 2 files changed +6
-13
lines changed
compiler/rustc_codegen_llvm/src
2 files changed +6
-13
lines changed Original file line number Diff line number Diff line change 1
1
use crate :: builder:: Builder ;
2
2
use crate :: context:: CodegenCx ;
3
3
use crate :: llvm:: { self , AttributePlace } ;
4
- use crate :: llvm_util;
5
4
use crate :: type_:: Type ;
6
5
use crate :: type_of:: LayoutLlvmExt ;
7
6
use crate :: value:: Value ;
@@ -52,15 +51,9 @@ pub trait ArgAttributesExt {
52
51
}
53
52
54
53
fn 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 )
64
57
}
65
58
66
59
impl ArgAttributesExt for ArgAttributes {
Original file line number Diff line number Diff line change @@ -43,13 +43,13 @@ pub fn named_borrow<'r>(_: &'r i32) {
43
43
pub fn unsafe_borrow ( _: & UnsafeInner ) {
44
44
}
45
45
46
- // CHECK: @mutable_unsafe_borrow(i16* noalias align 2 dereferenceable(2) %_1)
46
+ // CHECK: @mutable_unsafe_borrow(i16* align 2 dereferenceable(2) %_1)
47
47
// ... unless this is a mutable borrow, those never alias
48
48
#[ no_mangle]
49
49
pub fn mutable_unsafe_borrow ( _: & mut UnsafeInner ) {
50
50
}
51
51
52
- // CHECK: @mutable_borrow(i32* noalias align 4 dereferenceable(4) %_1)
52
+ // CHECK: @mutable_borrow(i32* align 4 dereferenceable(4) %_1)
53
53
// FIXME #25759 This should also have `nocapture`
54
54
#[ no_mangle]
55
55
pub fn mutable_borrow ( _: & mut i32 ) {
@@ -94,7 +94,7 @@ pub fn helper(_: usize) {
94
94
pub fn slice ( _: & [ u8 ] ) {
95
95
}
96
96
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)
98
98
// FIXME #25759 This should also have `nocapture`
99
99
#[ no_mangle]
100
100
pub fn mutable_slice ( _: & mut [ u8 ] ) {
You can’t perform that action at this time.
0 commit comments