Skip to content

Commit 3984bc5

Browse files
committed
Auto merge of rust-lang#106294 - Nilstrieb:noundef-everything, r=nikic
Put `noundef` on all scalars that don't allow uninit Previously, it was only put on scalars with range validity invariants like bool, was uninit was obviously invalid for those. Since then, we have normatively declared all uninit primitives to be undefined behavior and can therefore put `noundef` on them. The remaining concern was the `mem::uninitialized` function, which cause quite a lot of UB in the older parts of the ecosystem. After rust-lang#99182, this function now doesn't return uninit values anymore, making users of it safe from this change. The only real sources of UB where people could encounter uninit primitives are `MaybeUninit::uninit().assume_init()`, which has always be clear in the docs about being UB and from heap allocations (like reading from the spare capacity of a vec). This is hopefully rare enough to not break anything. cc `@nagisa` `@scottmcm` `@nikic`
2 parents 38a76f3 + f125538 commit 3984bc5

39 files changed

+130
-109
lines changed

compiler/rustc_codegen_llvm/src/builder.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -501,7 +501,7 @@ impl<'a, 'll, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'll, 'tcx> {
501501
layout: TyAndLayout<'tcx>,
502502
offset: Size,
503503
) {
504-
if !scalar.is_always_valid(bx) {
504+
if !scalar.is_uninit_valid() {
505505
bx.noundef_metadata(load);
506506
}
507507

compiler/rustc_ty_utils/src/abi.rs

+1-7
Original file line numberDiff line numberDiff line change
@@ -219,8 +219,7 @@ fn adjust_for_rust_scalar<'tcx>(
219219
return;
220220
}
221221

222-
// Scalars which have invalid values cannot be undef.
223-
if !scalar.is_always_valid(&cx) {
222+
if !scalar.is_uninit_valid() {
224223
attrs.set(ArgAttribute::NoUndef);
225224
}
226225

@@ -246,11 +245,6 @@ fn adjust_for_rust_scalar<'tcx>(
246245
PointerKind::SharedMutable | PointerKind::UniqueOwned => Size::ZERO,
247246
};
248247

249-
// `Box`, `&T`, and `&mut T` cannot be undef.
250-
// Note that this only applies to the value of the pointer itself;
251-
// this attribute doesn't make it UB for the pointed-to data to be undef.
252-
attrs.set(ArgAttribute::NoUndef);
253-
254248
// The aliasing rules for `Box<T>` are still not decided, but currently we emit
255249
// `noalias` for it. This can be turned off using an unstable flag.
256250
// See https://github.com/rust-lang/unsafe-code-guidelines/issues/326

tests/codegen/abi-sysv64.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// of the sysv64 abi.
44
//
55
// needs-llvm-components: x86
6-
// compile-flags: -C no-prepopulate-passes --target=x86_64-unknown-linux-gnu
6+
// compile-flags: -C no-prepopulate-passes --target=x86_64-unknown-linux-gnu -Copt-level=0
77

88
#![crate_type = "lib"]
99
#![no_core]

tests/codegen/abi-x86-interrupt.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// of the x86-interrupt abi.
44

55
// needs-llvm-components: x86
6-
// compile-flags: -C no-prepopulate-passes --target=x86_64-unknown-linux-gnu
6+
// compile-flags: -C no-prepopulate-passes --target=x86_64-unknown-linux-gnu -Copt-level=0
77

88
#![crate_type = "lib"]
99
#![no_core]

tests/codegen/adjustments.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// compile-flags: -C no-prepopulate-passes
1+
// compile-flags: -C no-prepopulate-passes -Copt-level=0
22

33
#![crate_type = "lib"]
44

tests/codegen/box-maybe-uninit-llvm14.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,4 @@ pub fn box_uninitialized2() -> Box<MaybeUninit<[usize; 1024 * 1024]>> {
3131
// Hide the LLVM 15+ `allocalign` attribute in the declaration of __rust_alloc
3232
// from the CHECK-NOT above. We don't check the attributes here because we can't rely
3333
// on all of them being set until LLVM 15.
34-
// CHECK: declare noalias{{.*}} @__rust_alloc(i{{[0-9]+}}, i{{[0-9]+.*}})
34+
// CHECK: declare noalias{{.*}} @__rust_alloc(i{{[0-9]+}} noundef, i{{[0-9]+.*}} noundef)

tests/codegen/box-maybe-uninit.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,6 @@ pub fn box_uninitialized2() -> Box<MaybeUninit<[usize; 1024 * 1024]>> {
2828

2929
// Hide the `allocalign` attribute in the declaration of __rust_alloc
3030
// from the CHECK-NOT above, and also verify the attributes got set reasonably.
31-
// CHECK: declare noalias ptr @__rust_alloc(i{{[0-9]+}}, i{{[0-9]+}} allocalign) unnamed_addr [[RUST_ALLOC_ATTRS:#[0-9]+]]
31+
// CHECK: declare noalias noundef ptr @__rust_alloc(i{{[0-9]+}} noundef, i{{[0-9]+}} allocalign noundef) unnamed_addr [[RUST_ALLOC_ATTRS:#[0-9]+]]
3232

3333
// CHECK-DAG: attributes [[RUST_ALLOC_ATTRS]] = { {{.*}} allockind("alloc,uninitialized,aligned") allocsize(0) uwtable "alloc-family"="__rust_alloc" {{.*}} }

tests/codegen/c-variadic.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// ignore-wasm32-bare compiled with panic=abort by default
2-
// compile-flags: -C no-prepopulate-passes
2+
// compile-flags: -C no-prepopulate-passes -Copt-level=0
33
//
44

55
#![crate_type = "lib"]

tests/codegen/call-llvm-intrinsics.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// compile-flags: -C no-prepopulate-passes
1+
// compile-flags: -C no-prepopulate-passes -Copt-level=0
22

33
// ignore-riscv64
44

tests/codegen/comparison-operators-newtype.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use std::cmp::Ordering;
1313
pub struct Foo(u16);
1414

1515
// CHECK-LABEL: @check_lt
16-
// CHECK-SAME: (i16 %[[A:.+]], i16 %[[B:.+]])
16+
// CHECK-SAME: (i16 noundef %[[A:.+]], i16 noundef %[[B:.+]])
1717
#[no_mangle]
1818
pub fn check_lt(a: Foo, b: Foo) -> bool {
1919
// CHECK: %[[R:.+]] = icmp ult i16 %[[A]], %[[B]]
@@ -22,7 +22,7 @@ pub fn check_lt(a: Foo, b: Foo) -> bool {
2222
}
2323

2424
// CHECK-LABEL: @check_le
25-
// CHECK-SAME: (i16 %[[A:.+]], i16 %[[B:.+]])
25+
// CHECK-SAME: (i16 noundef %[[A:.+]], i16 noundef %[[B:.+]])
2626
#[no_mangle]
2727
pub fn check_le(a: Foo, b: Foo) -> bool {
2828
// CHECK: %[[R:.+]] = icmp ule i16 %[[A]], %[[B]]
@@ -31,7 +31,7 @@ pub fn check_le(a: Foo, b: Foo) -> bool {
3131
}
3232

3333
// CHECK-LABEL: @check_gt
34-
// CHECK-SAME: (i16 %[[A:.+]], i16 %[[B:.+]])
34+
// CHECK-SAME: (i16 noundef %[[A:.+]], i16 noundef %[[B:.+]])
3535
#[no_mangle]
3636
pub fn check_gt(a: Foo, b: Foo) -> bool {
3737
// CHECK: %[[R:.+]] = icmp ugt i16 %[[A]], %[[B]]
@@ -40,7 +40,7 @@ pub fn check_gt(a: Foo, b: Foo) -> bool {
4040
}
4141

4242
// CHECK-LABEL: @check_ge
43-
// CHECK-SAME: (i16 %[[A:.+]], i16 %[[B:.+]])
43+
// CHECK-SAME: (i16 noundef %[[A:.+]], i16 noundef %[[B:.+]])
4444
#[no_mangle]
4545
pub fn check_ge(a: Foo, b: Foo) -> bool {
4646
// CHECK: %[[R:.+]] = icmp uge i16 %[[A]], %[[B]]

tests/codegen/dllimports/main.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// This test is for *-windows-msvc only.
1+
// This test is for *-windows-msvc only.
22
// only-windows
33
// ignore-gnu
44

@@ -15,10 +15,10 @@ extern crate wrapper;
1515
// CHECK: @static_global1 = external local_unnamed_addr global i32
1616
// CHECK: @static_global2 = external local_unnamed_addr global i32
1717

18-
// CHECK: declare dllimport i32 @dylib_func1(i32)
19-
// CHECK: declare dllimport i32 @dylib_func2(i32)
20-
// CHECK: declare i32 @static_func1(i32)
21-
// CHECK: declare i32 @static_func2(i32)
18+
// CHECK: declare dllimport noundef i32 @dylib_func1(i32 noundef)
19+
// CHECK: declare dllimport noundef i32 @dylib_func2(i32 noundef)
20+
// CHECK: declare noundef i32 @static_func1(i32 noundef)
21+
// CHECK: declare noundef i32 @static_func2(i32 noundef)
2222

2323
#[link(name = "dummy", kind="dylib")]
2424
extern "C" {

tests/codegen/enum-match.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ pub enum Enum0 {
1111
B,
1212
}
1313

14-
// CHECK: define i8 @match0{{.*}}
14+
// CHECK: define noundef i8 @match0{{.*}}
1515
// CHECK-NEXT: start:
1616
// CHECK-NEXT: %1 = icmp eq i8 %0, 2
1717
// CHECK-NEXT: %2 = and i8 %0, 1
@@ -32,7 +32,7 @@ pub enum Enum1 {
3232
C,
3333
}
3434

35-
// CHECK: define i8 @match1{{.*}}
35+
// CHECK: define noundef i8 @match1{{.*}}
3636
// CHECK-NEXT: start:
3737
// CHECK-NEXT: [[DISCR:%.*]] = {{.*}}call i8 @llvm.usub.sat.i8(i8 %0, i8 1)
3838
// CHECK-NEXT: switch i8 [[DISCR]], label {{.*}} [
@@ -88,7 +88,7 @@ pub enum Enum2 {
8888
E,
8989
}
9090

91-
// CHECK: define i8 @match2{{.*}}
91+
// CHECK: define noundef i8 @match2{{.*}}
9292
// CHECK-NEXT: start:
9393
// CHECK-NEXT: %1 = add i8 %0, 2
9494
// CHECK-NEXT: %2 = zext i8 %1 to i64

tests/codegen/fastcall-inreg.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -15,27 +15,27 @@ trait Sized {}
1515
trait Copy {}
1616

1717
pub mod tests {
18-
// CHECK: @f1(i32 inreg %_1, i32 inreg %_2, i32 %_3)
18+
// CHECK: @f1(i32 inreg noundef %_1, i32 inreg noundef %_2, i32 noundef %_3)
1919
#[no_mangle]
2020
pub extern "fastcall" fn f1(_: i32, _: i32, _: i32) {}
2121

22-
// CHECK: @f2({{i32\*|ptr}} inreg %_1, {{i32\*|ptr}} inreg %_2, {{i32\*|ptr}} %_3)
22+
// CHECK: @f2({{i32\*|ptr}} inreg noundef %_1, {{i32\*|ptr}} inreg noundef %_2, {{i32\*|ptr}} noundef %_3)
2323
#[no_mangle]
2424
pub extern "fastcall" fn f2(_: *const i32, _: *const i32, _: *const i32) {}
2525

26-
// CHECK: @f3(float %_1, i32 inreg %_2, i32 inreg %_3, i32 %_4)
26+
// CHECK: @f3(float noundef %_1, i32 inreg noundef %_2, i32 inreg noundef %_3, i32 noundef %_4)
2727
#[no_mangle]
2828
pub extern "fastcall" fn f3(_: f32, _: i32, _: i32, _: i32) {}
2929

30-
// CHECK: @f4(i32 inreg %_1, float %_2, i32 inreg %_3, i32 %_4)
30+
// CHECK: @f4(i32 inreg noundef %_1, float noundef %_2, i32 inreg noundef %_3, i32 noundef %_4)
3131
#[no_mangle]
3232
pub extern "fastcall" fn f4(_: i32, _: f32, _: i32, _: i32) {}
3333

34-
// CHECK: @f5(i64 %_1, i32 %_2)
34+
// CHECK: @f5(i64 noundef %_1, i32 noundef %_2)
3535
#[no_mangle]
3636
pub extern "fastcall" fn f5(_: i64, _: i32) {}
3737

38-
// CHECK: @f6(i1 inreg noundef zeroext %_1, i32 inreg %_2, i32 %_3)
38+
// CHECK: @f6(i1 inreg noundef zeroext %_1, i32 inreg noundef %_2, i32 noundef %_3)
3939
#[no_mangle]
4040
pub extern "fastcall" fn f6(_: bool, _: i32, _: i32) {}
4141
}

tests/codegen/fewer-names.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@
77

88
#[no_mangle]
99
pub fn sum(x: u32, y: u32) -> u32 {
10-
// YES-LABEL: define{{.*}}i32 @sum(i32 %0, i32 %1)
10+
// YES-LABEL: define{{.*}}i32 @sum(i32 noundef %0, i32 noundef %1)
1111
// YES-NEXT: %3 = add i32 %1, %0
1212
// YES-NEXT: ret i32 %3
1313

14-
// NO-LABEL: define{{.*}}i32 @sum(i32 %x, i32 %y)
14+
// NO-LABEL: define{{.*}}i32 @sum(i32 noundef %x, i32 noundef %y)
1515
// NO-NEXT: start:
1616
// NO-NEXT: %z = add i32 %y, %x
1717
// NO-NEXT: ret i32 %z

tests/codegen/frame-pointer.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// compile-flags: --crate-type=rlib
1+
// compile-flags: --crate-type=rlib -Copt-level=0
22
// revisions: aarch64-apple aarch64-linux force x64-apple x64-linux
33
// [aarch64-apple] needs-llvm-components: aarch64
44
// [aarch64-apple] compile-flags: --target=aarch64-apple-darwin

tests/codegen/function-arguments.rs

+42-16
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
// compile-flags: -O -C no-prepopulate-passes
22

33
#![crate_type = "lib"]
4-
#![feature(rustc_attrs)]
54

65
use std::mem::MaybeUninit;
76
use std::num::NonZeroU64;
87
use std::marker::PhantomPinned;
8+
use std::ptr::NonNull;
99

1010
pub struct S {
1111
_field: [i32; 8],
@@ -61,7 +61,7 @@ pub fn maybeuninit_char(x: MaybeUninit<char>) -> MaybeUninit<char> {
6161
x
6262
}
6363

64-
// CHECK: i64 @int(i64 %x)
64+
// CHECK: noundef i64 @int(i64 noundef %x)
6565
#[no_mangle]
6666
pub fn int(x: u64) -> u64 {
6767
x
@@ -73,7 +73,7 @@ pub fn nonzero_int(x: NonZeroU64) -> NonZeroU64 {
7373
x
7474
}
7575

76-
// CHECK: i64 @option_nonzero_int(i64 %x)
76+
// CHECK: noundef i64 @option_nonzero_int(i64 noundef %x)
7777
#[no_mangle]
7878
pub fn option_nonzero_int(x: Option<NonZeroU64>) -> Option<NonZeroU64> {
7979
x
@@ -138,11 +138,27 @@ pub fn indirect_struct(_: S) {
138138
pub fn borrowed_struct(_: &S) {
139139
}
140140

141-
// CHECK: @raw_struct({{%S\*|ptr}} %_1)
141+
// CHECK: @option_borrow({{i32\*|ptr}} noalias noundef readonly align 4 dereferenceable_or_null(4) %x)
142+
#[no_mangle]
143+
pub fn option_borrow(x: Option<&i32>) {
144+
}
145+
146+
// CHECK: @option_borrow_mut({{i32\*|ptr}} noalias noundef align 4 dereferenceable_or_null(4) %x)
147+
#[no_mangle]
148+
pub fn option_borrow_mut(x: Option<&mut i32>) {
149+
}
150+
151+
// CHECK: @raw_struct({{%S\*|ptr}} noundef %_1)
142152
#[no_mangle]
143153
pub fn raw_struct(_: *const S) {
144154
}
145155

156+
// CHECK: @raw_option_nonnull_struct({{i32\*|ptr}} noundef %_1)
157+
#[no_mangle]
158+
pub fn raw_option_nonnull_struct(_: Option<NonNull<S>>) {
159+
}
160+
161+
146162
// `Box` can get deallocated during execution of the function, so it should
147163
// not get `dereferenceable`.
148164
// CHECK: noundef nonnull align 4 {{i32\*|ptr}} @_box({{i32\*|ptr}} noalias noundef nonnull align 4 %x)
@@ -160,35 +176,35 @@ pub fn struct_return() -> S {
160176
}
161177

162178
// Hack to get the correct size for the length part in slices
163-
// CHECK: @helper([[USIZE:i[0-9]+]] %_1)
179+
// CHECK: @helper([[USIZE:i[0-9]+]] noundef %_1)
164180
#[no_mangle]
165181
pub fn helper(_: usize) {
166182
}
167183

168-
// CHECK: @slice({{\[0 x i8\]\*|ptr}} noalias noundef nonnull readonly align 1 %_1.0, [[USIZE]] %_1.1)
184+
// CHECK: @slice({{\[0 x i8\]\*|ptr}} noalias noundef nonnull readonly align 1 %_1.0, [[USIZE]] noundef %_1.1)
169185
// FIXME #25759 This should also have `nocapture`
170186
#[no_mangle]
171187
pub fn slice(_: &[u8]) {
172188
}
173189

174-
// CHECK: @mutable_slice({{\[0 x i8\]\*|ptr}} noalias noundef nonnull align 1 %_1.0, [[USIZE]] %_1.1)
190+
// CHECK: @mutable_slice({{\[0 x i8\]\*|ptr}} noalias noundef nonnull align 1 %_1.0, [[USIZE]] noundef %_1.1)
175191
// FIXME #25759 This should also have `nocapture`
176192
#[no_mangle]
177193
pub fn mutable_slice(_: &mut [u8]) {
178194
}
179195

180-
// CHECK: @unsafe_slice({{\[0 x i16\]\*|ptr}} noundef nonnull align 2 %_1.0, [[USIZE]] %_1.1)
196+
// CHECK: @unsafe_slice({{\[0 x i16\]\*|ptr}} noundef nonnull align 2 %_1.0, [[USIZE]] noundef %_1.1)
181197
// unsafe interior means this isn't actually readonly and there may be aliases ...
182198
#[no_mangle]
183199
pub fn unsafe_slice(_: &[UnsafeInner]) {
184200
}
185201

186-
// CHECK: @raw_slice({{\[0 x i8\]\*|ptr}} %_1.0, [[USIZE]] %_1.1)
202+
// CHECK: @raw_slice({{\[0 x i8\]\*|ptr}} noundef %_1.0, [[USIZE]] noundef %_1.1)
187203
#[no_mangle]
188204
pub fn raw_slice(_: *const [u8]) {
189205
}
190206

191-
// CHECK: @str({{\[0 x i8\]\*|ptr}} noalias noundef nonnull readonly align 1 %_1.0, [[USIZE]] %_1.1)
207+
// CHECK: @str({{\[0 x i8\]\*|ptr}} noalias noundef nonnull readonly align 1 %_1.0, [[USIZE]] noundef %_1.1)
192208
// FIXME #25759 This should also have `nocapture`
193209
#[no_mangle]
194210
pub fn str(_: &[u8]) {
@@ -197,26 +213,36 @@ pub fn str(_: &[u8]) {
197213
// CHECK: @trait_borrow({{\{\}\*|ptr}} noundef nonnull align 1 %_1.0, {{.+}} noalias noundef readonly align {{.*}} dereferenceable({{.*}}) %_1.1)
198214
// FIXME #25759 This should also have `nocapture`
199215
#[no_mangle]
200-
pub fn trait_borrow(_: &Drop) {
216+
pub fn trait_borrow(_: &dyn Drop) {
217+
}
218+
219+
// CHECK: @option_trait_borrow({{i8\*|ptr}} noundef align 1 %x.0, {{i8\*|ptr}} %x.1)
220+
#[no_mangle]
221+
pub fn option_trait_borrow(x: Option<&dyn Drop>) {
222+
}
223+
224+
// CHECK: @option_trait_borrow_mut({{i8\*|ptr}} noundef align 1 %x.0, {{i8\*|ptr}} %x.1)
225+
#[no_mangle]
226+
pub fn option_trait_borrow_mut(x: Option<&mut dyn Drop>) {
201227
}
202228

203-
// CHECK: @trait_raw({{\{\}\*|ptr}} %_1.0, {{.+}} noalias noundef readonly align {{.*}} dereferenceable({{.*}}) %_1.1)
229+
// CHECK: @trait_raw({{\{\}\*|ptr}} noundef %_1.0, {{.+}} noalias noundef readonly align {{.*}} dereferenceable({{.*}}) %_1.1)
204230
#[no_mangle]
205-
pub fn trait_raw(_: *const Drop) {
231+
pub fn trait_raw(_: *const dyn Drop) {
206232
}
207233

208234
// CHECK: @trait_box({{\{\}\*|ptr}} noalias noundef nonnull align 1{{( %0)?}}, {{.+}} noalias noundef readonly align {{.*}} dereferenceable({{.*}}){{( %1)?}})
209235
#[no_mangle]
210-
pub fn trait_box(_: Box<Drop>) {
236+
pub fn trait_box(_: Box<dyn Drop>) {
211237
}
212238

213239
// CHECK: { {{i8\*|ptr}}, {{i8\*|ptr}} } @trait_option({{i8\*|ptr}} noalias noundef align 1 %x.0, {{i8\*|ptr}} %x.1)
214240
#[no_mangle]
215-
pub fn trait_option(x: Option<Box<Drop>>) -> Option<Box<Drop>> {
241+
pub fn trait_option(x: Option<Box<dyn Drop>>) -> Option<Box<dyn Drop>> {
216242
x
217243
}
218244

219-
// CHECK: { {{\[0 x i16\]\*|ptr}}, [[USIZE]] } @return_slice({{\[0 x i16\]\*|ptr}} noalias noundef nonnull readonly align 2 %x.0, [[USIZE]] %x.1)
245+
// CHECK: { {{\[0 x i16\]\*|ptr}}, [[USIZE]] } @return_slice({{\[0 x i16\]\*|ptr}} noalias noundef nonnull readonly align 2 %x.0, [[USIZE]] noundef %x.1)
220246
#[no_mangle]
221247
pub fn return_slice(x: &[u16]) -> &[u16] {
222248
x

tests/codegen/intrinsics/const_eval_select.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// compile-flags: -C no-prepopulate-passes
1+
// compile-flags: -C no-prepopulate-passes -Copt-level=0
22

33
#![crate_type = "lib"]
44
#![feature(const_eval_select)]

tests/codegen/intrinsics/mask.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// compile-flags: -Copt-level=0
12
#![crate_type = "lib"]
23
#![feature(core_intrinsics)]
34

@@ -6,6 +7,6 @@
67
#[no_mangle]
78
pub fn mask_ptr(ptr: *const u16, mask: usize) -> *const u16 {
89
// CHECK: call
9-
// CHECK-SAME: @llvm.ptrmask.{{p0|p0i8}}.[[WORD]]({{ptr|i8\*}} {{%ptr|%0}}, [[WORD]] %mask)
10+
// CHECK-SAME: @llvm.ptrmask.{{p0|p0i8}}.[[WORD]]({{ptr|i8\*}} {{%ptr|%1}}, [[WORD]] %mask)
1011
core::intrinsics::ptr_mask(ptr, mask)
1112
}

tests/codegen/issue-32031.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// compile-flags: -C no-prepopulate-passes
1+
// compile-flags: -C no-prepopulate-passes -Copt-level=0
22

33
#![crate_type = "lib"]
44

tests/codegen/issue-58881.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// compile-flags: -C no-prepopulate-passes
1+
// compile-flags: -C no-prepopulate-passes -Copt-level=0
22
//
33
// only-x86_64
44
// ignore-windows

0 commit comments

Comments
 (0)