diff options
| author | bors <bors@rust-lang.org> | 2021-03-21 21:54:09 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2021-03-21 21:54:09 +0000 |
| commit | 97663b6690689379aa0493deb494dfe14627c46b (patch) | |
| tree | db6239ac4e1a2b0da3a393e7c2b8751b3d7c2979 /src/test/codegen/function-arguments.rs | |
| parent | f82664191d0e8764b7435b9d72eb0e366b8b1464 (diff) | |
| parent | 68a62b76d49328719c491da385b1123721689523 (diff) | |
| download | rust-97663b6690689379aa0493deb494dfe14627c46b.tar.gz rust-97663b6690689379aa0493deb494dfe14627c46b.zip | |
Auto merge of #82834 - nikic:mutable-noalias, r=nagisa
Enable mutable noalias for LLVM >= 12 Enable mutable noalias by default on LLVM 12, as previously known miscompiles have been resolved. Now it's time to find the next one ;) * The `-Z mutable-noalias` option no longer has an explicit default and accepts `-Z mutable-noalias=yes` and `-Z mutable-noalias=no` to override the LLVM version based default behavior. * The decision on whether to apply the noalias attribute is moved into rustc_codegen_llvm. rustc_middle only provides us with the necessary information to make the decision. * `noalias` is not emitted for types that are `!Unpin`, as a heuristic for self-referential structures (see #54878 and #63818).
Diffstat (limited to 'src/test/codegen/function-arguments.rs')
| -rw-r--r-- | src/test/codegen/function-arguments.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/test/codegen/function-arguments.rs b/src/test/codegen/function-arguments.rs index a1da4faf5d8..0c34bf1b914 100644 --- a/src/test/codegen/function-arguments.rs +++ b/src/test/codegen/function-arguments.rs @@ -1,4 +1,4 @@ -// compile-flags: -C no-prepopulate-passes +// compile-flags: -O -C no-prepopulate-passes // ignore-tidy-linelength // min-system-llvm-version: 12.0 @@ -43,13 +43,13 @@ pub fn named_borrow<'r>(_: &'r i32) { pub fn unsafe_borrow(_: &UnsafeInner) { } -// CHECK: @mutable_unsafe_borrow(i16* align 2 dereferenceable(2) %_1) +// CHECK: @mutable_unsafe_borrow(i16* noalias align 2 dereferenceable(2) %_1) // ... unless this is a mutable borrow, those never alias #[no_mangle] pub fn mutable_unsafe_borrow(_: &mut UnsafeInner) { } -// CHECK: @mutable_borrow(i32* align 4 dereferenceable(4) %_1) +// CHECK: @mutable_borrow(i32* noalias align 4 dereferenceable(4) %_1) // FIXME #25759 This should also have `nocapture` #[no_mangle] pub fn mutable_borrow(_: &mut i32) { @@ -94,7 +94,7 @@ pub fn helper(_: usize) { pub fn slice(_: &[u8]) { } -// CHECK: @mutable_slice([0 x i8]* nonnull align 1 %_1.0, [[USIZE]] %_1.1) +// CHECK: @mutable_slice([0 x i8]* noalias nonnull align 1 %_1.0, [[USIZE]] %_1.1) // FIXME #25759 This should also have `nocapture` #[no_mangle] pub fn mutable_slice(_: &mut [u8]) { |
