Skip to content

Commit ef6fdb9

Browse files
committed
Remove all uses of typed pointers
1 parent a04d026 commit ef6fdb9

7 files changed

Lines changed: 11 additions & 11 deletions

File tree

compiler/rustc_codegen_ssa/src/mir/rvalue.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
130130
let start = dest.val.llval;
131131
let size = bx.const_usize(dest.layout.size.bytes());
132132

133-
// Use llvm.memset.p0i8.* to initialize all same byte arrays
133+
// Use llvm.memset.p0.* to initialize all same byte arrays
134134
if let Some(int) = bx.cx().const_to_opt_u128(v, false)
135135
&& let bytes = &int.to_le_bytes()[..cg_elem.layout.size.bytes_usize()]
136136
&& let Ok(&byte) = bytes.iter().all_equal_value()
@@ -140,7 +140,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
140140
return true;
141141
}
142142

143-
// Use llvm.memset.p0i8.* to initialize byte arrays
143+
// Use llvm.memset.p0.* to initialize byte arrays
144144
let v = bx.from_immediate(v);
145145
if bx.cx().val_ty(v) == bx.cx().type_i8() {
146146
bx.memset(start, v, size, dest.val.align, MemFlags::empty());

library/core/src/intrinsics/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -953,7 +953,7 @@ pub const unsafe fn slice_get_unchecked<
953953
#[rustc_intrinsic]
954954
pub fn ptr_mask<T>(ptr: *const T, mask: usize) -> *const T;
955955

956-
/// Equivalent to the appropriate `llvm.memcpy.p0i8.0i8.*` intrinsic, with
956+
/// Equivalent to the appropriate `llvm.memcpy.p0.p0.*` intrinsic, with
957957
/// a size of `count` * `size_of::<T>()` and an alignment of `align_of::<T>()`.
958958
///
959959
/// This intrinsic does not have a stable counterpart.
@@ -967,7 +967,7 @@ pub fn ptr_mask<T>(ptr: *const T, mask: usize) -> *const T;
967967
#[rustc_intrinsic]
968968
#[rustc_nounwind]
969969
pub unsafe fn volatile_copy_nonoverlapping_memory<T>(dst: *mut T, src: *const T, count: usize);
970-
/// Equivalent to the appropriate `llvm.memmove.p0i8.0i8.*` intrinsic, with
970+
/// Equivalent to the appropriate `llvm.memmove.p0.p0.*` intrinsic, with
971971
/// a size of `count * size_of::<T>()` and an alignment of `align_of::<T>()`.
972972
///
973973
/// The volatile parameter is set to `true`, so it will not be optimized out
@@ -977,7 +977,7 @@ pub unsafe fn volatile_copy_nonoverlapping_memory<T>(dst: *mut T, src: *const T,
977977
#[rustc_intrinsic]
978978
#[rustc_nounwind]
979979
pub unsafe fn volatile_copy_memory<T>(dst: *mut T, src: *const T, count: usize);
980-
/// Equivalent to the appropriate `llvm.memset.p0i8.*` intrinsic, with a
980+
/// Equivalent to the appropriate `llvm.memset.p0.*` intrinsic, with a
981981
/// size of `count * size_of::<T>()` and an alignment of `align_of::<T>()`.
982982
///
983983
/// This intrinsic does not have a stable counterpart.

src/tools/rustfmt/tests/target/format_strings/issue-202.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ fn compile_empty_program() {
66
let expected = "; ModuleID = \'foo\'
77
88
; Function Attrs: nounwind
9-
declare void @llvm.memset.p0i8.i32(i8* nocapture, i8, i32, i32, i1) #0
9+
declare void @llvm.memset.p0.i32(i8* nocapture, i8, i32, i32, i1) #0
1010
1111
declare i32 @write(i32, i8*, i32)
1212

src/tools/rustfmt/tests/target/format_strings/issue-3263.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ fn compile_empty_program() {
77
let expected = "; ModuleID = \'foo\'
88
99
; Function Attrs: nounwind
10-
declare void @llvm.memset.p0i8.i32(i8* nocapture, i8, i32, i32, i1) #0
10+
declare void @llvm.memset.p0.i32(i8* nocapture, i8, i32, i32, i1) #0
1111
1212
declare i32 @write(i32, i8*, i32)
1313

src/tools/rustfmt/tests/target/string-lit-custom.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ fn main() {
22
let expected = "; ModuleID = \'foo\'
33
44
; Function Attrs: nounwind
5-
declare void @llvm.memset.p0i8.i32(i8* nocapture, i8, i32, i32, i1) #0
5+
declare void @llvm.memset.p0.i32(i8* nocapture, i8, i32, i32, i1) #0
66
77
declare i32 @write(i32, i8*, i32)
88

tests/codegen-llvm/intrinsics/mask.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@
77
#[no_mangle]
88
pub fn mask_ptr(ptr: *const u16, mask: usize) -> *const u16 {
99
// CHECK: call
10-
// CHECK-SAME: @llvm.ptrmask.{{p0|p0i8}}.[[WORD]](ptr {{%ptr|%1}}, [[WORD]] %mask)
10+
// CHECK-SAME: @llvm.ptrmask.p0.[[WORD]](ptr {{%ptr|%1}}, [[WORD]] %mask)
1111
core::intrinsics::ptr_mask(ptr, mask)
1212
}

tests/ui/abi/arm-unadjusted-intrinsic.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ impl Copy for int8x16x4_t {}
3434
pub unsafe fn vld1q_s8_x4(a: *const i8) -> int8x16x4_t {
3535
#[allow(improper_ctypes)]
3636
extern "unadjusted" {
37-
#[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vld1x4.v16i8.p0i8")]
38-
#[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ld1x4.v16i8.p0i8")]
37+
#[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vld1x4.v16i8.p0")]
38+
#[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ld1x4.v16i8.p0")]
3939
fn vld1q_s8_x4_(a: *const i8) -> int8x16x4_t;
4040
}
4141
vld1q_s8_x4_(a)

0 commit comments

Comments
 (0)