[llvm] 6022873 - [BPF] Convert some tests to opaque pointers (NFC)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Mon Dec 19 03:47:15 PST 2022
Author: Nikita Popov
Date: 2022-12-19T12:46:54+01:00
New Revision: 60228733726e25d011b1f9221e005732191cc077
URL: https://github.com/llvm/llvm-project/commit/60228733726e25d011b1f9221e005732191cc077
DIFF: https://github.com/llvm/llvm-project/commit/60228733726e25d011b1f9221e005732191cc077.diff
LOG: [BPF] Convert some tests to opaque pointers (NFC)
Added:
Modified:
llvm/test/CodeGen/BPF/32-bit-subreg-load-store.ll
llvm/test/CodeGen/BPF/32-bit-subreg-peephole.ll
llvm/test/CodeGen/BPF/BTF/builtin-btf-type-id.ll
llvm/test/CodeGen/BPF/BTF/char-no-debuginfo.ll
llvm/test/CodeGen/BPF/BTF/extern-builtin.ll
llvm/test/CodeGen/BPF/BTF/extern-func-ptr.ll
llvm/test/CodeGen/BPF/BTF/extern-global-var.ll
llvm/test/CodeGen/BPF/BTF/extern-var-section.ll
llvm/test/CodeGen/BPF/BTF/extern-var-struct-weak.ll
llvm/test/CodeGen/BPF/BTF/extern-var-struct.ll
llvm/test/CodeGen/BPF/BTF/extern-var-weak-section.ll
llvm/test/CodeGen/BPF/BTF/func-func-ptr.ll
llvm/test/CodeGen/BPF/BTF/fwd-no-define.ll
llvm/test/CodeGen/BPF/BTF/fwd-with-define.ll
llvm/test/CodeGen/BPF/BTF/local-var-readonly-1.ll
llvm/test/CodeGen/BPF/BTF/local-var-readonly-2.ll
llvm/test/CodeGen/BPF/BTF/local-var.ll
llvm/test/CodeGen/BPF/BTF/map-def-2.ll
llvm/test/CodeGen/BPF/BTF/map-def.ll
llvm/test/CodeGen/BPF/BTF/pruning-const.ll
llvm/test/CodeGen/BPF/BTF/pruning-multi-derived-type.ll
llvm/test/CodeGen/BPF/BTF/pruning-typedef.ll
llvm/test/CodeGen/BPF/BTF/ptr-const-void.ll
llvm/test/CodeGen/BPF/BTF/ptr-func-1.ll
llvm/test/CodeGen/BPF/BTF/ptr-func-2.ll
llvm/test/CodeGen/BPF/BTF/ptr-func-3.ll
llvm/test/CodeGen/BPF/BTF/ptr-int.ll
llvm/test/CodeGen/BPF/BTF/ptr-prune-type.ll
llvm/test/CodeGen/BPF/BTF/ptr-void.ll
llvm/test/CodeGen/BPF/BTF/ptr-volatile-const-void.ll
llvm/test/CodeGen/BPF/BTF/ptr-volatile-void.ll
llvm/test/CodeGen/BPF/BTF/restrict-ptr.ll
llvm/test/CodeGen/BPF/BTF/static-var-derived-type.ll
llvm/test/CodeGen/BPF/BTF/static-var-inited-sec.ll
llvm/test/CodeGen/BPF/BTF/static-var-inited.ll
llvm/test/CodeGen/BPF/BTF/static-var-readonly-sec.ll
llvm/test/CodeGen/BPF/BTF/static-var-readonly.ll
llvm/test/CodeGen/BPF/BTF/static-var-sec.ll
llvm/test/CodeGen/BPF/BTF/static-var-zerolen-array.ll
llvm/test/CodeGen/BPF/BTF/static-var.ll
llvm/test/CodeGen/BPF/BTF/struct-anon-2.ll
llvm/test/CodeGen/BPF/BTF/tag-2.ll
llvm/test/CodeGen/BPF/BTF/tag-typedef.ll
llvm/test/CodeGen/BPF/BTF/type-tag-var.ll
llvm/test/CodeGen/BPF/BTF/weak-global-2.ll
llvm/test/CodeGen/BPF/BTF/weak-global-3.ll
llvm/test/CodeGen/BPF/BTF/weak-global.ll
llvm/test/CodeGen/BPF/CORE/btf-id-duplicate.ll
llvm/test/CodeGen/BPF/CORE/field-reloc-alu32.ll
llvm/test/CodeGen/BPF/CORE/field-reloc-bitfield-1-bpfeb.ll
llvm/test/CodeGen/BPF/CORE/field-reloc-bitfield-1.ll
llvm/test/CodeGen/BPF/CORE/field-reloc-bitfield-2-bpfeb.ll
llvm/test/CodeGen/BPF/CORE/field-reloc-bitfield-2.ll
llvm/test/CodeGen/BPF/CORE/field-reloc-bitfield-record-align16.ll
llvm/test/CodeGen/BPF/CORE/field-reloc-duplicate.ll
llvm/test/CodeGen/BPF/CORE/intrinsic-array-2.ll
llvm/test/CodeGen/BPF/CORE/intrinsic-array.ll
llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-byte-size-1.ll
llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-byte-size-2.ll
llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-byte-size-3.ll
llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-byte-size-4.ll
llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-existence-1.ll
llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-existence-2.ll
llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-existence-3.ll
llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-existence-4.ll
llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-lshift-1-bpfeb.ll
llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-lshift-1.ll
llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-lshift-2.ll
llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-rshift-1.ll
llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-rshift-2.ll
llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-rshift-3.ll
llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-signedness-1.ll
llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-signedness-2.ll
llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-signedness-3.ll
llvm/test/CodeGen/BPF/CORE/intrinsic-struct.ll
llvm/test/CodeGen/BPF/CORE/intrinsic-typeinfo-enum-value.ll
llvm/test/CodeGen/BPF/CORE/intrinsic-typeinfo-type-size-2.ll
llvm/test/CodeGen/BPF/CORE/intrinsic-union.ll
llvm/test/CodeGen/BPF/CORE/no-elf-ama-symbol.ll
llvm/test/CodeGen/BPF/CORE/no-narrow-load.ll
llvm/test/CodeGen/BPF/CORE/offset-reloc-access-str.ll
llvm/test/CodeGen/BPF/CORE/offset-reloc-basic.ll
llvm/test/CodeGen/BPF/CORE/offset-reloc-cast-struct-1.ll
llvm/test/CodeGen/BPF/CORE/offset-reloc-cast-struct-2.ll
llvm/test/CodeGen/BPF/CORE/offset-reloc-end-load.ll
llvm/test/CodeGen/BPF/CORE/offset-reloc-end-ret.ll
llvm/test/CodeGen/BPF/CORE/offset-reloc-fieldinfo-1.ll
llvm/test/CodeGen/BPF/CORE/offset-reloc-fieldinfo-2-bpfeb.ll
llvm/test/CodeGen/BPF/CORE/offset-reloc-fieldinfo-2.ll
llvm/test/CodeGen/BPF/CORE/offset-reloc-global-1.ll
llvm/test/CodeGen/BPF/CORE/offset-reloc-global-2.ll
llvm/test/CodeGen/BPF/CORE/offset-reloc-global-3.ll
llvm/test/CodeGen/BPF/CORE/offset-reloc-ignore.ll
llvm/test/CodeGen/BPF/CORE/offset-reloc-middle-chain.ll
llvm/test/CodeGen/BPF/CORE/offset-reloc-multi-array-1.ll
llvm/test/CodeGen/BPF/CORE/offset-reloc-multi-array-2.ll
llvm/test/CodeGen/BPF/CORE/offset-reloc-multilevel.ll
llvm/test/CodeGen/BPF/CORE/offset-reloc-pointer-1.ll
llvm/test/CodeGen/BPF/CORE/offset-reloc-pointer-2.ll
llvm/test/CodeGen/BPF/CORE/offset-reloc-struct-anonymous.ll
llvm/test/CodeGen/BPF/CORE/offset-reloc-struct-array.ll
llvm/test/CodeGen/BPF/CORE/offset-reloc-typedef-array.ll
llvm/test/CodeGen/BPF/CORE/offset-reloc-typedef-struct-2.ll
llvm/test/CodeGen/BPF/CORE/offset-reloc-typedef-struct.ll
llvm/test/CodeGen/BPF/CORE/offset-reloc-typedef-union-2.ll
llvm/test/CodeGen/BPF/CORE/offset-reloc-typedef-union.ll
llvm/test/CodeGen/BPF/CORE/offset-reloc-typedef.ll
llvm/test/CodeGen/BPF/CORE/offset-reloc-union.ll
llvm/test/CodeGen/BPF/CORE/store-addr.ll
llvm/test/CodeGen/BPF/adjust-opt-icmp1.ll
llvm/test/CodeGen/BPF/adjust-opt-icmp2.ll
llvm/test/CodeGen/BPF/adjust-opt-icmp3.ll
llvm/test/CodeGen/BPF/adjust-opt-icmp4.ll
llvm/test/CodeGen/BPF/adjust-opt-icmp5.ll
llvm/test/CodeGen/BPF/adjust-opt-icmp6.ll
llvm/test/CodeGen/BPF/adjust-opt-speculative1.ll
llvm/test/CodeGen/BPF/adjust-opt-speculative2.ll
llvm/test/CodeGen/BPF/atomics.ll
llvm/test/CodeGen/BPF/atomics_2.ll
llvm/test/CodeGen/BPF/basictest.ll
llvm/test/CodeGen/BPF/byval.ll
llvm/test/CodeGen/BPF/callx.ll
llvm/test/CodeGen/BPF/cc_args.ll
llvm/test/CodeGen/BPF/cc_args_be.ll
llvm/test/CodeGen/BPF/cc_ret.ll
llvm/test/CodeGen/BPF/dwarfdump.ll
llvm/test/CodeGen/BPF/fi_ri.ll
llvm/test/CodeGen/BPF/i128.ll
llvm/test/CodeGen/BPF/inline_asm.ll
llvm/test/CodeGen/BPF/inlineasm-output-template.ll
llvm/test/CodeGen/BPF/intrinsics.ll
llvm/test/CodeGen/BPF/is_trunc_free.ll
llvm/test/CodeGen/BPF/load.ll
llvm/test/CodeGen/BPF/loop-exit-cond.ll
llvm/test/CodeGen/BPF/loops.ll
llvm/test/CodeGen/BPF/mem_offset.ll
llvm/test/CodeGen/BPF/mem_offset_be.ll
llvm/test/CodeGen/BPF/memcmp.ll
llvm/test/CodeGen/BPF/memcpy-expand-in-order.ll
llvm/test/CodeGen/BPF/objdump_atomics.ll
llvm/test/CodeGen/BPF/objdump_cond_op.ll
llvm/test/CodeGen/BPF/objdump_imm_hex.ll
llvm/test/CodeGen/BPF/objdump_intrinsics.ll
llvm/test/CodeGen/BPF/objdump_static_var.ll
llvm/test/CodeGen/BPF/objdump_trivial.ll
llvm/test/CodeGen/BPF/optnone-1.ll
llvm/test/CodeGen/BPF/reloc-3.ll
llvm/test/CodeGen/BPF/reloc-btf-2.ll
llvm/test/CodeGen/BPF/remove_truncate_1.ll
llvm/test/CodeGen/BPF/remove_truncate_2.ll
llvm/test/CodeGen/BPF/remove_truncate_4.ll
llvm/test/CodeGen/BPF/remove_truncate_5.ll
llvm/test/CodeGen/BPF/remove_truncate_6.ll
llvm/test/CodeGen/BPF/remove_truncate_7.ll
llvm/test/CodeGen/BPF/remove_truncate_8.ll
llvm/test/CodeGen/BPF/rodata_1.ll
llvm/test/CodeGen/BPF/rodata_2.ll
llvm/test/CodeGen/BPF/rodata_3.ll
llvm/test/CodeGen/BPF/rodata_4.ll
llvm/test/CodeGen/BPF/rodata_5.ll
llvm/test/CodeGen/BPF/rodata_6.ll
llvm/test/CodeGen/BPF/rodata_7.ll
llvm/test/CodeGen/BPF/sanity.ll
llvm/test/CodeGen/BPF/select_ri.ll
llvm/test/CodeGen/BPF/selectiondag-bug.ll
llvm/test/CodeGen/BPF/struct_ret1.ll
llvm/test/CodeGen/BPF/undef.ll
llvm/test/CodeGen/BPF/vla.ll
llvm/test/CodeGen/BPF/warn-call.ll
llvm/test/CodeGen/BPF/warn-stack.ll
Removed:
################################################################################
diff --git a/llvm/test/CodeGen/BPF/32-bit-subreg-load-store.ll b/llvm/test/CodeGen/BPF/32-bit-subreg-load-store.ll
index 9906cee35ddec..4b9af62fb3d65 100644
--- a/llvm/test/CodeGen/BPF/32-bit-subreg-load-store.ll
+++ b/llvm/test/CodeGen/BPF/32-bit-subreg-load-store.ll
@@ -40,68 +40,68 @@
; *p = v;
; }
; Function Attrs: norecurse nounwind readonly
-define dso_local zeroext i8 @loadu8(i8* nocapture readonly %p) local_unnamed_addr #0 {
+define dso_local zeroext i8 @loadu8(ptr nocapture readonly %p) local_unnamed_addr #0 {
entry:
- %0 = load i8, i8* %p, align 1
+ %0 = load i8, ptr %p, align 1
; CHECK: w{{[0-9]+}} = *(u8 *)(r{{[0-9]+}} + 0)
ret i8 %0
}
; Function Attrs: norecurse nounwind readonly
-define dso_local zeroext i16 @loadu16(i16* nocapture readonly %p) local_unnamed_addr #0 {
+define dso_local zeroext i16 @loadu16(ptr nocapture readonly %p) local_unnamed_addr #0 {
entry:
- %0 = load i16, i16* %p, align 2
+ %0 = load i16, ptr %p, align 2
; CHECK: w{{[0-9]+}} = *(u16 *)(r{{[0-9]+}} + 0)
ret i16 %0
}
; Function Attrs: norecurse nounwind readonly
-define dso_local i32 @loadu32(i32* nocapture readonly %p) local_unnamed_addr #0 {
+define dso_local i32 @loadu32(ptr nocapture readonly %p) local_unnamed_addr #0 {
entry:
- %0 = load i32, i32* %p, align 4
+ %0 = load i32, ptr %p, align 4
; CHECK: w{{[0-9]+}} = *(u32 *)(r{{[0-9]+}} + 0)
ret i32 %0
}
; Function Attrs: norecurse nounwind readonly
-define dso_local i64 @loadu64(i64* nocapture readonly %p) local_unnamed_addr #0 {
+define dso_local i64 @loadu64(ptr nocapture readonly %p) local_unnamed_addr #0 {
entry:
- %0 = load i64, i64* %p, align 8
+ %0 = load i64, ptr %p, align 8
; CHECK: r{{[0-9]+}} = *(u64 *)(r{{[0-9]+}} + 0)
ret i64 %0
}
; Function Attrs: norecurse nounwind
-define dso_local void @storeu8(i8* nocapture %p, i64 %v) local_unnamed_addr #1 {
+define dso_local void @storeu8(ptr nocapture %p, i64 %v) local_unnamed_addr #1 {
entry:
%conv = trunc i64 %v to i8
- store i8 %conv, i8* %p, align 1
+ store i8 %conv, ptr %p, align 1
; CHECK: *(u8 *)(r{{[0-9]+}} + 0) = w{{[0-9]+}}
ret void
}
; Function Attrs: norecurse nounwind
-define dso_local void @storeu16(i16* nocapture %p, i64 %v) local_unnamed_addr #1 {
+define dso_local void @storeu16(ptr nocapture %p, i64 %v) local_unnamed_addr #1 {
entry:
%conv = trunc i64 %v to i16
- store i16 %conv, i16* %p, align 2
+ store i16 %conv, ptr %p, align 2
; CHECK: *(u16 *)(r{{[0-9]+}} + 0) = w{{[0-9]+}}
ret void
}
; Function Attrs: norecurse nounwind
-define dso_local void @storeu32(i32* nocapture %p, i64 %v) local_unnamed_addr #1 {
+define dso_local void @storeu32(ptr nocapture %p, i64 %v) local_unnamed_addr #1 {
entry:
%conv = trunc i64 %v to i32
- store i32 %conv, i32* %p, align 4
+ store i32 %conv, ptr %p, align 4
; CHECK: *(u32 *)(r{{[0-9]+}} + 0) = w{{[0-9]+}}
ret void
}
; Function Attrs: norecurse nounwind
-define dso_local void @storeu64(i64* nocapture %p, i64 %v) local_unnamed_addr #1 {
+define dso_local void @storeu64(ptr nocapture %p, i64 %v) local_unnamed_addr #1 {
entry:
- store i64 %v, i64* %p, align 8
+ store i64 %v, ptr %p, align 8
; CHECK: *(u64 *)(r{{[0-9]+}} + 0) = r{{[0-9]+}}
ret void
}
diff --git a/llvm/test/CodeGen/BPF/32-bit-subreg-peephole.ll b/llvm/test/CodeGen/BPF/32-bit-subreg-peephole.ll
index 7c5be7f1987a3..f491eeee37d85 100644
--- a/llvm/test/CodeGen/BPF/32-bit-subreg-peephole.ll
+++ b/llvm/test/CodeGen/BPF/32-bit-subreg-peephole.ll
@@ -83,7 +83,7 @@ entry:
define dso_local i32 @foo(i32 %b, i32 %c) local_unnamed_addr #0 {
; CHECK-LABEL: foo:
entry:
- %call = tail call i64 bitcast (i64 (...)* @bar to i64 ()*)() #2
+ %call = tail call i64 @bar() #2
%conv = trunc i64 %call to i32
%cmp = icmp ult i32 %conv, 10
; %call comes from function call returning i64 so the high bits will need
@@ -99,21 +99,21 @@ entry:
declare dso_local i64 @bar(...) local_unnamed_addr #1
; Function Attrs: norecurse nounwind readnone
-define dso_local i32* @inc_p(i32* readnone %p, i32 %a) local_unnamed_addr #0 {
+define dso_local ptr @inc_p(ptr readnone %p, i32 %a) local_unnamed_addr #0 {
; CHECK-LABEL: inc_p:
entry:
%idx.ext = zext i32 %a to i64
; CHECK: r{{[0-9]+}} = w{{[0-9]+}}
; CHECK-NOT: r{{[0-9]+}} <<= 32
; CHECK-NOT: r{{[0-9]+}} >>= 32
- %add.ptr = getelementptr inbounds i32, i32* %p, i64 %idx.ext
- ret i32* %add.ptr
+ %add.ptr = getelementptr inbounds i32, ptr %p, i64 %idx.ext
+ ret ptr %add.ptr
}
define dso_local i32 @test() local_unnamed_addr {
; CHECK-LABEL: test:
entry:
- %call = tail call i32 bitcast (i32 (...)* @helper to i32 ()*)()
+ %call = tail call i32 @helper()
%cmp = icmp sgt i32 %call, 6
; The shifts can't be optimized out because %call comes from function call
; return i32 so the high bits might be invalid.
diff --git a/llvm/test/CodeGen/BPF/BTF/builtin-btf-type-id.ll b/llvm/test/CodeGen/BPF/BTF/builtin-btf-type-id.ll
index 11ff985fdd2ff..7b184d5b2810c 100644
--- a/llvm/test/CodeGen/BPF/BTF/builtin-btf-type-id.ll
+++ b/llvm/test/CodeGen/BPF/BTF/builtin-btf-type-id.ll
@@ -3,7 +3,7 @@
; RUN: llc -mattr=+alu32 -filetype=asm -o - %t1 | FileCheck -check-prefixes=CHECK %s
;
; Source code:
-; static int (*bpf_log)(unsigned long tid, void *data, int data_size) = (void *)999;
+; static int (*bpf_log)(unsigned long tid, ptr data, int data_size) = (ptr)999;
; struct {
; char f1[100];
; typeof(3) f2;
@@ -21,14 +21,14 @@
; clang -target bpf -O2 -g -S -emit-llvm -Xclang -disable-llvm-passes test.c
@tmp__abc = dso_local global { <{ i8, i8, [98 x i8] }>, i32 } { <{ i8, i8, [98 x i8] }> <{ i8 1, i8 3, [98 x i8] zeroinitializer }>, i32 0 }, align 4, !dbg !0
- at bpf_log = internal global i32 (i64, i8*, i32)* inttoptr (i64 999 to i32 (i64, i8*, i32)*), align 8, !dbg !17
+ at bpf_log = internal global ptr inttoptr (i64 999 to ptr), align 8, !dbg !17
; Function Attrs: nounwind
define dso_local void @prog1() #0 !dbg !28 {
entry:
- %0 = load i32 (i64, i8*, i32)*, i32 (i64, i8*, i32)** @bpf_log, align 8, !dbg !31, !tbaa !32
+ %0 = load ptr, ptr @bpf_log, align 8, !dbg !31, !tbaa !32
%1 = call i64 @llvm.bpf.btf.type.id(i32 0, i64 0), !dbg !36, !llvm.preserve.access.index !7
- %call = call i32 %0(i64 %1, i8* getelementptr inbounds ({ <{ i8, i8, [98 x i8] }>, i32 }, { <{ i8, i8, [98 x i8] }>, i32 }* @tmp__abc, i32 0, i32 0, i32 0), i32 104), !dbg !31
+ %call = call i32 %0(i64 %1, ptr getelementptr inbounds ({ <{ i8, i8, [98 x i8] }>, i32 }, ptr @tmp__abc, i32 0, i32 0, i32 0), i32 104), !dbg !31
ret void, !dbg !37
}
@@ -38,18 +38,18 @@ declare i64 @llvm.bpf.btf.type.id(i32, i64) #1
; Function Attrs: nounwind
define dso_local void @prog2() #0 !dbg !38 {
entry:
- %0 = load i32 (i64, i8*, i32)*, i32 (i64, i8*, i32)** @bpf_log, align 8, !dbg !39, !tbaa !32
+ %0 = load ptr, ptr @bpf_log, align 8, !dbg !39, !tbaa !32
%1 = call i64 @llvm.bpf.btf.type.id(i32 1, i64 0), !dbg !40, !llvm.preserve.access.index !6
- %call = call i32 %0(i64 %1, i8* getelementptr inbounds ({ <{ i8, i8, [98 x i8] }>, i32 }, { <{ i8, i8, [98 x i8] }>, i32 }* @tmp__abc, i32 0, i32 0, i32 0), i32 104), !dbg !39
+ %call = call i32 %0(i64 %1, ptr getelementptr inbounds ({ <{ i8, i8, [98 x i8] }>, i32 }, ptr @tmp__abc, i32 0, i32 0, i32 0), i32 104), !dbg !39
ret void, !dbg !41
}
; Function Attrs: nounwind
define dso_local void @prog3() #0 !dbg !42 {
entry:
- %0 = load i32 (i64, i8*, i32)*, i32 (i64, i8*, i32)** @bpf_log, align 8, !dbg !43, !tbaa !32
+ %0 = load ptr, ptr @bpf_log, align 8, !dbg !43, !tbaa !32
%1 = call i64 @llvm.bpf.btf.type.id(i32 2, i64 1), !dbg !44, !llvm.preserve.access.index !11
- %call = call i32 %0(i64 %1, i8* getelementptr inbounds ({ <{ i8, i8, [98 x i8] }>, i32 }, { <{ i8, i8, [98 x i8] }>, i32 }* @tmp__abc, i32 0, i32 0, i32 0), i32 104), !dbg !43
+ %call = call i32 %0(i64 %1, ptr getelementptr inbounds ({ <{ i8, i8, [98 x i8] }>, i32 }, ptr @tmp__abc, i32 0, i32 0, i32 0), i32 104), !dbg !43
ret void, !dbg !45
}
diff --git a/llvm/test/CodeGen/BPF/BTF/char-no-debuginfo.ll b/llvm/test/CodeGen/BPF/BTF/char-no-debuginfo.ll
index ee565ab230baa..c6a6d1209fb82 100644
--- a/llvm/test/CodeGen/BPF/BTF/char-no-debuginfo.ll
+++ b/llvm/test/CodeGen/BPF/BTF/char-no-debuginfo.ll
@@ -11,7 +11,7 @@
; Function Attrs: norecurse nounwind readonly
define dso_local i32 @test() local_unnamed_addr #0 {
- %1 = load i32, i32* @g, align 4, !tbaa !2
+ %1 = load i32, ptr @g, align 4, !tbaa !2
ret i32 %1
}
diff --git a/llvm/test/CodeGen/BPF/BTF/extern-builtin.ll b/llvm/test/CodeGen/BPF/BTF/extern-builtin.ll
index e5527d763c78b..c8a5d3bda050d 100644
--- a/llvm/test/CodeGen/BPF/BTF/extern-builtin.ll
+++ b/llvm/test/CodeGen/BPF/BTF/extern-builtin.ll
@@ -1,19 +1,19 @@
; RUN: llc -march=bpfel -filetype=asm -o - %s | FileCheck -check-prefixes=CHECK %s
; RUN: llc -march=bpfeb -filetype=asm -o - %s | FileCheck -check-prefixes=CHECK %s
; Source code:
-; unsigned long long load_byte(void *skb,
+; unsigned long long load_byte(ptr skb,
; unsigned long long off) asm("llvm.bpf.load.byte");
-; unsigned long long test(void *skb) {
+; unsigned long long test(ptr skb) {
; return load_byte(skb, 10);
; }
; Compilation flag:
; clang -target bpf -O2 -g -S -emit-llvm test.c
; Function Attrs: nounwind readonly
-define dso_local i64 @test(i8* readonly %skb) local_unnamed_addr #0 !dbg !13 {
+define dso_local i64 @test(ptr readonly %skb) local_unnamed_addr #0 !dbg !13 {
entry:
- call void @llvm.dbg.value(metadata i8* %skb, metadata !17, metadata !DIExpression()), !dbg !18
- %call = tail call i64 @llvm.bpf.load.byte(i8* %skb, i64 10), !dbg !19
+ call void @llvm.dbg.value(metadata ptr %skb, metadata !17, metadata !DIExpression()), !dbg !18
+ %call = tail call i64 @llvm.bpf.load.byte(ptr %skb, i64 10), !dbg !19
ret i64 %call, !dbg !20
}
@@ -54,7 +54,7 @@ entry:
; CHECK-NEXT: .byte 0
; Function Attrs: nounwind readonly
-declare !dbg !4 i64 @llvm.bpf.load.byte(i8*, i64) #1
+declare !dbg !4 i64 @llvm.bpf.load.byte(ptr, i64) #1
; Function Attrs: nounwind readnone speculatable willreturn
declare void @llvm.dbg.value(metadata, metadata, metadata) #2
diff --git a/llvm/test/CodeGen/BPF/BTF/extern-func-ptr.ll b/llvm/test/CodeGen/BPF/BTF/extern-func-ptr.ll
index c6da613f175f6..aba36e94461ec 100644
--- a/llvm/test/CodeGen/BPF/BTF/extern-func-ptr.ll
+++ b/llvm/test/CodeGen/BPF/BTF/extern-func-ptr.ll
@@ -3,7 +3,7 @@
;
; Source code:
; extern int do_work(int) __attribute__((section(".callback_fn")));
-; long bpf_helper(void *callback_fn);
+; long bpf_helper(ptr callback_fn);
; long prog() {
; return bpf_helper(&do_work);
; }
@@ -13,7 +13,7 @@
; Function Attrs: nounwind
define dso_local i64 @prog() local_unnamed_addr #0 !dbg !7 {
entry:
- %call = tail call i64 @bpf_helper(i8* bitcast (i32 (i32)* @do_work to i8*)) #2, !dbg !11
+ %call = tail call i64 @bpf_helper(ptr @do_work) #2, !dbg !11
ret i64 %call, !dbg !12
}
@@ -41,7 +41,7 @@ entry:
; CHECK: .ascii "do_work" # string offset=55
; CHECK: .ascii ".callback_fn" # string offset=74
-declare !dbg !13 dso_local i64 @bpf_helper(i8*) local_unnamed_addr #1
+declare !dbg !13 dso_local i64 @bpf_helper(ptr) local_unnamed_addr #1
declare !dbg !17 dso_local i32 @do_work(i32) #1 section ".callback_fn"
diff --git a/llvm/test/CodeGen/BPF/BTF/extern-global-var.ll b/llvm/test/CodeGen/BPF/BTF/extern-global-var.ll
index 2f5a504023454..6d520f0f78135 100644
--- a/llvm/test/CodeGen/BPF/BTF/extern-global-var.ll
+++ b/llvm/test/CodeGen/BPF/BTF/extern-global-var.ll
@@ -11,7 +11,7 @@
; Function Attrs: norecurse nounwind readonly
define dso_local i32 @foo() local_unnamed_addr #0 !dbg !7 {
- %1 = load i8, i8* @a, align 1, !dbg !11, !tbaa !12
+ %1 = load i8, ptr @a, align 1, !dbg !11, !tbaa !12
%2 = sext i8 %1 to i32, !dbg !11
ret i32 %2, !dbg !15
}
diff --git a/llvm/test/CodeGen/BPF/BTF/extern-var-section.ll b/llvm/test/CodeGen/BPF/BTF/extern-var-section.ll
index 520847449950e..05bb10c1bbeef 100644
--- a/llvm/test/CodeGen/BPF/BTF/extern-var-section.ll
+++ b/llvm/test/CodeGen/BPF/BTF/extern-var-section.ll
@@ -16,7 +16,7 @@
define dso_local i32 @test() local_unnamed_addr #0 !dbg !16 {
entry:
%call = tail call i32 @global_func(i8 signext 0) #2, !dbg !19
- %0 = load i8, i8* @ch, align 1, !dbg !20, !tbaa !21
+ %0 = load i8, ptr @ch, align 1, !dbg !20, !tbaa !21
%conv = sext i8 %0 to i32, !dbg !20
%add = add nsw i32 %call, %conv, !dbg !24
ret i32 %add, !dbg !25
diff --git a/llvm/test/CodeGen/BPF/BTF/extern-var-struct-weak.ll b/llvm/test/CodeGen/BPF/BTF/extern-var-struct-weak.ll
index f44ce6ee50e86..570de14536a15 100644
--- a/llvm/test/CodeGen/BPF/BTF/extern-var-struct-weak.ll
+++ b/llvm/test/CodeGen/BPF/BTF/extern-var-struct-weak.ll
@@ -14,7 +14,7 @@
; Function Attrs: norecurse nounwind readonly
define dso_local i32 @test() local_unnamed_addr #0 !dbg !15 {
entry:
- %0 = load i32, i32* getelementptr (%struct.t1, %struct.t1* @global, i64 0, i32 0), align 4, !dbg !18, !tbaa !19
+ %0 = load i32, ptr @global, align 4, !dbg !18, !tbaa !19
ret i32 %0, !dbg !24
}
diff --git a/llvm/test/CodeGen/BPF/BTF/extern-var-struct.ll b/llvm/test/CodeGen/BPF/BTF/extern-var-struct.ll
index 3257b23a47ee7..5825e3967b5e8 100644
--- a/llvm/test/CodeGen/BPF/BTF/extern-var-struct.ll
+++ b/llvm/test/CodeGen/BPF/BTF/extern-var-struct.ll
@@ -15,7 +15,7 @@
; Function Attrs: norecurse nounwind readonly
define dso_local i32 @test() local_unnamed_addr #0 !dbg !15 {
entry:
- %0 = load i32, i32* getelementptr inbounds (%struct.t1, %struct.t1* @global, i64 0, i32 0), align 4, !dbg !18, !tbaa !19
+ %0 = load i32, ptr @global, align 4, !dbg !18, !tbaa !19
ret i32 %0, !dbg !24
}
diff --git a/llvm/test/CodeGen/BPF/BTF/extern-var-weak-section.ll b/llvm/test/CodeGen/BPF/BTF/extern-var-weak-section.ll
index bdf7fb49c5609..d5b3eb6cb8786 100644
--- a/llvm/test/CodeGen/BPF/BTF/extern-var-weak-section.ll
+++ b/llvm/test/CodeGen/BPF/BTF/extern-var-weak-section.ll
@@ -15,7 +15,7 @@
define dso_local i32 @test() local_unnamed_addr #0 !dbg !16 {
entry:
%call = tail call i32 @global_func(i8 signext 0) #2, !dbg !19
- %0 = load i8, i8* @ch, align 1, !dbg !20, !tbaa !21
+ %0 = load i8, ptr @ch, align 1, !dbg !20, !tbaa !21
%conv = sext i8 %0 to i32, !dbg !20
%add = add nsw i32 %call, %conv, !dbg !24
ret i32 %add, !dbg !25
diff --git a/llvm/test/CodeGen/BPF/BTF/func-func-ptr.ll b/llvm/test/CodeGen/BPF/BTF/func-func-ptr.ll
index 786e294947362..ea93225e8d588 100644
--- a/llvm/test/CodeGen/BPF/BTF/func-func-ptr.ll
+++ b/llvm/test/CodeGen/BPF/BTF/func-func-ptr.ll
@@ -8,9 +8,9 @@
; Compilation flag:
; clang -target bpf -O2 -g -S -emit-llvm t.c
-%struct.t1 = type { void (i32)* }
+%struct.t1 = type { ptr }
- at a1 = common dso_local local_unnamed_addr global void (i32)* null, align 8, !dbg !0
+ at a1 = common dso_local local_unnamed_addr global ptr null, align 8, !dbg !0
@b1 = common dso_local local_unnamed_addr global %struct.t1 zeroinitializer, align 8, !dbg !6
; Function Attrs: nounwind readnone
diff --git a/llvm/test/CodeGen/BPF/BTF/fwd-no-define.ll b/llvm/test/CodeGen/BPF/BTF/fwd-no-define.ll
index 12d10af896b14..7ca91d99f013a 100644
--- a/llvm/test/CodeGen/BPF/BTF/fwd-no-define.ll
+++ b/llvm/test/CodeGen/BPF/BTF/fwd-no-define.ll
@@ -7,7 +7,7 @@
; Compilation flag:
; clang -target bpf -O2 -g -S -emit-llvm t.c
-%struct.t2 = type { %struct.t1* }
+%struct.t2 = type { ptr }
%struct.t1 = type opaque
@a = common dso_local local_unnamed_addr global %struct.t2 zeroinitializer, align 8, !dbg !0
diff --git a/llvm/test/CodeGen/BPF/BTF/fwd-with-define.ll b/llvm/test/CodeGen/BPF/BTF/fwd-with-define.ll
index 1ce5a95de135e..ac2f841f7ba1e 100644
--- a/llvm/test/CodeGen/BPF/BTF/fwd-with-define.ll
+++ b/llvm/test/CodeGen/BPF/BTF/fwd-with-define.ll
@@ -7,7 +7,7 @@
; Compilation flag:
; clang -target bpf -O2 -g -S -emit-llvm t.c
-%struct.t1 = type { %struct.t1* }
+%struct.t1 = type { ptr }
@a = common dso_local local_unnamed_addr global %struct.t1 zeroinitializer, align 8, !dbg !0
diff --git a/llvm/test/CodeGen/BPF/BTF/local-var-readonly-1.ll b/llvm/test/CodeGen/BPF/BTF/local-var-readonly-1.ll
index 3da7e64c22002..d814ee9ee4ed2 100644
--- a/llvm/test/CodeGen/BPF/BTF/local-var-readonly-1.ll
+++ b/llvm/test/CodeGen/BPF/BTF/local-var-readonly-1.ll
@@ -2,7 +2,7 @@
; RUN: llc -march=bpfeb -filetype=asm -o - %s | FileCheck -check-prefixes=CHECK %s
;
; Source:
-; void foo(const void *);
+; void foo(const ptr);
; int test() {
; const char *str = "abcd";
; const struct {
@@ -24,14 +24,13 @@
define dso_local i32 @test() local_unnamed_addr #0 !dbg !7 {
entry:
%val = alloca %struct.anon, align 4
- call void @llvm.dbg.value(metadata i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), metadata !12, metadata !DIExpression()), !dbg !25
- %0 = bitcast %struct.anon* %val to i8*, !dbg !26
- call void @llvm.lifetime.start.p0i8(i64 16, i8* nonnull %0) #4, !dbg !26
- call void @llvm.dbg.declare(metadata %struct.anon* %val, metadata !16, metadata !DIExpression()), !dbg !27
- call void @llvm.memcpy.p0i8.p0i8.i64(i8* nonnull align 4 dereferenceable(16) %0, i8* nonnull align 4 dereferenceable(16) bitcast (%struct.anon* @__const.test.val to i8*), i64 16, i1 false), !dbg !27
- tail call void @foo(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)) #4, !dbg !28
- call void @foo(i8* nonnull %0) #4, !dbg !29
- call void @llvm.lifetime.end.p0i8(i64 16, i8* nonnull %0) #4, !dbg !30
+ call void @llvm.dbg.value(metadata ptr @.str, metadata !12, metadata !DIExpression()), !dbg !25
+ call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %val) #4, !dbg !26
+ call void @llvm.dbg.declare(metadata ptr %val, metadata !16, metadata !DIExpression()), !dbg !27
+ call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 4 dereferenceable(16) %val, ptr nonnull align 4 dereferenceable(16) @__const.test.val, i64 16, i1 false), !dbg !27
+ tail call void @foo(ptr @.str) #4, !dbg !28
+ call void @foo(ptr nonnull %val) #4, !dbg !29
+ call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %val) #4, !dbg !30
ret i32 0, !dbg !31
}
@@ -40,18 +39,18 @@ entry:
; CHECK-NOT: BTF_KIND_DATASEC
; Function Attrs: argmemonly nounwind willreturn
-declare void @llvm.lifetime.start.p0i8(i64 immarg, i8* nocapture) #1
+declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nounwind readnone speculatable willreturn
declare void @llvm.dbg.declare(metadata, metadata, metadata) #2
; Function Attrs: argmemonly nounwind willreturn
-declare void @llvm.memcpy.p0i8.p0i8.i64(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i64, i1 immarg) #1
+declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1
-declare !dbg !32 dso_local void @foo(i8*) local_unnamed_addr #3
+declare !dbg !32 dso_local void @foo(ptr) local_unnamed_addr #3
; Function Attrs: argmemonly nounwind willreturn
-declare void @llvm.lifetime.end.p0i8(i64 immarg, i8* nocapture) #1
+declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nounwind readnone speculatable willreturn
declare void @llvm.dbg.value(metadata, metadata, metadata) #2
diff --git a/llvm/test/CodeGen/BPF/BTF/local-var-readonly-2.ll b/llvm/test/CodeGen/BPF/BTF/local-var-readonly-2.ll
index 772b566698f40..798f3d615aebd 100644
--- a/llvm/test/CodeGen/BPF/BTF/local-var-readonly-2.ll
+++ b/llvm/test/CodeGen/BPF/BTF/local-var-readonly-2.ll
@@ -2,7 +2,7 @@
; RUN: llc -march=bpfeb -filetype=asm -o - %s | FileCheck -check-prefixes=CHECK %s
;
; Source:
-; void foo(const void *);
+; void foo(const ptr);
; int test() {
; const struct {
; unsigned a[4];
@@ -22,12 +22,11 @@
define dso_local i32 @test() local_unnamed_addr #0 !dbg !7 {
entry:
%val = alloca %struct.anon, align 4
- %0 = bitcast %struct.anon* %val to i8*, !dbg !23
- call void @llvm.lifetime.start.p0i8(i64 20, i8* nonnull %0) #4, !dbg !23
- call void @llvm.dbg.declare(metadata %struct.anon* %val, metadata !12, metadata !DIExpression()), !dbg !24
- call void @llvm.memcpy.p0i8.p0i8.i64(i8* nonnull align 4 dereferenceable(20) %0, i8* nonnull align 4 dereferenceable(20) bitcast (%struct.anon* @__const.test.val to i8*), i64 20, i1 false), !dbg !24
- call void @foo(i8* nonnull %0) #4, !dbg !25
- call void @llvm.lifetime.end.p0i8(i64 20, i8* nonnull %0) #4, !dbg !26
+ call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %val) #4, !dbg !23
+ call void @llvm.dbg.declare(metadata ptr %val, metadata !12, metadata !DIExpression()), !dbg !24
+ call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 4 dereferenceable(20) %val, ptr nonnull align 4 dereferenceable(20) @__const.test.val, i64 20, i1 false), !dbg !24
+ call void @foo(ptr nonnull %val) #4, !dbg !25
+ call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %val) #4, !dbg !26
ret i32 0, !dbg !27
}
@@ -39,18 +38,18 @@ entry:
; CHECK: .ascii ".rodata" # string offset=42
; Function Attrs: argmemonly nounwind willreturn
-declare void @llvm.lifetime.start.p0i8(i64 immarg, i8* nocapture) #1
+declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nounwind readnone speculatable willreturn
declare void @llvm.dbg.declare(metadata, metadata, metadata) #2
; Function Attrs: argmemonly nounwind willreturn
-declare void @llvm.memcpy.p0i8.p0i8.i64(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i64, i1 immarg) #1
+declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1
-declare !dbg !28 dso_local void @foo(i8*) local_unnamed_addr #3
+declare !dbg !28 dso_local void @foo(ptr) local_unnamed_addr #3
; Function Attrs: argmemonly nounwind willreturn
-declare void @llvm.lifetime.end.p0i8(i64 immarg, i8* nocapture) #1
+declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nounwind "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "frame-pointer"="all" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
attributes #1 = { argmemonly nounwind willreturn }
diff --git a/llvm/test/CodeGen/BPF/BTF/local-var.ll b/llvm/test/CodeGen/BPF/BTF/local-var.ll
index 88907b9fa5e5c..c1064cbfff308 100644
--- a/llvm/test/CodeGen/BPF/BTF/local-var.ll
+++ b/llvm/test/CodeGen/BPF/BTF/local-var.ll
@@ -10,14 +10,13 @@
define dso_local i32 @foo(i8 signext) local_unnamed_addr #0 !dbg !7 {
%2 = alloca i16, align 2
call void @llvm.dbg.value(metadata i8 %0, metadata !13, metadata !DIExpression()), !dbg !17
- %3 = bitcast i16* %2 to i8*, !dbg !18
- call void @llvm.lifetime.start.p0i8(i64 2, i8* nonnull %3), !dbg !18
- call void @llvm.dbg.declare(metadata i16* %2, metadata !14, metadata !DIExpression()), !dbg !19
- store volatile i16 0, i16* %2, align 2, !dbg !19, !tbaa !20
- %4 = load volatile i16, i16* %2, align 2, !dbg !24, !tbaa !20
- %5 = sext i16 %4 to i32, !dbg !24
- call void @llvm.lifetime.end.p0i8(i64 2, i8* nonnull %3), !dbg !25
- ret i32 %5, !dbg !26
+ call void @llvm.lifetime.start.p0(i64 2, ptr nonnull %2), !dbg !18
+ call void @llvm.dbg.declare(metadata ptr %2, metadata !14, metadata !DIExpression()), !dbg !19
+ store volatile i16 0, ptr %2, align 2, !dbg !19, !tbaa !20
+ %3 = load volatile i16, ptr %2, align 2, !dbg !24, !tbaa !20
+ %4 = sext i16 %3 to i32, !dbg !24
+ call void @llvm.lifetime.end.p0(i64 2, ptr nonnull %2), !dbg !25
+ ret i32 %4, !dbg !26
}
; CHECK: .section .BTF,"", at progbits
@@ -63,10 +62,10 @@ define dso_local i32 @foo(i8 signext) local_unnamed_addr #0 !dbg !7 {
declare void @llvm.dbg.declare(metadata, metadata, metadata) #1
; Function Attrs: argmemonly nounwind
-declare void @llvm.lifetime.start.p0i8(i64, i8* nocapture) #2
+declare void @llvm.lifetime.start.p0(i64, ptr nocapture) #2
; Function Attrs: argmemonly nounwind
-declare void @llvm.lifetime.end.p0i8(i64, i8* nocapture) #2
+declare void @llvm.lifetime.end.p0(i64, ptr nocapture) #2
; Function Attrs: nounwind readnone speculatable
declare void @llvm.dbg.value(metadata, metadata, metadata) #1
diff --git a/llvm/test/CodeGen/BPF/BTF/map-def-2.ll b/llvm/test/CodeGen/BPF/BTF/map-def-2.ll
index bf3c4a7961fbf..71069b436e359 100644
--- a/llvm/test/CodeGen/BPF/BTF/map-def-2.ll
+++ b/llvm/test/CodeGen/BPF/BTF/map-def-2.ll
@@ -6,14 +6,14 @@
; int a1;
; };
; typedef struct map_type {
-; struct key_type *key;
+; struct key_ptr key;
; } _map_type;
; typedef _map_type __map_type;
; __map_type __attribute__((section(".maps"))) hash_map;
; Compilation flag:
; clang -target bpf -O2 -g -S -emit-llvm t2.c
-%struct.map_type = type { %struct.key_type* }
+%struct.map_type = type { ptr }
%struct.key_type = type { i32 }
@hash_map = dso_local local_unnamed_addr global %struct.map_type zeroinitializer, section ".maps", align 8, !dbg !0
diff --git a/llvm/test/CodeGen/BPF/BTF/map-def.ll b/llvm/test/CodeGen/BPF/BTF/map-def.ll
index e12cde3ef98ae..d72e2462d2cd2 100644
--- a/llvm/test/CodeGen/BPF/BTF/map-def.ll
+++ b/llvm/test/CodeGen/BPF/BTF/map-def.ll
@@ -7,14 +7,14 @@
; int b;
; };
; struct map_type {
-; struct key_type *key;
+; struct key_ptr key;
; unsigned *value;
; };
; struct map_type __attribute__((section(".maps"))) hash_map;
; Compilation flag:
; clang -target bpf -O2 -g -S -emit-llvm t.c
-%struct.map_type = type { %struct.key_type*, i32* }
+%struct.map_type = type { ptr, ptr }
%struct.key_type = type { i32, i32 }
@hash_map = dso_local local_unnamed_addr global %struct.map_type zeroinitializer, section ".maps", align 8, !dbg !0
diff --git a/llvm/test/CodeGen/BPF/BTF/pruning-const.ll b/llvm/test/CodeGen/BPF/BTF/pruning-const.ll
index 516aeb46b1ce6..f41c9dddcd57e 100644
--- a/llvm/test/CodeGen/BPF/BTF/pruning-const.ll
+++ b/llvm/test/CodeGen/BPF/BTF/pruning-const.ll
@@ -17,23 +17,22 @@
; Compilation flags:
; clang -target bpf -O2 -g -S -emit-llvm t.c
-%struct.s1 = type { %struct.tt* }
+%struct.s1 = type { ptr }
%struct.tt = type { i32, i32 }
%struct.s2 = type { %struct.tt }
; Function Attrs: norecurse nounwind readnone
-define dso_local i32 @test1(%struct.s1* nocapture readnone %arg) local_unnamed_addr #0 !dbg !7 {
+define dso_local i32 @test1(ptr nocapture readnone %arg) local_unnamed_addr #0 !dbg !7 {
entry:
- call void @llvm.dbg.value(metadata %struct.s1* %arg, metadata !22, metadata !DIExpression()), !dbg !23
+ call void @llvm.dbg.value(metadata ptr %arg, metadata !22, metadata !DIExpression()), !dbg !23
ret i32 0, !dbg !24
}
; Function Attrs: norecurse nounwind readonly
-define dso_local i32 @test2(%struct.s2* nocapture readonly %arg) local_unnamed_addr #1 !dbg !25 {
+define dso_local i32 @test2(ptr nocapture readonly %arg) local_unnamed_addr #1 !dbg !25 {
entry:
- call void @llvm.dbg.value(metadata %struct.s2* %arg, metadata !33, metadata !DIExpression()), !dbg !34
- %m1 = getelementptr inbounds %struct.s2, %struct.s2* %arg, i64 0, i32 0, i32 0, !dbg !35
- %0 = load i32, i32* %m1, align 4, !dbg !35, !tbaa !36
+ call void @llvm.dbg.value(metadata ptr %arg, metadata !33, metadata !DIExpression()), !dbg !34
+ %0 = load i32, ptr %arg, align 4, !dbg !35, !tbaa !36
ret i32 %0, !dbg !42
}
diff --git a/llvm/test/CodeGen/BPF/BTF/pruning-multi-derived-type.ll b/llvm/test/CodeGen/BPF/BTF/pruning-multi-derived-type.ll
index 63c864fd0e3a8..4d5e9f61f91c4 100644
--- a/llvm/test/CodeGen/BPF/BTF/pruning-multi-derived-type.ll
+++ b/llvm/test/CodeGen/BPF/BTF/pruning-multi-derived-type.ll
@@ -12,20 +12,20 @@
; Compilation flags:
; clang -target bpf -O2 -g -S -emit-llvm t.c
-%struct.t2 = type { %struct.t1* }
+%struct.t2 = type { ptr }
%struct.t1 = type { i32 }
; Function Attrs: mustprogress nofree norecurse nosync nounwind readnone willreturn
-define dso_local i32 @foo(%struct.t2* nocapture noundef readnone %arg) local_unnamed_addr #0 !dbg !7 {
+define dso_local i32 @foo(ptr nocapture noundef readnone %arg) local_unnamed_addr #0 !dbg !7 {
entry:
- call void @llvm.dbg.value(metadata %struct.t2* %arg, metadata !22, metadata !DIExpression()), !dbg !23
+ call void @llvm.dbg.value(metadata ptr %arg, metadata !22, metadata !DIExpression()), !dbg !23
ret i32 0, !dbg !24
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind readnone willreturn
-define dso_local i32 @bar(%struct.t1* nocapture noundef readnone %arg) local_unnamed_addr #0 !dbg !25 {
+define dso_local i32 @bar(ptr nocapture noundef readnone %arg) local_unnamed_addr #0 !dbg !25 {
entry:
- call void @llvm.dbg.value(metadata %struct.t1* %arg, metadata !29, metadata !DIExpression()), !dbg !30
+ call void @llvm.dbg.value(metadata ptr %arg, metadata !29, metadata !DIExpression()), !dbg !30
ret i32 0, !dbg !31
}
diff --git a/llvm/test/CodeGen/BPF/BTF/pruning-typedef.ll b/llvm/test/CodeGen/BPF/BTF/pruning-typedef.ll
index 4ac8994a5ce36..c12a40f8247d5 100644
--- a/llvm/test/CodeGen/BPF/BTF/pruning-typedef.ll
+++ b/llvm/test/CodeGen/BPF/BTF/pruning-typedef.ll
@@ -19,23 +19,22 @@
; Compilation flags:
; clang -target bpf -O2 -g -S -emit-llvm t.c
-%struct.s1 = type { %struct.tt* }
+%struct.s1 = type { ptr }
%struct.tt = type { i32, i32 }
%struct.s2 = type { %struct.tt }
; Function Attrs: norecurse nounwind readnone
-define dso_local i32 @test1(%struct.s1* nocapture readnone %arg) local_unnamed_addr #0 !dbg !7 {
+define dso_local i32 @test1(ptr nocapture readnone %arg) local_unnamed_addr #0 !dbg !7 {
entry:
- call void @llvm.dbg.value(metadata %struct.s1* %arg, metadata !23, metadata !DIExpression()), !dbg !24
+ call void @llvm.dbg.value(metadata ptr %arg, metadata !23, metadata !DIExpression()), !dbg !24
ret i32 0, !dbg !25
}
; Function Attrs: norecurse nounwind readonly
-define dso_local i32 @test2(%struct.s2* nocapture readonly %arg) local_unnamed_addr #1 !dbg !26 {
+define dso_local i32 @test2(ptr nocapture readonly %arg) local_unnamed_addr #1 !dbg !26 {
entry:
- call void @llvm.dbg.value(metadata %struct.s2* %arg, metadata !34, metadata !DIExpression()), !dbg !35
- %m1 = getelementptr inbounds %struct.s2, %struct.s2* %arg, i64 0, i32 0, i32 0, !dbg !36
- %0 = load i32, i32* %m1, align 4, !dbg !36, !tbaa !37
+ call void @llvm.dbg.value(metadata ptr %arg, metadata !34, metadata !DIExpression()), !dbg !35
+ %0 = load i32, ptr %arg, align 4, !dbg !36, !tbaa !37
ret i32 %0, !dbg !43
}
diff --git a/llvm/test/CodeGen/BPF/BTF/ptr-const-void.ll b/llvm/test/CodeGen/BPF/BTF/ptr-const-void.ll
index 7c12d1fbdb5b3..8b107283a0a54 100644
--- a/llvm/test/CodeGen/BPF/BTF/ptr-const-void.ll
+++ b/llvm/test/CodeGen/BPF/BTF/ptr-const-void.ll
@@ -2,11 +2,11 @@
; RUN: llc -march=bpfeb -filetype=asm -o - %s | FileCheck -check-prefixes=CHECK %s
; Source code:
-; const void *a;
+; const ptr a;
; Compilation flag:
; clang -target bpf -O2 -g -S -emit-llvm t.c
- at p = common dso_local local_unnamed_addr global i8* null, align 8, !dbg !0
+ at p = common dso_local local_unnamed_addr global ptr null, align 8, !dbg !0
!llvm.dbg.cu = !{!2}
!llvm.module.flags = !{!8, !9, !10}
diff --git a/llvm/test/CodeGen/BPF/BTF/ptr-func-1.ll b/llvm/test/CodeGen/BPF/BTF/ptr-func-1.ll
index f2881e4cb673b..52da3cbd7915f 100644
--- a/llvm/test/CodeGen/BPF/BTF/ptr-func-1.ll
+++ b/llvm/test/CodeGen/BPF/BTF/ptr-func-1.ll
@@ -6,7 +6,7 @@
; Compilation flag:
; clang -target bpf -O2 -g -S -emit-llvm t.c
- at a = common dso_local local_unnamed_addr global void ()* null, align 8, !dbg !0
+ at a = common dso_local local_unnamed_addr global ptr null, align 8, !dbg !0
!llvm.dbg.cu = !{!2}
!llvm.module.flags = !{!9, !10, !11}
diff --git a/llvm/test/CodeGen/BPF/BTF/ptr-func-2.ll b/llvm/test/CodeGen/BPF/BTF/ptr-func-2.ll
index 65d7539280182..7976bfa1e2802 100644
--- a/llvm/test/CodeGen/BPF/BTF/ptr-func-2.ll
+++ b/llvm/test/CodeGen/BPF/BTF/ptr-func-2.ll
@@ -6,7 +6,7 @@
; Compilation flag:
; clang -target bpf -O2 -g -S -emit-llvm t.c
- at a = common dso_local local_unnamed_addr global i32 (i32, i8)* null, align 8, !dbg !0
+ at a = common dso_local local_unnamed_addr global ptr null, align 8, !dbg !0
!llvm.dbg.cu = !{!2}
!llvm.module.flags = !{!11, !12, !13}
diff --git a/llvm/test/CodeGen/BPF/BTF/ptr-func-3.ll b/llvm/test/CodeGen/BPF/BTF/ptr-func-3.ll
index c88b9cc7fe012..ff3b04a600d69 100644
--- a/llvm/test/CodeGen/BPF/BTF/ptr-func-3.ll
+++ b/llvm/test/CodeGen/BPF/BTF/ptr-func-3.ll
@@ -7,7 +7,7 @@
; Compilation flag:
; clang -target bpf -O2 -g -S -emit-llvm t.c
- at a = common dso_local local_unnamed_addr global i32 (i32, i32)* null, align 8, !dbg !0
+ at a = common dso_local local_unnamed_addr global ptr null, align 8, !dbg !0
!llvm.dbg.cu = !{!2}
!llvm.module.flags = !{!11, !12, !13}
diff --git a/llvm/test/CodeGen/BPF/BTF/ptr-int.ll b/llvm/test/CodeGen/BPF/BTF/ptr-int.ll
index b3f08c69b733a..4e25dd5a1a900 100644
--- a/llvm/test/CodeGen/BPF/BTF/ptr-int.ll
+++ b/llvm/test/CodeGen/BPF/BTF/ptr-int.ll
@@ -6,7 +6,7 @@
; Compilation flag:
; clang -target bpf -O2 -g -S -emit-llvm t.c
- at a = common dso_local local_unnamed_addr global i32* null, align 8, !dbg !0
+ at a = common dso_local local_unnamed_addr global ptr null, align 8, !dbg !0
!llvm.dbg.cu = !{!2}
!llvm.module.flags = !{!8, !9, !10}
diff --git a/llvm/test/CodeGen/BPF/BTF/ptr-prune-type.ll b/llvm/test/CodeGen/BPF/BTF/ptr-prune-type.ll
index 597e41394c986..2443eaecce29c 100644
--- a/llvm/test/CodeGen/BPF/BTF/ptr-prune-type.ll
+++ b/llvm/test/CodeGen/BPF/BTF/ptr-prune-type.ll
@@ -12,7 +12,7 @@
; Compilation flag:
; clang -target bpf -O2 -g -S -emit-llvm t.c
-%struct.t2 = type { %struct.t* }
+%struct.t2 = type { ptr }
%struct.t = type { i32 }
@g = dso_local local_unnamed_addr global %struct.t2 zeroinitializer, section "prune_types", align 8, !dbg !0
diff --git a/llvm/test/CodeGen/BPF/BTF/ptr-void.ll b/llvm/test/CodeGen/BPF/BTF/ptr-void.ll
index 78f5e457a5534..7ea2c26464d35 100644
--- a/llvm/test/CodeGen/BPF/BTF/ptr-void.ll
+++ b/llvm/test/CodeGen/BPF/BTF/ptr-void.ll
@@ -2,11 +2,11 @@
; RUN: llc -march=bpfeb -filetype=asm -o - %s | FileCheck -check-prefixes=CHECK %s
; Source code:
-; void *a;
+; ptr a;
; Compilation flag:
; clang -target bpf -O2 -g -S -emit-llvm t.c
- at a = common dso_local local_unnamed_addr global i8* null, align 8, !dbg !0
+ at a = common dso_local local_unnamed_addr global ptr null, align 8, !dbg !0
!llvm.dbg.cu = !{!2}
!llvm.module.flags = !{!7, !8, !9}
diff --git a/llvm/test/CodeGen/BPF/BTF/ptr-volatile-const-void.ll b/llvm/test/CodeGen/BPF/BTF/ptr-volatile-const-void.ll
index bbb9f20fb3632..8cb7c683b29f0 100644
--- a/llvm/test/CodeGen/BPF/BTF/ptr-volatile-const-void.ll
+++ b/llvm/test/CodeGen/BPF/BTF/ptr-volatile-const-void.ll
@@ -2,11 +2,11 @@
; RUN: llc -march=bpfeb -filetype=asm -o - %s | FileCheck -check-prefixes=CHECK %s
; Source code:
-; volatile const void *p;
+; volatile const ptr p;
; Compilation flag:
; clang -target bpf -O2 -g -S -emit-llvm t.c
- at p = common dso_local local_unnamed_addr global i8* null, align 8, !dbg !0
+ at p = common dso_local local_unnamed_addr global ptr null, align 8, !dbg !0
!llvm.dbg.cu = !{!2}
!llvm.module.flags = !{!9, !10, !11}
diff --git a/llvm/test/CodeGen/BPF/BTF/ptr-volatile-void.ll b/llvm/test/CodeGen/BPF/BTF/ptr-volatile-void.ll
index 6aa20e0e37f59..120b54a0bdd37 100644
--- a/llvm/test/CodeGen/BPF/BTF/ptr-volatile-void.ll
+++ b/llvm/test/CodeGen/BPF/BTF/ptr-volatile-void.ll
@@ -2,11 +2,11 @@
; RUN: llc -march=bpfeb -filetype=asm -o - %s | FileCheck -check-prefixes=CHECK %s
; Source code:
-; volatile void *a;
+; volatile ptr a;
; Compilation flag:
; clang -target bpf -O2 -g -S -emit-llvm t.c
- at p = common dso_local local_unnamed_addr global i8* null, align 8, !dbg !0
+ at p = common dso_local local_unnamed_addr global ptr null, align 8, !dbg !0
!llvm.dbg.cu = !{!2}
!llvm.module.flags = !{!8, !9, !10}
diff --git a/llvm/test/CodeGen/BPF/BTF/restrict-ptr.ll b/llvm/test/CodeGen/BPF/BTF/restrict-ptr.ll
index 806fbaab4672a..9536f63974532 100644
--- a/llvm/test/CodeGen/BPF/BTF/restrict-ptr.ll
+++ b/llvm/test/CodeGen/BPF/BTF/restrict-ptr.ll
@@ -6,7 +6,7 @@
; Compilation flag:
; clang -target bpf -O2 -g -S -emit-llvm t.c
- at p = common dso_local local_unnamed_addr global i32* null, align 8, !dbg !0
+ at p = common dso_local local_unnamed_addr global ptr null, align 8, !dbg !0
!llvm.dbg.cu = !{!2}
!llvm.module.flags = !{!9, !10, !11}
diff --git a/llvm/test/CodeGen/BPF/BTF/static-var-derived-type.ll b/llvm/test/CodeGen/BPF/BTF/static-var-derived-type.ll
index 1a1adc48c24dc..aa8ae5d681e40 100644
--- a/llvm/test/CodeGen/BPF/BTF/static-var-derived-type.ll
+++ b/llvm/test/CodeGen/BPF/BTF/static-var-derived-type.ll
@@ -11,24 +11,24 @@
; Compilation flag:
; clang -target bpf -O2 -g -S -emit-llvm test.c
- at v1 = internal global i32* null, align 8, !dbg !0
- at v2 = internal global i32* null, align 8, !dbg !8
- at v3 = internal global i32* null, align 8, !dbg !14
- at v4 = internal constant i32* null, align 8, !dbg !19
+ at v1 = internal global ptr null, align 8, !dbg !0
+ at v2 = internal global ptr null, align 8, !dbg !8
+ at v3 = internal global ptr null, align 8, !dbg !14
+ at v4 = internal constant ptr null, align 8, !dbg !19
; Function Attrs: norecurse nounwind
define dso_local i64 @foo() local_unnamed_addr #0 !dbg !27 {
- %1 = load volatile i32*, i32** @v1, align 8, !dbg !29, !tbaa !30
- %2 = load volatile i32*, i32** @v2, align 8, !dbg !34, !tbaa !30
- %3 = ptrtoint i32* %1 to i64, !dbg !35
- %4 = ptrtoint i32* %2 to i64, !dbg !35
+ %1 = load volatile ptr, ptr @v1, align 8, !dbg !29, !tbaa !30
+ %2 = load volatile ptr, ptr @v2, align 8, !dbg !34, !tbaa !30
+ %3 = ptrtoint ptr %1 to i64, !dbg !35
+ %4 = ptrtoint ptr %2 to i64, !dbg !35
%5 = sub i64 %3, %4, !dbg !35
%6 = ashr exact i64 %5, 2, !dbg !35
- %7 = load volatile i32*, i32** @v3, align 8, !dbg !36, !tbaa !30
- %8 = getelementptr inbounds i32, i32* %7, i64 %6, !dbg !37
- %9 = load volatile i32*, i32** @v4, align 8, !dbg !38, !tbaa !30
- %10 = ptrtoint i32* %8 to i64, !dbg !39
- %11 = ptrtoint i32* %9 to i64, !dbg !39
+ %7 = load volatile ptr, ptr @v3, align 8, !dbg !36, !tbaa !30
+ %8 = getelementptr inbounds i32, ptr %7, i64 %6, !dbg !37
+ %9 = load volatile ptr, ptr @v4, align 8, !dbg !38, !tbaa !30
+ %10 = ptrtoint ptr %8 to i64, !dbg !39
+ %11 = ptrtoint ptr %9 to i64, !dbg !39
%12 = sub i64 %10, %11, !dbg !39
%13 = ashr exact i64 %12, 2, !dbg !39
ret i64 %13, !dbg !40
diff --git a/llvm/test/CodeGen/BPF/BTF/static-var-inited-sec.ll b/llvm/test/CodeGen/BPF/BTF/static-var-inited-sec.ll
index 5ae2e99b961c5..cfea2b7a51b84 100644
--- a/llvm/test/CodeGen/BPF/BTF/static-var-inited-sec.ll
+++ b/llvm/test/CodeGen/BPF/BTF/static-var-inited-sec.ll
@@ -15,9 +15,9 @@
; Function Attrs: norecurse nounwind
define dso_local i32 @foo() local_unnamed_addr #0 !dbg !2 {
- %1 = load volatile i8, i8* @a, align 1, !dbg !20, !tbaa !21
+ %1 = load volatile i8, ptr @a, align 1, !dbg !20, !tbaa !21
%2 = sext i8 %1 to i32, !dbg !20
- %3 = load volatile i16, i16* @foo.b, align 2, !dbg !24, !tbaa !25
+ %3 = load volatile i16, ptr @foo.b, align 2, !dbg !24, !tbaa !25
%4 = sext i16 %3 to i32, !dbg !24
%5 = add nsw i32 %4, %2, !dbg !27
ret i32 %5, !dbg !28
diff --git a/llvm/test/CodeGen/BPF/BTF/static-var-inited.ll b/llvm/test/CodeGen/BPF/BTF/static-var-inited.ll
index 4cfcb0b81cd85..4dac018336e20 100644
--- a/llvm/test/CodeGen/BPF/BTF/static-var-inited.ll
+++ b/llvm/test/CodeGen/BPF/BTF/static-var-inited.ll
@@ -15,9 +15,9 @@
; Function Attrs: norecurse nounwind
define dso_local i32 @foo() local_unnamed_addr #0 !dbg !2 {
- %1 = load volatile i8, i8* @a, align 1, !dbg !20, !tbaa !21
+ %1 = load volatile i8, ptr @a, align 1, !dbg !20, !tbaa !21
%2 = sext i8 %1 to i32, !dbg !20
- %3 = load volatile i16, i16* @foo.b, align 2, !dbg !24, !tbaa !25
+ %3 = load volatile i16, ptr @foo.b, align 2, !dbg !24, !tbaa !25
%4 = sext i16 %3 to i32, !dbg !24
%5 = add nsw i32 %4, %2, !dbg !27
ret i32 %5, !dbg !28
diff --git a/llvm/test/CodeGen/BPF/BTF/static-var-readonly-sec.ll b/llvm/test/CodeGen/BPF/BTF/static-var-readonly-sec.ll
index 2ebc3723c4a45..90f9c766e1d8c 100644
--- a/llvm/test/CodeGen/BPF/BTF/static-var-readonly-sec.ll
+++ b/llvm/test/CodeGen/BPF/BTF/static-var-readonly-sec.ll
@@ -15,9 +15,9 @@
; Function Attrs: norecurse nounwind
define dso_local i32 @foo() local_unnamed_addr #0 !dbg !2 {
- %1 = load volatile i8, i8* @a, align 1, !dbg !22, !tbaa !23
+ %1 = load volatile i8, ptr @a, align 1, !dbg !22, !tbaa !23
%2 = sext i8 %1 to i32, !dbg !22
- %3 = load volatile i16, i16* @foo.b, align 2, !dbg !26, !tbaa !27
+ %3 = load volatile i16, ptr @foo.b, align 2, !dbg !26, !tbaa !27
%4 = sext i16 %3 to i32, !dbg !26
%5 = add nsw i32 %4, %2, !dbg !29
ret i32 %5, !dbg !30
diff --git a/llvm/test/CodeGen/BPF/BTF/static-var-readonly.ll b/llvm/test/CodeGen/BPF/BTF/static-var-readonly.ll
index 50812b1a4d087..78a0149a36251 100644
--- a/llvm/test/CodeGen/BPF/BTF/static-var-readonly.ll
+++ b/llvm/test/CodeGen/BPF/BTF/static-var-readonly.ll
@@ -15,9 +15,9 @@
; Function Attrs: norecurse nounwind
define dso_local i32 @foo() local_unnamed_addr #0 !dbg !2 {
- %1 = load volatile i8, i8* @a, align 1, !dbg !22, !tbaa !23
+ %1 = load volatile i8, ptr @a, align 1, !dbg !22, !tbaa !23
%2 = sext i8 %1 to i32, !dbg !22
- %3 = load volatile i16, i16* @foo.b, align 2, !dbg !26, !tbaa !27
+ %3 = load volatile i16, ptr @foo.b, align 2, !dbg !26, !tbaa !27
%4 = sext i16 %3 to i32, !dbg !26
%5 = add nsw i32 %4, %2, !dbg !29
ret i32 %5, !dbg !30
diff --git a/llvm/test/CodeGen/BPF/BTF/static-var-sec.ll b/llvm/test/CodeGen/BPF/BTF/static-var-sec.ll
index dc1318256ab26..77f818f58471a 100644
--- a/llvm/test/CodeGen/BPF/BTF/static-var-sec.ll
+++ b/llvm/test/CodeGen/BPF/BTF/static-var-sec.ll
@@ -15,9 +15,9 @@
; Function Attrs: norecurse nounwind
define dso_local i32 @foo() local_unnamed_addr #0 !dbg !2 {
- %1 = load volatile i8, i8* @a, align 1, !dbg !20, !tbaa !21
+ %1 = load volatile i8, ptr @a, align 1, !dbg !20, !tbaa !21
%2 = sext i8 %1 to i32, !dbg !20
- %3 = load volatile i16, i16* @foo.b, align 2, !dbg !24, !tbaa !25
+ %3 = load volatile i16, ptr @foo.b, align 2, !dbg !24, !tbaa !25
%4 = sext i16 %3 to i32, !dbg !24
%5 = add nsw i32 %4, %2, !dbg !27
ret i32 %5, !dbg !28
diff --git a/llvm/test/CodeGen/BPF/BTF/static-var-zerolen-array.ll b/llvm/test/CodeGen/BPF/BTF/static-var-zerolen-array.ll
index 987a206e9bb29..38f7627f10e89 100644
--- a/llvm/test/CodeGen/BPF/BTF/static-var-zerolen-array.ll
+++ b/llvm/test/CodeGen/BPF/BTF/static-var-zerolen-array.ll
@@ -16,7 +16,7 @@
; Function Attrs: norecurse nounwind
define dso_local i32 @test() local_unnamed_addr #0 !dbg !21 {
- %1 = load volatile i32, i32* getelementptr inbounds ({ i32, i32, [10 x i8] }, { i32, i32, [10 x i8] }* @sv, i64 0, i32 0), align 4, !dbg !24, !tbaa !25
+ %1 = load volatile i32, ptr getelementptr inbounds ({ i32, i32, [10 x i8] }, ptr @sv, i64 0, i32 0), align 4, !dbg !24, !tbaa !25
ret i32 %1, !dbg !29
}
diff --git a/llvm/test/CodeGen/BPF/BTF/static-var.ll b/llvm/test/CodeGen/BPF/BTF/static-var.ll
index 6828a9d3f0609..0d6a229218e58 100644
--- a/llvm/test/CodeGen/BPF/BTF/static-var.ll
+++ b/llvm/test/CodeGen/BPF/BTF/static-var.ll
@@ -15,9 +15,9 @@
; Function Attrs: norecurse nounwind
define dso_local i32 @foo() local_unnamed_addr #0 !dbg !2 {
- %1 = load volatile i8, i8* @a, align 1, !dbg !20, !tbaa !21
+ %1 = load volatile i8, ptr @a, align 1, !dbg !20, !tbaa !21
%2 = sext i8 %1 to i32, !dbg !20
- %3 = load volatile i16, i16* @foo.b, align 2, !dbg !24, !tbaa !25
+ %3 = load volatile i16, ptr @foo.b, align 2, !dbg !24, !tbaa !25
%4 = sext i16 %3 to i32, !dbg !24
%5 = add nsw i32 %4, %2, !dbg !27
ret i32 %5, !dbg !28
diff --git a/llvm/test/CodeGen/BPF/BTF/struct-anon-2.ll b/llvm/test/CodeGen/BPF/BTF/struct-anon-2.ll
index d8f4f2360eaf5..8cb168ce88a25 100644
--- a/llvm/test/CodeGen/BPF/BTF/struct-anon-2.ll
+++ b/llvm/test/CodeGen/BPF/BTF/struct-anon-2.ll
@@ -4,20 +4,20 @@
; Source:
; struct s1 {
; struct { int A1; } a1;
-; struct { long B1; } *b1;
+; struct ptr b1;
; };
; int f1(struct s1 *s1) { return 0; }
; Compilation flag:
; clang -target bpf -O2 -g -S -emit-llvm t.c
-%struct.s1 = type { %struct.anon, %struct.anon.0* }
+%struct.s1 = type { %struct.anon, ptr }
%struct.anon = type { i32 }
%struct.anon.0 = type { i64 }
; Function Attrs: norecurse nounwind readnone
-define dso_local i32 @f1(%struct.s1* nocapture readnone %s1) local_unnamed_addr #0 !dbg !7 {
+define dso_local i32 @f1(ptr nocapture readnone %s1) local_unnamed_addr #0 !dbg !7 {
entry:
- call void @llvm.dbg.value(metadata %struct.s1* %s1, metadata !25, metadata !DIExpression()), !dbg !26
+ call void @llvm.dbg.value(metadata ptr %s1, metadata !25, metadata !DIExpression()), !dbg !26
ret i32 0, !dbg !27
}
diff --git a/llvm/test/CodeGen/BPF/BTF/tag-2.ll b/llvm/test/CodeGen/BPF/BTF/tag-2.ll
index e1e6bf5192de4..eaf6f234a2fb8 100644
--- a/llvm/test/CodeGen/BPF/BTF/tag-2.ll
+++ b/llvm/test/CodeGen/BPF/BTF/tag-2.ll
@@ -12,11 +12,11 @@
; clang -target bpf -O2 -g -S -emit-llvm t.c
; Function Attrs: nounwind
-define dso_local i32 @foo(i32 %arg1, i32* nocapture readonly %arg2) local_unnamed_addr #0 !dbg !8 {
+define dso_local i32 @foo(i32 %arg1, ptr nocapture readonly %arg2) local_unnamed_addr #0 !dbg !8 {
entry:
call void @llvm.dbg.value(metadata i32 %arg1, metadata !14, metadata !DIExpression()), !dbg !18
- call void @llvm.dbg.value(metadata i32* %arg2, metadata !15, metadata !DIExpression()), !dbg !18
- %0 = load i32, i32* %arg2, align 4, !dbg !19, !tbaa !20
+ call void @llvm.dbg.value(metadata ptr %arg2, metadata !15, metadata !DIExpression()), !dbg !18
+ %0 = load i32, ptr %arg2, align 4, !dbg !19, !tbaa !20
%add = add nsw i32 %0, %arg1, !dbg !24
%add1 = add nsw i32 %arg1, 1, !dbg !25
%call = tail call i32 @bar(i32 %arg1, i32 %add1) #3, !dbg !26
diff --git a/llvm/test/CodeGen/BPF/BTF/tag-typedef.ll b/llvm/test/CodeGen/BPF/BTF/tag-typedef.ll
index a3061ee8a3fc6..80031410c2bca 100644
--- a/llvm/test/CodeGen/BPF/BTF/tag-typedef.ll
+++ b/llvm/test/CodeGen/BPF/BTF/tag-typedef.ll
@@ -13,7 +13,7 @@
%struct.__s = type { i32 }
@a = dso_local local_unnamed_addr global %struct.__s zeroinitializer, align 4, !dbg !0
- at u = dso_local local_unnamed_addr global i32* null, align 8, !dbg !5
+ at u = dso_local local_unnamed_addr global ptr null, align 8, !dbg !5
!llvm.dbg.cu = !{!2}
!llvm.module.flags = !{!17, !18, !19, !20}
diff --git a/llvm/test/CodeGen/BPF/BTF/type-tag-var.ll b/llvm/test/CodeGen/BPF/BTF/type-tag-var.ll
index 77f7a0cf8c8f5..61d3705ff34d2 100644
--- a/llvm/test/CodeGen/BPF/BTF/type-tag-var.ll
+++ b/llvm/test/CodeGen/BPF/BTF/type-tag-var.ll
@@ -8,7 +8,7 @@
; Compilation flag:
; clang -target bpf -O2 -g -S -emit-llvm test.c
- at g = dso_local local_unnamed_addr global i32** null, align 8, !dbg !0
+ at g = dso_local local_unnamed_addr global ptr null, align 8, !dbg !0
!llvm.dbg.cu = !{!2}
!llvm.module.flags = !{!12, !13, !14, !15}
diff --git a/llvm/test/CodeGen/BPF/BTF/weak-global-2.ll b/llvm/test/CodeGen/BPF/BTF/weak-global-2.ll
index a3b187a7d408e..314058439dcab 100644
--- a/llvm/test/CodeGen/BPF/BTF/weak-global-2.ll
+++ b/llvm/test/CodeGen/BPF/BTF/weak-global-2.ll
@@ -13,7 +13,7 @@
; Function Attrs: norecurse nounwind readonly
define dso_local i32 @test() local_unnamed_addr #0 !dbg !11 {
entry:
- %0 = load i8, i8* @g, align 1, !dbg !15, !tbaa !16
+ %0 = load i8, ptr @g, align 1, !dbg !15, !tbaa !16
%conv = sext i8 %0 to i32, !dbg !15
ret i32 %conv, !dbg !19
}
diff --git a/llvm/test/CodeGen/BPF/BTF/weak-global-3.ll b/llvm/test/CodeGen/BPF/BTF/weak-global-3.ll
index dbd6380a9f1ab..e019775f11cec 100644
--- a/llvm/test/CodeGen/BPF/BTF/weak-global-3.ll
+++ b/llvm/test/CodeGen/BPF/BTF/weak-global-3.ll
@@ -14,7 +14,7 @@
; Function Attrs: nofree norecurse nounwind willreturn
define dso_local i32 @test() local_unnamed_addr #0 !dbg !13 {
entry:
- %0 = load volatile i8, i8* @g, align 1, !dbg !17, !tbaa !18
+ %0 = load volatile i8, ptr @g, align 1, !dbg !17, !tbaa !18
%conv = sext i8 %0 to i32, !dbg !17
ret i32 %conv, !dbg !21
}
diff --git a/llvm/test/CodeGen/BPF/BTF/weak-global.ll b/llvm/test/CodeGen/BPF/BTF/weak-global.ll
index 79e62f8b9dfea..7d92d606650de 100644
--- a/llvm/test/CodeGen/BPF/BTF/weak-global.ll
+++ b/llvm/test/CodeGen/BPF/BTF/weak-global.ll
@@ -13,7 +13,7 @@
; Function Attrs: norecurse nounwind readonly
define dso_local i32 @test() local_unnamed_addr #0 !dbg !11 {
entry:
- %0 = load i8, i8* @g, align 1, !dbg !15, !tbaa !16
+ %0 = load i8, ptr @g, align 1, !dbg !15, !tbaa !16
%conv = sext i8 %0 to i32, !dbg !15
ret i32 %conv, !dbg !19
}
diff --git a/llvm/test/CodeGen/BPF/CORE/btf-id-duplicate.ll b/llvm/test/CodeGen/BPF/CORE/btf-id-duplicate.ll
index d5dc3d321caae..23a461752e1b8 100644
--- a/llvm/test/CodeGen/BPF/CORE/btf-id-duplicate.ll
+++ b/llvm/test/CodeGen/BPF/CORE/btf-id-duplicate.ll
@@ -13,11 +13,11 @@
%struct.s1 = type { i32, i32 }
; Function Attrs: nounwind
-define dso_local i32 @foo(%struct.s1* %arg) #0 !dbg !7 {
+define dso_local i32 @foo(ptr %arg) #0 !dbg !7 {
entry:
- %arg.addr = alloca %struct.s1*, align 8
- store %struct.s1* %arg, %struct.s1** %arg.addr, align 8, !tbaa !18
- call void @llvm.dbg.declare(metadata %struct.s1** %arg.addr, metadata !17, metadata !DIExpression()), !dbg !22
+ %arg.addr = alloca ptr, align 8
+ store ptr %arg, ptr %arg.addr, align 8, !tbaa !18
+ call void @llvm.dbg.declare(metadata ptr %arg.addr, metadata !17, metadata !DIExpression()), !dbg !22
%0 = call i64 @llvm.bpf.btf.type.id(i32 0, i64 0), !dbg !23, !llvm.preserve.access.index !12
%conv = trunc i64 %0 to i32, !dbg !23
ret i32 %conv, !dbg !24
@@ -30,11 +30,11 @@ declare void @llvm.dbg.declare(metadata, metadata, metadata) #1
declare i64 @llvm.bpf.btf.type.id(i32, i64) #2
; Function Attrs: nounwind
-define dso_local i32 @bar(%struct.s1* %arg) #0 !dbg !25 {
+define dso_local i32 @bar(ptr %arg) #0 !dbg !25 {
entry:
- %arg.addr = alloca %struct.s1*, align 8
- store %struct.s1* %arg, %struct.s1** %arg.addr, align 8, !tbaa !18
- call void @llvm.dbg.declare(metadata %struct.s1** %arg.addr, metadata !27, metadata !DIExpression()), !dbg !28
+ %arg.addr = alloca ptr, align 8
+ store ptr %arg, ptr %arg.addr, align 8, !tbaa !18
+ call void @llvm.dbg.declare(metadata ptr %arg.addr, metadata !27, metadata !DIExpression()), !dbg !28
%0 = call i64 @llvm.bpf.btf.type.id(i32 1, i64 0), !dbg !29, !llvm.preserve.access.index !12
%conv = trunc i64 %0 to i32, !dbg !29
ret i32 %conv, !dbg !30
diff --git a/llvm/test/CodeGen/BPF/CORE/field-reloc-alu32.ll b/llvm/test/CodeGen/BPF/CORE/field-reloc-alu32.ll
index 7596ba03b5c44..40a2432d67850 100644
--- a/llvm/test/CodeGen/BPF/CORE/field-reloc-alu32.ll
+++ b/llvm/test/CodeGen/BPF/CORE/field-reloc-alu32.ll
@@ -17,8 +17,8 @@ target triple = "bpf"
; Function Attrs: nounwind readnone
define dso_local i32 @f() local_unnamed_addr #0 !dbg !15 {
entry:
- %0 = tail call i32* @llvm.preserve.struct.access.index.p0i32.p0s_struct.bs(%struct.b* elementtype(%struct.b) nonnull @c, i32 1, i32 1), !dbg !18, !llvm.preserve.access.index !6
- %1 = tail call i32 @llvm.bpf.preserve.field.info.p0i32(i32* %0, i64 0), !dbg !19
+ %0 = tail call ptr @llvm.preserve.struct.access.index.p0.p0.bs(ptr elementtype(%struct.b) nonnull @c, i32 1, i32 1), !dbg !18, !llvm.preserve.access.index !6
+ %1 = tail call i32 @llvm.bpf.preserve.field.info.p0(ptr %0, i64 0), !dbg !19
ret i32 %1, !dbg !20
}
@@ -40,10 +40,10 @@ entry:
; CHECK-NEXT: .long 0
; Function Attrs: nounwind readnone
-declare i32* @llvm.preserve.struct.access.index.p0i32.p0s_struct.bs(%struct.b*, i32, i32) #1
+declare ptr @llvm.preserve.struct.access.index.p0.p0.bs(ptr, i32, i32) #1
; Function Attrs: nounwind readnone
-declare i32 @llvm.bpf.preserve.field.info.p0i32(i32*, i64) #1
+declare i32 @llvm.bpf.preserve.field.info.p0(ptr, i64) #1
attributes #0 = { nounwind readnone "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "frame-pointer"="all" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
attributes #1 = { nounwind readnone }
diff --git a/llvm/test/CodeGen/BPF/CORE/field-reloc-bitfield-1-bpfeb.ll b/llvm/test/CodeGen/BPF/CORE/field-reloc-bitfield-1-bpfeb.ll
index d37e6a1093d89..f38cd4cb336d3 100644
--- a/llvm/test/CodeGen/BPF/CORE/field-reloc-bitfield-1-bpfeb.ll
+++ b/llvm/test/CodeGen/BPF/CORE/field-reloc-bitfield-1-bpfeb.ll
@@ -25,14 +25,14 @@ target triple = "bpfeb"
%struct.s = type { i64, i32, i32, i32, i8, i8 }
; Function Attrs: nounwind readnone
-define dso_local i32 @test(%struct.s* %arg) local_unnamed_addr #0 !dbg !13 {
+define dso_local i32 @test(ptr %arg) local_unnamed_addr #0 !dbg !13 {
entry:
- call void @llvm.dbg.value(metadata %struct.s* %arg, metadata !30, metadata !DIExpression()), !dbg !31
- %0 = tail call i8* @llvm.preserve.struct.access.index.p0i8.p0s_struct.ss(%struct.s* elementtype(%struct.s) %arg, i32 5, i32 6), !dbg !32, !llvm.preserve.access.index !18
- %1 = tail call i32 @llvm.bpf.preserve.field.info.p0i8(i8* %0, i64 0), !dbg !33
- %2 = tail call i32 @llvm.bpf.preserve.field.info.p0i8(i8* %0, i64 1), !dbg !34
+ call void @llvm.dbg.value(metadata ptr %arg, metadata !30, metadata !DIExpression()), !dbg !31
+ %0 = tail call ptr @llvm.preserve.struct.access.index.p0.p0.ss(ptr elementtype(%struct.s) %arg, i32 5, i32 6), !dbg !32, !llvm.preserve.access.index !18
+ %1 = tail call i32 @llvm.bpf.preserve.field.info.p0(ptr %0, i64 0), !dbg !33
+ %2 = tail call i32 @llvm.bpf.preserve.field.info.p0(ptr %0, i64 1), !dbg !34
%add = add i32 %2, %1, !dbg !35
- %3 = tail call i32 @llvm.bpf.preserve.field.info.p0i8(i8* %0, i64 4), !dbg !36
+ %3 = tail call i32 @llvm.bpf.preserve.field.info.p0(ptr %0, i64 4), !dbg !36
%add1 = add i32 %add, %3, !dbg !37
ret i32 %add1, !dbg !38
}
@@ -69,10 +69,10 @@ entry:
; CHECK-NEXT: .long 4
; Function Attrs: nounwind readnone
-declare i8* @llvm.preserve.struct.access.index.p0i8.p0s_struct.ss(%struct.s*, i32, i32) #1
+declare ptr @llvm.preserve.struct.access.index.p0.p0.ss(ptr, i32, i32) #1
; Function Attrs: nounwind readnone
-declare i32 @llvm.bpf.preserve.field.info.p0i8(i8*, i64) #1
+declare i32 @llvm.bpf.preserve.field.info.p0(ptr, i64) #1
; Function Attrs: nounwind readnone speculatable
declare void @llvm.dbg.value(metadata, metadata, metadata) #2
diff --git a/llvm/test/CodeGen/BPF/CORE/field-reloc-bitfield-1.ll b/llvm/test/CodeGen/BPF/CORE/field-reloc-bitfield-1.ll
index 3006bd829c530..98a333d54fd38 100644
--- a/llvm/test/CodeGen/BPF/CORE/field-reloc-bitfield-1.ll
+++ b/llvm/test/CodeGen/BPF/CORE/field-reloc-bitfield-1.ll
@@ -25,14 +25,14 @@ target triple = "bpfel"
%struct.s = type { i64, i32, i32, i32, i8, i8 }
; Function Attrs: nounwind readnone
-define dso_local i32 @test(%struct.s* %arg) local_unnamed_addr #0 !dbg !13 {
+define dso_local i32 @test(ptr %arg) local_unnamed_addr #0 !dbg !13 {
entry:
- call void @llvm.dbg.value(metadata %struct.s* %arg, metadata !30, metadata !DIExpression()), !dbg !31
- %0 = tail call i8* @llvm.preserve.struct.access.index.p0i8.p0s_struct.ss(%struct.s* elementtype(%struct.s) %arg, i32 5, i32 6), !dbg !32, !llvm.preserve.access.index !18
- %1 = tail call i32 @llvm.bpf.preserve.field.info.p0i8(i8* %0, i64 0), !dbg !33
- %2 = tail call i32 @llvm.bpf.preserve.field.info.p0i8(i8* %0, i64 1), !dbg !34
+ call void @llvm.dbg.value(metadata ptr %arg, metadata !30, metadata !DIExpression()), !dbg !31
+ %0 = tail call ptr @llvm.preserve.struct.access.index.p0.p0.ss(ptr elementtype(%struct.s) %arg, i32 5, i32 6), !dbg !32, !llvm.preserve.access.index !18
+ %1 = tail call i32 @llvm.bpf.preserve.field.info.p0(ptr %0, i64 0), !dbg !33
+ %2 = tail call i32 @llvm.bpf.preserve.field.info.p0(ptr %0, i64 1), !dbg !34
%add = add i32 %2, %1, !dbg !35
- %3 = tail call i32 @llvm.bpf.preserve.field.info.p0i8(i8* %0, i64 4), !dbg !36
+ %3 = tail call i32 @llvm.bpf.preserve.field.info.p0(ptr %0, i64 4), !dbg !36
%add1 = add i32 %add, %3, !dbg !37
ret i32 %add1, !dbg !38
}
@@ -69,10 +69,10 @@ entry:
; CHECK-NEXT: .long 4
; Function Attrs: nounwind readnone
-declare i8* @llvm.preserve.struct.access.index.p0i8.p0s_struct.ss(%struct.s*, i32, i32) #1
+declare ptr @llvm.preserve.struct.access.index.p0.p0.ss(ptr, i32, i32) #1
; Function Attrs: nounwind readnone
-declare i32 @llvm.bpf.preserve.field.info.p0i8(i8*, i64) #1
+declare i32 @llvm.bpf.preserve.field.info.p0(ptr, i64) #1
; Function Attrs: nounwind readnone speculatable
declare void @llvm.dbg.value(metadata, metadata, metadata) #2
diff --git a/llvm/test/CodeGen/BPF/CORE/field-reloc-bitfield-2-bpfeb.ll b/llvm/test/CodeGen/BPF/CORE/field-reloc-bitfield-2-bpfeb.ll
index 9a6d7786be08a..8f344f2df9d70 100644
--- a/llvm/test/CodeGen/BPF/CORE/field-reloc-bitfield-2-bpfeb.ll
+++ b/llvm/test/CodeGen/BPF/CORE/field-reloc-bitfield-2-bpfeb.ll
@@ -26,14 +26,14 @@ target triple = "bpfeb"
%struct.s = type <{ i8, i16 }>
; Function Attrs: nounwind readnone
-define dso_local i32 @test(%struct.s* %arg) local_unnamed_addr #0 !dbg !13 {
+define dso_local i32 @test(ptr %arg) local_unnamed_addr #0 !dbg !13 {
entry:
- call void @llvm.dbg.value(metadata %struct.s* %arg, metadata !27, metadata !DIExpression()), !dbg !28
- %0 = tail call i16* @llvm.preserve.struct.access.index.p0i16.p0s_struct.ss(%struct.s* elementtype(%struct.s) %arg, i32 1, i32 4), !dbg !29, !llvm.preserve.access.index !18
- %1 = tail call i32 @llvm.bpf.preserve.field.info.p0i16(i16* %0, i64 0), !dbg !30
- %2 = tail call i32 @llvm.bpf.preserve.field.info.p0i16(i16* %0, i64 1), !dbg !31
+ call void @llvm.dbg.value(metadata ptr %arg, metadata !27, metadata !DIExpression()), !dbg !28
+ %0 = tail call ptr @llvm.preserve.struct.access.index.p0.p0.ss(ptr elementtype(%struct.s) %arg, i32 1, i32 4), !dbg !29, !llvm.preserve.access.index !18
+ %1 = tail call i32 @llvm.bpf.preserve.field.info.p0(ptr %0, i64 0), !dbg !30
+ %2 = tail call i32 @llvm.bpf.preserve.field.info.p0(ptr %0, i64 1), !dbg !31
%add = add i32 %2, %1, !dbg !32
- %3 = tail call i32 @llvm.bpf.preserve.field.info.p0i16(i16* %0, i64 4), !dbg !33
+ %3 = tail call i32 @llvm.bpf.preserve.field.info.p0(ptr %0, i64 4), !dbg !33
%add1 = add i32 %add, %3, !dbg !34
ret i32 %add1, !dbg !35
}
@@ -70,10 +70,10 @@ entry:
; CHECK-NEXT: .long 4
; Function Attrs: nounwind readnone
-declare i16* @llvm.preserve.struct.access.index.p0i16.p0s_struct.ss(%struct.s*, i32, i32) #1
+declare ptr @llvm.preserve.struct.access.index.p0.p0.ss(ptr, i32, i32) #1
; Function Attrs: nounwind readnone
-declare i32 @llvm.bpf.preserve.field.info.p0i16(i16*, i64) #1
+declare i32 @llvm.bpf.preserve.field.info.p0(ptr, i64) #1
; Function Attrs: nounwind readnone speculatable
declare void @llvm.dbg.value(metadata, metadata, metadata) #2
diff --git a/llvm/test/CodeGen/BPF/CORE/field-reloc-bitfield-2.ll b/llvm/test/CodeGen/BPF/CORE/field-reloc-bitfield-2.ll
index 8bf0dbffdf3e0..903fcb2b30a0c 100644
--- a/llvm/test/CodeGen/BPF/CORE/field-reloc-bitfield-2.ll
+++ b/llvm/test/CodeGen/BPF/CORE/field-reloc-bitfield-2.ll
@@ -26,14 +26,14 @@ target triple = "bpfel"
%struct.s = type <{ i8, i16 }>
; Function Attrs: nounwind readnone
-define dso_local i32 @test(%struct.s* %arg) local_unnamed_addr #0 !dbg !13 {
+define dso_local i32 @test(ptr %arg) local_unnamed_addr #0 !dbg !13 {
entry:
- call void @llvm.dbg.value(metadata %struct.s* %arg, metadata !27, metadata !DIExpression()), !dbg !28
- %0 = tail call i16* @llvm.preserve.struct.access.index.p0i16.p0s_struct.ss(%struct.s* elementtype(%struct.s) %arg, i32 1, i32 4), !dbg !29, !llvm.preserve.access.index !18
- %1 = tail call i32 @llvm.bpf.preserve.field.info.p0i16(i16* %0, i64 0), !dbg !30
- %2 = tail call i32 @llvm.bpf.preserve.field.info.p0i16(i16* %0, i64 1), !dbg !31
+ call void @llvm.dbg.value(metadata ptr %arg, metadata !27, metadata !DIExpression()), !dbg !28
+ %0 = tail call ptr @llvm.preserve.struct.access.index.p0.p0.ss(ptr elementtype(%struct.s) %arg, i32 1, i32 4), !dbg !29, !llvm.preserve.access.index !18
+ %1 = tail call i32 @llvm.bpf.preserve.field.info.p0(ptr %0, i64 0), !dbg !30
+ %2 = tail call i32 @llvm.bpf.preserve.field.info.p0(ptr %0, i64 1), !dbg !31
%add = add i32 %2, %1, !dbg !32
- %3 = tail call i32 @llvm.bpf.preserve.field.info.p0i16(i16* %0, i64 4), !dbg !33
+ %3 = tail call i32 @llvm.bpf.preserve.field.info.p0(ptr %0, i64 4), !dbg !33
%add1 = add i32 %add, %3, !dbg !34
ret i32 %add1, !dbg !35
}
@@ -70,10 +70,10 @@ entry:
; CHECK-NEXT: .long 4
; Function Attrs: nounwind readnone
-declare i16* @llvm.preserve.struct.access.index.p0i16.p0s_struct.ss(%struct.s*, i32, i32) #1
+declare ptr @llvm.preserve.struct.access.index.p0.p0.ss(ptr, i32, i32) #1
; Function Attrs: nounwind readnone
-declare i32 @llvm.bpf.preserve.field.info.p0i16(i16*, i64) #1
+declare i32 @llvm.bpf.preserve.field.info.p0(ptr, i64) #1
; Function Attrs: nounwind readnone speculatable
declare void @llvm.dbg.value(metadata, metadata, metadata) #2
diff --git a/llvm/test/CodeGen/BPF/CORE/field-reloc-bitfield-record-align16.ll b/llvm/test/CodeGen/BPF/CORE/field-reloc-bitfield-record-align16.ll
index b29cd217a7e88..a89524264637d 100644
--- a/llvm/test/CodeGen/BPF/CORE/field-reloc-bitfield-record-align16.ll
+++ b/llvm/test/CodeGen/BPF/CORE/field-reloc-bitfield-record-align16.ll
@@ -43,8 +43,8 @@ target triple = "bpfel"
; Function Attrs: nounwind
define dso_local i32 @foo() #0 !dbg !22 {
entry:
- %0 = call i512* @llvm.preserve.struct.access.index.p0i512.p0s_struct.t1s(%struct.t1* elementtype(%struct.t1) @g, i32 0, i32 0), !dbg !26, !llvm.preserve.access.index !5
- %bf.load = load i512, i512* %0, align 4, !dbg !26
+ %0 = call ptr @llvm.preserve.struct.access.index.p0.p0.t1s(ptr elementtype(%struct.t1) @g, i32 0, i32 0), !dbg !26, !llvm.preserve.access.index !5
+ %bf.load = load i512, ptr %0, align 4, !dbg !26
%bf.shl = shl i512 %bf.load, 511, !dbg !26
%bf.ashr = ashr i512 %bf.shl, 511, !dbg !26
%bf.cast = trunc i512 %bf.ashr to i32, !dbg !26
@@ -66,7 +66,7 @@ entry:
; CHECK: .long 0
; Function Attrs: nofree nosync nounwind readnone willreturn
-declare i512* @llvm.preserve.struct.access.index.p0i512.p0s_struct.t1s(%struct.t1*, i32 immarg, i32 immarg) #1
+declare ptr @llvm.preserve.struct.access.index.p0.p0.t1s(ptr, i32 immarg, i32 immarg) #1
attributes #0 = { nounwind "frame-pointer"="all" "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" }
attributes #1 = { nofree nosync nounwind readnone willreturn }
diff --git a/llvm/test/CodeGen/BPF/CORE/field-reloc-duplicate.ll b/llvm/test/CodeGen/BPF/CORE/field-reloc-duplicate.ll
index b7835b80de348..126bd0a98369e 100644
--- a/llvm/test/CodeGen/BPF/CORE/field-reloc-duplicate.ll
+++ b/llvm/test/CodeGen/BPF/CORE/field-reloc-duplicate.ll
@@ -13,14 +13,14 @@
%struct.s1 = type { i32, i32 }
; Function Attrs: nounwind
-define dso_local i32 @foo(%struct.s1* %arg) #0 !dbg !7 {
+define dso_local i32 @foo(ptr %arg) #0 !dbg !7 {
entry:
- %arg.addr = alloca %struct.s1*, align 8
- store %struct.s1* %arg, %struct.s1** %arg.addr, align 8, !tbaa !18
- call void @llvm.dbg.declare(metadata %struct.s1** %arg.addr, metadata !17, metadata !DIExpression()), !dbg !22
- %0 = load %struct.s1*, %struct.s1** %arg.addr, align 8, !dbg !23, !tbaa !18
- %1 = call i32* @llvm.preserve.struct.access.index.p0i32.p0s_struct.s1s(%struct.s1* elementtype(%struct.s1) %0, i32 0, i32 0), !dbg !24, !llvm.preserve.access.index !12
- %2 = load i32, i32* %1, align 4, !dbg !24, !tbaa !25
+ %arg.addr = alloca ptr, align 8
+ store ptr %arg, ptr %arg.addr, align 8, !tbaa !18
+ call void @llvm.dbg.declare(metadata ptr %arg.addr, metadata !17, metadata !DIExpression()), !dbg !22
+ %0 = load ptr, ptr %arg.addr, align 8, !dbg !23, !tbaa !18
+ %1 = call ptr @llvm.preserve.struct.access.index.p0.p0.s1s(ptr elementtype(%struct.s1) %0, i32 0, i32 0), !dbg !24, !llvm.preserve.access.index !12
+ %2 = load i32, ptr %1, align 4, !dbg !24, !tbaa !25
ret i32 %2, !dbg !28
}
@@ -28,17 +28,17 @@ entry:
declare void @llvm.dbg.declare(metadata, metadata, metadata) #1
; Function Attrs: nounwind readnone
-declare i32* @llvm.preserve.struct.access.index.p0i32.p0s_struct.s1s(%struct.s1*, i32 immarg, i32 immarg) #2
+declare ptr @llvm.preserve.struct.access.index.p0.p0.s1s(ptr, i32 immarg, i32 immarg) #2
; Function Attrs: nounwind
-define dso_local i32 @bar(%struct.s1* %arg) #0 !dbg !29 {
+define dso_local i32 @bar(ptr %arg) #0 !dbg !29 {
entry:
- %arg.addr = alloca %struct.s1*, align 8
- store %struct.s1* %arg, %struct.s1** %arg.addr, align 8, !tbaa !18
- call void @llvm.dbg.declare(metadata %struct.s1** %arg.addr, metadata !31, metadata !DIExpression()), !dbg !32
- %0 = load %struct.s1*, %struct.s1** %arg.addr, align 8, !dbg !33, !tbaa !18
- %1 = call i32* @llvm.preserve.struct.access.index.p0i32.p0s_struct.s1s(%struct.s1* elementtype(%struct.s1) %0, i32 0, i32 0), !dbg !34, !llvm.preserve.access.index !12
- %2 = load i32, i32* %1, align 4, !dbg !34, !tbaa !25
+ %arg.addr = alloca ptr, align 8
+ store ptr %arg, ptr %arg.addr, align 8, !tbaa !18
+ call void @llvm.dbg.declare(metadata ptr %arg.addr, metadata !31, metadata !DIExpression()), !dbg !32
+ %0 = load ptr, ptr %arg.addr, align 8, !dbg !33, !tbaa !18
+ %1 = call ptr @llvm.preserve.struct.access.index.p0.p0.s1s(ptr elementtype(%struct.s1) %0, i32 0, i32 0), !dbg !34, !llvm.preserve.access.index !12
+ %2 = load i32, ptr %1, align 4, !dbg !34, !tbaa !25
ret i32 %2, !dbg !35
}
diff --git a/llvm/test/CodeGen/BPF/CORE/intrinsic-array-2.ll b/llvm/test/CodeGen/BPF/CORE/intrinsic-array-2.ll
index c2113b31fcbb9..90681d3c56e7d 100644
--- a/llvm/test/CodeGen/BPF/CORE/intrinsic-array-2.ll
+++ b/llvm/test/CodeGen/BPF/CORE/intrinsic-array-2.ll
@@ -19,9 +19,9 @@ target triple = "bpf"
; Function Attrs: nounwind readnone
define dso_local i32 @test() local_unnamed_addr #0 !dbg !17 {
entry:
- call void @llvm.dbg.value(metadata %struct.s1* null, metadata !21, metadata !DIExpression()), !dbg !22
- %0 = tail call %struct.s1* @llvm.preserve.array.access.index.p0s_struct.s1s.p0s_struct.s1s(%struct.s1* elementtype(%struct.s1) null, i32 0, i32 0), !dbg !23, !llvm.preserve.access.index !8
- %1 = tail call i32 @llvm.bpf.preserve.field.info.p0s_struct.s1s(%struct.s1* %0, i64 2), !dbg !24
+ call void @llvm.dbg.value(metadata ptr null, metadata !21, metadata !DIExpression()), !dbg !22
+ %0 = tail call ptr @llvm.preserve.array.access.index.p0.s1s.p0.s1s(ptr elementtype(%struct.s1) null, i32 0, i32 0), !dbg !23, !llvm.preserve.access.index !8
+ %1 = tail call i32 @llvm.bpf.preserve.field.info.p0.s1s(ptr %0, i64 2), !dbg !24
ret i32 %1, !dbg !25
}
@@ -40,10 +40,10 @@ entry:
; CHECK-NEXT: .long 2
; Function Attrs: nounwind readnone
-declare %struct.s1* @llvm.preserve.array.access.index.p0s_struct.s1s.p0s_struct.s1s(%struct.s1*, i32 immarg, i32 immarg) #1
+declare ptr @llvm.preserve.array.access.index.p0.s1s.p0.s1s(ptr, i32 immarg, i32 immarg) #1
; Function Attrs: nounwind readnone
-declare i32 @llvm.bpf.preserve.field.info.p0s_struct.s1s(%struct.s1*, i64 immarg) #1
+declare i32 @llvm.bpf.preserve.field.info.p0.s1s(ptr, i64 immarg) #1
; Function Attrs: nounwind readnone speculatable willreturn
declare void @llvm.dbg.value(metadata, metadata, metadata) #2
diff --git a/llvm/test/CodeGen/BPF/CORE/intrinsic-array.ll b/llvm/test/CodeGen/BPF/CORE/intrinsic-array.ll
index 2133278187605..c1437f13eda85 100644
--- a/llvm/test/CodeGen/BPF/CORE/intrinsic-array.ll
+++ b/llvm/test/CodeGen/BPF/CORE/intrinsic-array.ll
@@ -7,7 +7,7 @@
; Source code:
; #define _(x) (__builtin_preserve_access_index(x))
; struct s { int a; int b; };
-; int get_value(const void *addr);
+; int get_value(const ptr addr);
; int test(struct s *arg) { return get_value(_(&arg[2].b)); }
; Compiler flag to generate IR:
; clang -target bpf -S -O2 -g -emit-llvm -Xclang -disable-llvm-passes test.c
@@ -17,13 +17,12 @@ target triple = "bpf"
%struct.s = type { i32, i32 }
; Function Attrs: nounwind
-define dso_local i32 @test(%struct.s* %arg) local_unnamed_addr #0 !dbg !7 {
+define dso_local i32 @test(ptr %arg) local_unnamed_addr #0 !dbg !7 {
entry:
- call void @llvm.dbg.value(metadata %struct.s* %arg, metadata !17, metadata !DIExpression()), !dbg !18
- %0 = tail call %struct.s* @llvm.preserve.array.access.index.p0s_struct.ss.p0s_struct.ss(%struct.s* elementtype(%struct.s) %arg, i32 0, i32 2), !dbg !19, !llvm.preserve.access.index !11
- %1 = tail call i32* @llvm.preserve.struct.access.index.p0i32.p0s_struct.ss(%struct.s* elementtype(%struct.s) %0, i32 1, i32 1), !dbg !19, !llvm.preserve.access.index !12
- %2 = bitcast i32* %1 to i8*, !dbg !19
- %call = tail call i32 @get_value(i8* %2) #4, !dbg !20
+ call void @llvm.dbg.value(metadata ptr %arg, metadata !17, metadata !DIExpression()), !dbg !18
+ %0 = tail call ptr @llvm.preserve.array.access.index.p0.ss.p0.ss(ptr elementtype(%struct.s) %arg, i32 0, i32 2), !dbg !19, !llvm.preserve.access.index !11
+ %1 = tail call ptr @llvm.preserve.struct.access.index.p0.p0.ss(ptr elementtype(%struct.s) %0, i32 1, i32 1), !dbg !19, !llvm.preserve.access.index !12
+ %call = tail call i32 @get_value(ptr %1) #4, !dbg !20
ret i32 %call, !dbg !21
}
; CHECK-LABEL: test
@@ -42,13 +41,13 @@ entry:
; CHECK-NEXT: .long 26
; CHECK-NEXT: .long 0
-declare dso_local i32 @get_value(i8*) local_unnamed_addr #1
+declare dso_local i32 @get_value(ptr) local_unnamed_addr #1
; Function Attrs: nounwind readnone
-declare %struct.s* @llvm.preserve.array.access.index.p0s_struct.ss.p0s_struct.ss(%struct.s*, i32 immarg, i32 immarg) #2
+declare ptr @llvm.preserve.array.access.index.p0.ss.p0.ss(ptr, i32 immarg, i32 immarg) #2
; Function Attrs: nounwind readnone
-declare i32* @llvm.preserve.struct.access.index.p0i32.p0s_struct.ss(%struct.s*, i32 immarg, i32 immarg) #2
+declare ptr @llvm.preserve.struct.access.index.p0.p0.ss(ptr, i32 immarg, i32 immarg) #2
; Function Attrs: nounwind readnone speculatable
declare void @llvm.dbg.value(metadata, metadata, metadata) #3
diff --git a/llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-byte-size-1.ll b/llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-byte-size-1.ll
index 4c5d9071df785..a8280579ea509 100644
--- a/llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-byte-size-1.ll
+++ b/llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-byte-size-1.ll
@@ -22,22 +22,21 @@ target triple = "bpf"
%struct.s1 = type { i32 }
; Function Attrs: nounwind readnone
-define dso_local i32 @test(%union.u1* %arg) local_unnamed_addr #0 !dbg !11 {
+define dso_local i32 @test(ptr %arg) local_unnamed_addr #0 !dbg !11 {
entry:
- call void @llvm.dbg.value(metadata %union.u1* %arg, metadata !28, metadata !DIExpression()), !dbg !33
- %0 = tail call %union.u1* @llvm.preserve.union.access.index.p0s_union.u1s.p0s_union.u1s(%union.u1* %arg, i32 1), !dbg !34, !llvm.preserve.access.index !16
- %b2 = bitcast %union.u1* %0 to %struct.s1*, !dbg !34
- %1 = tail call i32* @llvm.preserve.struct.access.index.p0i32.p0s_struct.s1s(%struct.s1* elementtype(%struct.s1) %b2, i32 0, i32 0), !dbg !35, !llvm.preserve.access.index !21
- %2 = tail call i32 @llvm.bpf.preserve.field.info.p0i32(i32* %1, i64 1), !dbg !36
+ call void @llvm.dbg.value(metadata ptr %arg, metadata !28, metadata !DIExpression()), !dbg !33
+ %0 = tail call ptr @llvm.preserve.union.access.index.p0.u1s.p0.u1s(ptr %arg, i32 1), !dbg !34, !llvm.preserve.access.index !16
+ %1 = tail call ptr @llvm.preserve.struct.access.index.p0.p0.s1s(ptr elementtype(%struct.s1) %0, i32 0, i32 0), !dbg !35, !llvm.preserve.access.index !21
+ %2 = tail call i32 @llvm.bpf.preserve.field.info.p0(ptr %1, i64 1), !dbg !36
call void @llvm.dbg.value(metadata i32 %2, metadata !29, metadata !DIExpression()), !dbg !33
- %3 = tail call i32* @llvm.preserve.struct.access.index.p0i32.p0s_struct.s1s(%struct.s1* elementtype(%struct.s1) %b2, i32 0, i32 1), !dbg !37, !llvm.preserve.access.index !21
- %4 = tail call i32 @llvm.bpf.preserve.field.info.p0i32(i32* %3, i64 1), !dbg !38
+ %3 = tail call ptr @llvm.preserve.struct.access.index.p0.p0.s1s(ptr elementtype(%struct.s1) %0, i32 0, i32 1), !dbg !37, !llvm.preserve.access.index !21
+ %4 = tail call i32 @llvm.bpf.preserve.field.info.p0(ptr %3, i64 1), !dbg !38
call void @llvm.dbg.value(metadata i32 %4, metadata !30, metadata !DIExpression()), !dbg !33
- %5 = tail call i32* @llvm.preserve.struct.access.index.p0i32.p0s_struct.s1s(%struct.s1* elementtype(%struct.s1) %b2, i32 0, i32 2), !dbg !39, !llvm.preserve.access.index !21
- %6 = tail call i32 @llvm.bpf.preserve.field.info.p0i32(i32* %5, i64 1), !dbg !40
+ %5 = tail call ptr @llvm.preserve.struct.access.index.p0.p0.s1s(ptr elementtype(%struct.s1) %0, i32 0, i32 2), !dbg !39, !llvm.preserve.access.index !21
+ %6 = tail call i32 @llvm.bpf.preserve.field.info.p0(ptr %5, i64 1), !dbg !40
call void @llvm.dbg.value(metadata i32 %6, metadata !31, metadata !DIExpression()), !dbg !33
- %7 = tail call i32* @llvm.preserve.struct.access.index.p0i32.p0s_struct.s1s(%struct.s1* elementtype(%struct.s1) %b2, i32 0, i32 3), !dbg !41, !llvm.preserve.access.index !21
- %8 = tail call i32 @llvm.bpf.preserve.field.info.p0i32(i32* %7, i64 1), !dbg !42
+ %7 = tail call ptr @llvm.preserve.struct.access.index.p0.p0.s1s(ptr elementtype(%struct.s1) %0, i32 0, i32 3), !dbg !41, !llvm.preserve.access.index !21
+ %8 = tail call i32 @llvm.bpf.preserve.field.info.p0(ptr %7, i64 1), !dbg !42
call void @llvm.dbg.value(metadata i32 %8, metadata !32, metadata !DIExpression()), !dbg !33
%add = add i32 %4, %2, !dbg !43
%add4 = add i32 %add, %6, !dbg !44
@@ -86,13 +85,13 @@ entry:
; CHECK-NEXT: .long 1
; Function Attrs: nounwind readnone
-declare %union.u1* @llvm.preserve.union.access.index.p0s_union.u1s.p0s_union.u1s(%union.u1*, i32) #1
+declare ptr @llvm.preserve.union.access.index.p0.u1s.p0.u1s(ptr, i32) #1
; Function Attrs: nounwind readnone
-declare i32* @llvm.preserve.struct.access.index.p0i32.p0s_struct.s1s(%struct.s1*, i32, i32) #1
+declare ptr @llvm.preserve.struct.access.index.p0.p0.s1s(ptr, i32, i32) #1
; Function Attrs: nounwind readnone
-declare i32 @llvm.bpf.preserve.field.info.p0i32(i32*, i64) #1
+declare i32 @llvm.bpf.preserve.field.info.p0(ptr, i64) #1
; Function Attrs: nounwind readnone speculatable willreturn
declare void @llvm.dbg.value(metadata, metadata, metadata) #2
diff --git a/llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-byte-size-2.ll b/llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-byte-size-2.ll
index 0eb4e503eb725..39c02da24da42 100644
--- a/llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-byte-size-2.ll
+++ b/llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-byte-size-2.ll
@@ -21,18 +21,17 @@ target triple = "bpf"
%struct.s1 = type { i32, i8 }
; Function Attrs: nounwind readnone
-define dso_local i32 @test(%union.u1* %arg) local_unnamed_addr #0 !dbg !11 {
+define dso_local i32 @test(ptr %arg) local_unnamed_addr #0 !dbg !11 {
entry:
- call void @llvm.dbg.value(metadata %union.u1* %arg, metadata !27, metadata !DIExpression()), !dbg !31
- %0 = tail call %union.u1* @llvm.preserve.union.access.index.p0s_union.u1s.p0s_union.u1s(%union.u1* %arg, i32 1), !dbg !32, !llvm.preserve.access.index !16
- %b2 = getelementptr inbounds %union.u1, %union.u1* %0, i64 0, i32 0, !dbg !32
- %1 = tail call i32 @llvm.bpf.preserve.field.info.p0s_struct.s1s(%struct.s1* %b2, i64 1), !dbg !33
+ call void @llvm.dbg.value(metadata ptr %arg, metadata !27, metadata !DIExpression()), !dbg !31
+ %0 = tail call ptr @llvm.preserve.union.access.index.p0.u1s.p0.u1s(ptr %arg, i32 1), !dbg !32, !llvm.preserve.access.index !16
+ %1 = tail call i32 @llvm.bpf.preserve.field.info.p0.s1s(ptr %0, i64 1), !dbg !33
call void @llvm.dbg.value(metadata i32 %1, metadata !28, metadata !DIExpression()), !dbg !31
- %2 = tail call i32* @llvm.preserve.struct.access.index.p0i32.p0s_struct.s1s(%struct.s1* elementtype(%struct.s1) %b2, i32 0, i32 0), !dbg !34, !llvm.preserve.access.index !21
- %3 = tail call i32 @llvm.bpf.preserve.field.info.p0i32(i32* %2, i64 1), !dbg !35
+ %2 = tail call ptr @llvm.preserve.struct.access.index.p0.p0.s1s(ptr elementtype(%struct.s1) %0, i32 0, i32 0), !dbg !34, !llvm.preserve.access.index !21
+ %3 = tail call i32 @llvm.bpf.preserve.field.info.p0(ptr %2, i64 1), !dbg !35
call void @llvm.dbg.value(metadata i32 %3, metadata !29, metadata !DIExpression()), !dbg !31
- %4 = tail call i8* @llvm.preserve.struct.access.index.p0i8.p0s_struct.s1s(%struct.s1* elementtype(%struct.s1) %b2, i32 1, i32 1), !dbg !36, !llvm.preserve.access.index !21
- %5 = tail call i32 @llvm.bpf.preserve.field.info.p0i8(i8* %4, i64 1), !dbg !37
+ %4 = tail call ptr @llvm.preserve.struct.access.index.p0.p0.s1s(ptr elementtype(%struct.s1) %0, i32 1, i32 1), !dbg !36, !llvm.preserve.access.index !21
+ %5 = tail call i32 @llvm.bpf.preserve.field.info.p0(ptr %4, i64 1), !dbg !37
call void @llvm.dbg.value(metadata i32 %5, metadata !30, metadata !DIExpression()), !dbg !31
%add = add i32 %3, %1, !dbg !38
%add3 = add i32 %add, %5, !dbg !39
@@ -72,22 +71,20 @@ entry:
; CHECK-NEXT: .long 1
; Function Attrs: nounwind readnone
-declare %union.u1* @llvm.preserve.union.access.index.p0s_union.u1s.p0s_union.u1s(%union.u1*, i32) #1
+declare ptr @llvm.preserve.union.access.index.p0.u1s.p0.u1s(ptr, i32) #1
; Function Attrs: nounwind readnone
-declare i32 @llvm.bpf.preserve.field.info.p0s_struct.s1s(%struct.s1*, i64) #1
+declare i32 @llvm.bpf.preserve.field.info.p0.s1s(ptr, i64) #1
; Function Attrs: nounwind readnone
-declare i32* @llvm.preserve.struct.access.index.p0i32.p0s_struct.s1s(%struct.s1*, i32, i32) #1
+declare ptr @llvm.preserve.struct.access.index.p0.p0.s1s(ptr, i32, i32) #1
; Function Attrs: nounwind readnone
-declare i32 @llvm.bpf.preserve.field.info.p0i32(i32*, i64) #1
+declare i32 @llvm.bpf.preserve.field.info.p0(ptr, i64) #1
; Function Attrs: nounwind readnone
-declare i8* @llvm.preserve.struct.access.index.p0i8.p0s_struct.s1s(%struct.s1*, i32, i32) #1
; Function Attrs: nounwind readnone
-declare i32 @llvm.bpf.preserve.field.info.p0i8(i8*, i64) #1
; Function Attrs: nounwind readnone speculatable willreturn
declare void @llvm.dbg.value(metadata, metadata, metadata) #2
diff --git a/llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-byte-size-3.ll b/llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-byte-size-3.ll
index dc2554370f9e0..f63a3ee4de703 100644
--- a/llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-byte-size-3.ll
+++ b/llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-byte-size-3.ll
@@ -20,17 +20,16 @@ target triple = "bpf"
%struct.s1 = type { [10 x [10 x i32]] }
; Function Attrs: nounwind readnone
-define dso_local i32 @test(%union.u1* %arg) local_unnamed_addr #0 !dbg !18 {
+define dso_local i32 @test(ptr %arg) local_unnamed_addr #0 !dbg !18 {
entry:
- call void @llvm.dbg.value(metadata %union.u1* %arg, metadata !31, metadata !DIExpression()), !dbg !34
- %0 = tail call %union.u1* @llvm.preserve.union.access.index.p0s_union.u1s.p0s_union.u1s(%union.u1* %arg, i32 1), !dbg !35, !llvm.preserve.access.index !22
- %b2 = getelementptr inbounds %union.u1, %union.u1* %0, i64 0, i32 0, !dbg !35
- %1 = tail call [10 x [10 x i32]]* @llvm.preserve.struct.access.index.p0a10a10i32.p0s_struct.s1s(%struct.s1* elementtype(%struct.s1) %b2, i32 0, i32 0), !dbg !36, !llvm.preserve.access.index !27
- %2 = tail call [10 x i32]* @llvm.preserve.array.access.index.p0a10i32.p0a10a10i32([10 x [10 x i32]]* elementtype([10 x [10 x i32]]) %1, i32 1, i32 5), !dbg !37, !llvm.preserve.access.index !8
- %3 = tail call i32 @llvm.bpf.preserve.field.info.p0a10i32([10 x i32]* %2, i64 1), !dbg !38
+ call void @llvm.dbg.value(metadata ptr %arg, metadata !31, metadata !DIExpression()), !dbg !34
+ %0 = tail call ptr @llvm.preserve.union.access.index.p0.u1s.p0.u1s(ptr %arg, i32 1), !dbg !35, !llvm.preserve.access.index !22
+ %1 = tail call ptr @llvm.preserve.struct.access.index.p0.p0.s1s(ptr elementtype(%struct.s1) %0, i32 0, i32 0), !dbg !36, !llvm.preserve.access.index !27
+ %2 = tail call ptr @llvm.preserve.array.access.index.p0.p0(ptr elementtype([10 x [10 x i32]]) %1, i32 1, i32 5), !dbg !37, !llvm.preserve.access.index !8
+ %3 = tail call i32 @llvm.bpf.preserve.field.info.p0(ptr %2, i64 1), !dbg !38
call void @llvm.dbg.value(metadata i32 %3, metadata !32, metadata !DIExpression()), !dbg !34
- %4 = tail call i32* @llvm.preserve.array.access.index.p0i32.p0a10i32([10 x i32]* elementtype([10 x i32]) %2, i32 1, i32 5), !dbg !39, !llvm.preserve.access.index !12
- %5 = tail call i32 @llvm.bpf.preserve.field.info.p0i32(i32* %4, i64 1), !dbg !40
+ %4 = tail call ptr @llvm.preserve.array.access.index.p0.p0(ptr elementtype([10 x i32]) %2, i32 1, i32 5), !dbg !39, !llvm.preserve.access.index !12
+ %5 = tail call i32 @llvm.bpf.preserve.field.info.p0(ptr %4, i64 1), !dbg !40
call void @llvm.dbg.value(metadata i32 %5, metadata !33, metadata !DIExpression()), !dbg !34
%add = add i32 %5, %3, !dbg !41
ret i32 %add, !dbg !42
@@ -61,22 +60,20 @@ entry:
; CHECK-NEXT: .long 1
; Function Attrs: nounwind readnone
-declare %union.u1* @llvm.preserve.union.access.index.p0s_union.u1s.p0s_union.u1s(%union.u1*, i32) #1
+declare ptr @llvm.preserve.union.access.index.p0.u1s.p0.u1s(ptr, i32) #1
; Function Attrs: nounwind readnone
-declare [10 x [10 x i32]]* @llvm.preserve.struct.access.index.p0a10a10i32.p0s_struct.s1s(%struct.s1*, i32, i32) #1
+declare ptr @llvm.preserve.struct.access.index.p0.p0.s1s(ptr, i32, i32) #1
; Function Attrs: nounwind readnone
-declare [10 x i32]* @llvm.preserve.array.access.index.p0a10i32.p0a10a10i32([10 x [10 x i32]]*, i32, i32) #1
+declare ptr @llvm.preserve.array.access.index.p0.p0(ptr, i32, i32) #1
; Function Attrs: nounwind readnone
-declare i32 @llvm.bpf.preserve.field.info.p0a10i32([10 x i32]*, i64) #1
+declare i32 @llvm.bpf.preserve.field.info.p0(ptr, i64) #1
; Function Attrs: nounwind readnone
-declare i32* @llvm.preserve.array.access.index.p0i32.p0a10i32([10 x i32]*, i32, i32) #1
; Function Attrs: nounwind readnone
-declare i32 @llvm.bpf.preserve.field.info.p0i32(i32*, i64) #1
; Function Attrs: nounwind readnone speculatable willreturn
declare void @llvm.dbg.value(metadata, metadata, metadata) #2
diff --git a/llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-byte-size-4.ll b/llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-byte-size-4.ll
index 0b243ef76d3ae..fda759275ab02 100644
--- a/llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-byte-size-4.ll
+++ b/llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-byte-size-4.ll
@@ -15,11 +15,11 @@ target triple = "bpf"
%struct.s1 = type { i32, i8, i32 }
; Function Attrs: nounwind readnone
-define dso_local i32 @test(%struct.s1* readnone %arg) local_unnamed_addr #0 !dbg !11 {
+define dso_local i32 @test(ptr readnone %arg) local_unnamed_addr #0 !dbg !11 {
entry:
- call void @llvm.dbg.value(metadata %struct.s1* %arg, metadata !23, metadata !DIExpression()), !dbg !24
- %0 = tail call i8* @llvm.preserve.struct.access.index.p0i8.p0s_struct.s1s(%struct.s1* elementtype(%struct.s1) %arg, i32 1, i32 1), !dbg !25, !llvm.preserve.access.index !17
- %1 = tail call i32 @llvm.bpf.preserve.field.info.p0i8(i8* %0, i64 1), !dbg !26
+ call void @llvm.dbg.value(metadata ptr %arg, metadata !23, metadata !DIExpression()), !dbg !24
+ %0 = tail call ptr @llvm.preserve.struct.access.index.p0.p0.s1s(ptr elementtype(%struct.s1) %arg, i32 1, i32 1), !dbg !25, !llvm.preserve.access.index !17
+ %1 = tail call i32 @llvm.bpf.preserve.field.info.p0(ptr %0, i64 1), !dbg !26
ret i32 %1, !dbg !27
}
@@ -41,10 +41,10 @@ entry:
; CHECK-NEXT: .long 1
; Function Attrs: nounwind readnone
-declare i8* @llvm.preserve.struct.access.index.p0i8.p0s_struct.s1s(%struct.s1*, i32, i32) #1
+declare ptr @llvm.preserve.struct.access.index.p0.p0.s1s(ptr, i32, i32) #1
; Function Attrs: nounwind readnone
-declare i32 @llvm.bpf.preserve.field.info.p0i8(i8*, i64) #1
+declare i32 @llvm.bpf.preserve.field.info.p0(ptr, i64) #1
; Function Attrs: nounwind readnone speculatable
declare void @llvm.dbg.value(metadata, metadata, metadata) #2
diff --git a/llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-existence-1.ll b/llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-existence-1.ll
index 7fa1e3ed2af8e..cab5474145b46 100644
--- a/llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-existence-1.ll
+++ b/llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-existence-1.ll
@@ -22,27 +22,25 @@ target triple = "bpf"
%union.u1 = type { i32 }
; Function Attrs: nounwind readnone
-define dso_local i32 @test(%struct.s1* %arg1, %union.u1* %arg2) local_unnamed_addr #0 !dbg !11 {
+define dso_local i32 @test(ptr %arg1, ptr %arg2) local_unnamed_addr #0 !dbg !11 {
entry:
- call void @llvm.dbg.value(metadata %struct.s1* %arg1, metadata !29, metadata !DIExpression()), !dbg !35
- call void @llvm.dbg.value(metadata %union.u1* %arg2, metadata !30, metadata !DIExpression()), !dbg !35
- %0 = tail call i32* @llvm.preserve.struct.access.index.p0i32.p0s_struct.s1s(%struct.s1* elementtype(%struct.s1) %arg1, i32 0, i32 0), !dbg !36, !llvm.preserve.access.index !16
- %1 = tail call i32 @llvm.bpf.preserve.field.info.p0i32(i32* %0, i64 2), !dbg !37
+ call void @llvm.dbg.value(metadata ptr %arg1, metadata !29, metadata !DIExpression()), !dbg !35
+ call void @llvm.dbg.value(metadata ptr %arg2, metadata !30, metadata !DIExpression()), !dbg !35
+ %0 = tail call ptr @llvm.preserve.struct.access.index.p0.p0.s1s(ptr elementtype(%struct.s1) %arg1, i32 0, i32 0), !dbg !36, !llvm.preserve.access.index !16
+ %1 = tail call i32 @llvm.bpf.preserve.field.info.p0(ptr %0, i64 2), !dbg !37
call void @llvm.dbg.value(metadata i32 %1, metadata !31, metadata !DIExpression()), !dbg !35
- %2 = tail call i16* @llvm.preserve.struct.access.index.p0i16.p0s_struct.s1s(%struct.s1* elementtype(%struct.s1) %arg1, i32 1, i32 2), !dbg !38, !llvm.preserve.access.index !16
- %3 = tail call i32 @llvm.bpf.preserve.field.info.p0i16(i16* %2, i64 2), !dbg !39
+ %2 = tail call ptr @llvm.preserve.struct.access.index.p0.p0.s1s(ptr elementtype(%struct.s1) %arg1, i32 1, i32 2), !dbg !38, !llvm.preserve.access.index !16
+ %3 = tail call i32 @llvm.bpf.preserve.field.info.p0(ptr %2, i64 2), !dbg !39
call void @llvm.dbg.value(metadata i32 %3, metadata !32, metadata !DIExpression()), !dbg !35
- %4 = tail call %union.u1* @llvm.preserve.union.access.index.p0s_union.u1s.p0s_union.u1s(%union.u1* %arg2, i32 0), !dbg !40, !llvm.preserve.access.index !23
- %b1 = getelementptr inbounds %union.u1, %union.u1* %4, i64 0, i32 0, !dbg !40
- %5 = tail call i32 @llvm.bpf.preserve.field.info.p0i32(i32* %b1, i64 2), !dbg !41
+ %4 = tail call ptr @llvm.preserve.union.access.index.p0.u1s.p0.u1s(ptr %arg2, i32 0), !dbg !40, !llvm.preserve.access.index !23
+ %5 = tail call i32 @llvm.bpf.preserve.field.info.p0(ptr %4, i64 2), !dbg !41
call void @llvm.dbg.value(metadata i32 %5, metadata !33, metadata !DIExpression()), !dbg !35
- %6 = tail call i32* @llvm.preserve.struct.access.index.p0i32.p0s_union.u1s(%union.u1* elementtype(%union.u1) %arg2, i32 0, i32 2), !dbg !42, !llvm.preserve.access.index !23
- %7 = bitcast i32* %6 to i8*, !dbg !42
- %8 = tail call i32 @llvm.bpf.preserve.field.info.p0i8(i8* %7, i64 2), !dbg !43
- call void @llvm.dbg.value(metadata i32 %8, metadata !34, metadata !DIExpression()), !dbg !35
+ %6 = tail call ptr @llvm.preserve.struct.access.index.p0.p0.u1s(ptr elementtype(%union.u1) %arg2, i32 0, i32 2), !dbg !42, !llvm.preserve.access.index !23
+ %7 = tail call i32 @llvm.bpf.preserve.field.info.p0(ptr %6, i64 2), !dbg !43
+ call void @llvm.dbg.value(metadata i32 %7, metadata !34, metadata !DIExpression()), !dbg !35
%add = add i32 %3, %1, !dbg !44
%add1 = add i32 %add, %5, !dbg !45
- %add2 = add i32 %add1, %8, !dbg !46
+ %add2 = add i32 %add1, %7, !dbg !46
ret i32 %add2, !dbg !47
}
@@ -87,25 +85,22 @@ entry:
; CHECK-NEXT: .long 2
; Function Attrs: nounwind readnone
-declare i32* @llvm.preserve.struct.access.index.p0i32.p0s_struct.s1s(%struct.s1*, i32, i32) #1
+declare ptr @llvm.preserve.struct.access.index.p0.p0.s1s(ptr, i32, i32) #1
; Function Attrs: nounwind readnone
-declare i32 @llvm.bpf.preserve.field.info.p0i32(i32*, i64) #1
+declare i32 @llvm.bpf.preserve.field.info.p0(ptr, i64) #1
; Function Attrs: nounwind readnone
-declare i16* @llvm.preserve.struct.access.index.p0i16.p0s_struct.s1s(%struct.s1*, i32, i32) #1
; Function Attrs: nounwind readnone
-declare i32 @llvm.bpf.preserve.field.info.p0i16(i16*, i64) #1
; Function Attrs: nounwind readnone
-declare %union.u1* @llvm.preserve.union.access.index.p0s_union.u1s.p0s_union.u1s(%union.u1*, i32) #1
+declare ptr @llvm.preserve.union.access.index.p0.u1s.p0.u1s(ptr, i32) #1
; Function Attrs: nounwind readnone
-declare i32* @llvm.preserve.struct.access.index.p0i32.p0s_union.u1s(%union.u1*, i32, i32) #1
+declare ptr @llvm.preserve.struct.access.index.p0.p0.u1s(ptr, i32, i32) #1
; Function Attrs: nounwind readnone
-declare i32 @llvm.bpf.preserve.field.info.p0i8(i8*, i64) #1
; Function Attrs: nounwind readnone speculatable willreturn
declare void @llvm.dbg.value(metadata, metadata, metadata) #2
diff --git a/llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-existence-2.ll b/llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-existence-2.ll
index 1d94e7ac14f52..2c56c0d1d704b 100644
--- a/llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-existence-2.ll
+++ b/llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-existence-2.ll
@@ -20,16 +20,15 @@ target triple = "bpf"
%struct.s1 = type { i32, i16 }
; Function Attrs: nounwind readnone
-define dso_local i32 @test(%union.u1* %arg) local_unnamed_addr #0 !dbg !11 {
+define dso_local i32 @test(ptr %arg) local_unnamed_addr #0 !dbg !11 {
entry:
- call void @llvm.dbg.value(metadata %union.u1* %arg, metadata !27, metadata !DIExpression()), !dbg !30
- %0 = tail call %union.u1* @llvm.preserve.union.access.index.p0s_union.u1s.p0s_union.u1s(%union.u1* %arg, i32 1), !dbg !31, !llvm.preserve.access.index !16
- %b2 = getelementptr inbounds %union.u1, %union.u1* %0, i64 0, i32 0, !dbg !31
- %1 = tail call i32* @llvm.preserve.struct.access.index.p0i32.p0s_struct.s1s(%struct.s1* elementtype(%struct.s1) %b2, i32 0, i32 0), !dbg !32, !llvm.preserve.access.index !20
- %2 = tail call i32 @llvm.bpf.preserve.field.info.p0i32(i32* %1, i64 2), !dbg !33
+ call void @llvm.dbg.value(metadata ptr %arg, metadata !27, metadata !DIExpression()), !dbg !30
+ %0 = tail call ptr @llvm.preserve.union.access.index.p0.u1s.p0.u1s(ptr %arg, i32 1), !dbg !31, !llvm.preserve.access.index !16
+ %1 = tail call ptr @llvm.preserve.struct.access.index.p0.p0.s1s(ptr elementtype(%struct.s1) %0, i32 0, i32 0), !dbg !32, !llvm.preserve.access.index !20
+ %2 = tail call i32 @llvm.bpf.preserve.field.info.p0(ptr %1, i64 2), !dbg !33
call void @llvm.dbg.value(metadata i32 %2, metadata !28, metadata !DIExpression()), !dbg !30
- %3 = tail call i16* @llvm.preserve.struct.access.index.p0i16.p0s_struct.s1s(%struct.s1* elementtype(%struct.s1) %b2, i32 1, i32 2), !dbg !34, !llvm.preserve.access.index !20
- %4 = tail call i32 @llvm.bpf.preserve.field.info.p0i16(i16* %3, i64 2), !dbg !35
+ %3 = tail call ptr @llvm.preserve.struct.access.index.p0.p0.s1s(ptr elementtype(%struct.s1) %0, i32 1, i32 2), !dbg !34, !llvm.preserve.access.index !20
+ %4 = tail call i32 @llvm.bpf.preserve.field.info.p0(ptr %3, i64 2), !dbg !35
call void @llvm.dbg.value(metadata i32 %4, metadata !29, metadata !DIExpression()), !dbg !30
%add = add i32 %4, %2, !dbg !36
ret i32 %add, !dbg !37
@@ -60,19 +59,17 @@ entry:
; CHECK-NEXT: .long 2
; Function Attrs: nounwind readnone
-declare %union.u1* @llvm.preserve.union.access.index.p0s_union.u1s.p0s_union.u1s(%union.u1*, i32) #1
+declare ptr @llvm.preserve.union.access.index.p0.u1s.p0.u1s(ptr, i32) #1
; Function Attrs: nounwind readnone
-declare i32* @llvm.preserve.struct.access.index.p0i32.p0s_struct.s1s(%struct.s1*, i32, i32) #1
+declare ptr @llvm.preserve.struct.access.index.p0.p0.s1s(ptr, i32, i32) #1
; Function Attrs: nounwind readnone
-declare i32 @llvm.bpf.preserve.field.info.p0i32(i32*, i64) #1
+declare i32 @llvm.bpf.preserve.field.info.p0(ptr, i64) #1
; Function Attrs: nounwind readnone
-declare i16* @llvm.preserve.struct.access.index.p0i16.p0s_struct.s1s(%struct.s1*, i32, i32) #1
; Function Attrs: nounwind readnone
-declare i32 @llvm.bpf.preserve.field.info.p0i16(i16*, i64) #1
; Function Attrs: nounwind readnone speculatable willreturn
declare void @llvm.dbg.value(metadata, metadata, metadata) #2
diff --git a/llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-existence-3.ll b/llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-existence-3.ll
index dffc93555e3eb..020b53238767c 100644
--- a/llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-existence-3.ll
+++ b/llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-existence-3.ll
@@ -19,17 +19,16 @@ target triple = "bpf"
%struct.s1 = type { [10 x [10 x i32]] }
; Function Attrs: nounwind readnone
-define dso_local i32 @test(%union.u1* %arg) local_unnamed_addr #0 !dbg !18 {
+define dso_local i32 @test(ptr %arg) local_unnamed_addr #0 !dbg !18 {
entry:
- call void @llvm.dbg.value(metadata %union.u1* %arg, metadata !31, metadata !DIExpression()), !dbg !34
- %0 = tail call %union.u1* @llvm.preserve.union.access.index.p0s_union.u1s.p0s_union.u1s(%union.u1* %arg, i32 1), !dbg !35, !llvm.preserve.access.index !22
- %b2 = getelementptr inbounds %union.u1, %union.u1* %0, i64 0, i32 0, !dbg !35
- %1 = tail call [10 x [10 x i32]]* @llvm.preserve.struct.access.index.p0a10a10i32.p0s_struct.s1s(%struct.s1* elementtype(%struct.s1) %b2, i32 0, i32 0), !dbg !36, !llvm.preserve.access.index !27
- %2 = tail call [10 x i32]* @llvm.preserve.array.access.index.p0a10i32.p0a10a10i32([10 x [10 x i32]]* elementtype([10 x [10 x i32]]) %1, i32 1, i32 5), !dbg !37, !llvm.preserve.access.index !8
- %3 = tail call i32 @llvm.bpf.preserve.field.info.p0a10i32([10 x i32]* %2, i64 2), !dbg !38
+ call void @llvm.dbg.value(metadata ptr %arg, metadata !31, metadata !DIExpression()), !dbg !34
+ %0 = tail call ptr @llvm.preserve.union.access.index.p0.u1s.p0.u1s(ptr %arg, i32 1), !dbg !35, !llvm.preserve.access.index !22
+ %1 = tail call ptr @llvm.preserve.struct.access.index.p0.p0.s1s(ptr elementtype(%struct.s1) %0, i32 0, i32 0), !dbg !36, !llvm.preserve.access.index !27
+ %2 = tail call ptr @llvm.preserve.array.access.index.p0.p0(ptr elementtype([10 x [10 x i32]]) %1, i32 1, i32 5), !dbg !37, !llvm.preserve.access.index !8
+ %3 = tail call i32 @llvm.bpf.preserve.field.info.p0(ptr %2, i64 2), !dbg !38
call void @llvm.dbg.value(metadata i32 %3, metadata !32, metadata !DIExpression()), !dbg !34
- %4 = tail call i32* @llvm.preserve.array.access.index.p0i32.p0a10i32([10 x i32]* elementtype([10 x i32]) %2, i32 1, i32 5), !dbg !39, !llvm.preserve.access.index !12
- %5 = tail call i32 @llvm.bpf.preserve.field.info.p0i32(i32* %4, i64 2), !dbg !40
+ %4 = tail call ptr @llvm.preserve.array.access.index.p0.p0(ptr elementtype([10 x i32]) %2, i32 1, i32 5), !dbg !39, !llvm.preserve.access.index !12
+ %5 = tail call i32 @llvm.bpf.preserve.field.info.p0(ptr %4, i64 2), !dbg !40
call void @llvm.dbg.value(metadata i32 %5, metadata !33, metadata !DIExpression()), !dbg !34
%add = add i32 %5, %3, !dbg !41
ret i32 %add, !dbg !42
@@ -60,22 +59,20 @@ entry:
; CHECK-NEXT: .long 2
; Function Attrs: nounwind readnone
-declare %union.u1* @llvm.preserve.union.access.index.p0s_union.u1s.p0s_union.u1s(%union.u1*, i32) #1
+declare ptr @llvm.preserve.union.access.index.p0.u1s.p0.u1s(ptr, i32) #1
; Function Attrs: nounwind readnone
-declare [10 x [10 x i32]]* @llvm.preserve.struct.access.index.p0a10a10i32.p0s_struct.s1s(%struct.s1*, i32, i32) #1
+declare ptr @llvm.preserve.struct.access.index.p0.p0.s1s(ptr, i32, i32) #1
; Function Attrs: nounwind readnone
-declare [10 x i32]* @llvm.preserve.array.access.index.p0a10i32.p0a10a10i32([10 x [10 x i32]]*, i32, i32) #1
+declare ptr @llvm.preserve.array.access.index.p0.p0(ptr, i32, i32) #1
; Function Attrs: nounwind readnone
-declare i32 @llvm.bpf.preserve.field.info.p0a10i32([10 x i32]*, i64) #1
+declare i32 @llvm.bpf.preserve.field.info.p0(ptr, i64) #1
; Function Attrs: nounwind readnone
-declare i32* @llvm.preserve.array.access.index.p0i32.p0a10i32([10 x i32]*, i32, i32) #1
; Function Attrs: nounwind readnone
-declare i32 @llvm.bpf.preserve.field.info.p0i32(i32*, i64) #1
; Function Attrs: nounwind readnone speculatable willreturn
declare void @llvm.dbg.value(metadata, metadata, metadata) #2
diff --git a/llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-existence-4.ll b/llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-existence-4.ll
index d954e13c83020..67ad819108c7f 100644
--- a/llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-existence-4.ll
+++ b/llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-existence-4.ll
@@ -18,14 +18,12 @@
define dso_local i32 @test1() #0 !dbg !6 {
entry:
%bar = alloca %struct.t, align 4
- %0 = bitcast %struct.t* %bar to i8*, !dbg !20
- call void @llvm.lifetime.start.p0i8(i64 4, i8* %0) #5, !dbg !20
- call void @llvm.dbg.declare(metadata %struct.t* %bar, metadata !11, metadata !DIExpression()), !dbg !21
- %1 = call %struct.t* @llvm.preserve.array.access.index.p0s_struct.ts.p0s_struct.ts(%struct.t* elementtype(%struct.t) %bar, i32 0, i32 1), !dbg !22, !llvm.preserve.access.index !4
- %2 = call i32 @llvm.bpf.preserve.field.info.p0s_struct.ts(%struct.t* %1, i64 2), !dbg !23
- %3 = bitcast %struct.t* %bar to i8*, !dbg !24
- call void @llvm.lifetime.end.p0i8(i64 4, i8* %3) #5, !dbg !24
- ret i32 %2, !dbg !25
+ call void @llvm.lifetime.start.p0(i64 4, ptr %bar) #5, !dbg !20
+ call void @llvm.dbg.declare(metadata ptr %bar, metadata !11, metadata !DIExpression()), !dbg !21
+ %0 = call ptr @llvm.preserve.array.access.index.p0.ts.p0.ts(ptr elementtype(%struct.t) %bar, i32 0, i32 1), !dbg !22, !llvm.preserve.access.index !4
+ %1 = call i32 @llvm.bpf.preserve.field.info.p0.ts(ptr %0, i64 2), !dbg !23
+ call void @llvm.lifetime.end.p0(i64 4, ptr %bar) #5, !dbg !24
+ ret i32 %1, !dbg !25
}
; CHECK: r0 = 1
@@ -56,19 +54,19 @@ entry:
; CHECK-NEXT: .long 2
; Function Attrs: argmemonly nofree nosync nounwind willreturn
-declare void @llvm.lifetime.start.p0i8(i64 immarg, i8* nocapture) #1
+declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nosync nounwind readnone speculatable willreturn
declare void @llvm.dbg.declare(metadata, metadata, metadata) #2
; Function Attrs: nofree nosync nounwind readnone willreturn
-declare %struct.t* @llvm.preserve.array.access.index.p0s_struct.ts.p0s_struct.ts(%struct.t*, i32 immarg, i32 immarg) #3
+declare ptr @llvm.preserve.array.access.index.p0.ts.p0.ts(ptr, i32 immarg, i32 immarg) #3
; Function Attrs: nounwind readnone
-declare i32 @llvm.bpf.preserve.field.info.p0s_struct.ts(%struct.t*, i64 immarg) #4
+declare i32 @llvm.bpf.preserve.field.info.p0.ts(ptr, i64 immarg) #4
; Function Attrs: argmemonly nofree nosync nounwind willreturn
-declare void @llvm.lifetime.end.p0i8(i64 immarg, i8* nocapture) #1
+declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nounwind "frame-pointer"="all" "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" }
attributes #1 = { argmemonly nofree nosync nounwind willreturn }
diff --git a/llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-lshift-1-bpfeb.ll b/llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-lshift-1-bpfeb.ll
index 346d8e728081f..f4180c0d0de35 100644
--- a/llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-lshift-1-bpfeb.ll
+++ b/llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-lshift-1-bpfeb.ll
@@ -23,22 +23,21 @@ target triple = "bpfeb"
%struct.s1 = type { i32 }
; Function Attrs: nounwind readnone
-define dso_local i32 @test(%union.u1* %arg) local_unnamed_addr #0 !dbg !11 {
+define dso_local i32 @test(ptr %arg) local_unnamed_addr #0 !dbg !11 {
entry:
- call void @llvm.dbg.value(metadata %union.u1* %arg, metadata !28, metadata !DIExpression()), !dbg !33
- %0 = tail call %union.u1* @llvm.preserve.union.access.index.p0s_union.u1s.p0s_union.u1s(%union.u1* %arg, i32 1), !dbg !34, !llvm.preserve.access.index !16
- %b2 = bitcast %union.u1* %0 to %struct.s1*, !dbg !34
- %1 = tail call i32* @llvm.preserve.struct.access.index.p0i32.p0s_struct.s1s(%struct.s1* elementtype(%struct.s1) %b2, i32 0, i32 0), !dbg !35, !llvm.preserve.access.index !21
- %2 = tail call i32 @llvm.bpf.preserve.field.info.p0i32(i32* %1, i64 4), !dbg !36
+ call void @llvm.dbg.value(metadata ptr %arg, metadata !28, metadata !DIExpression()), !dbg !33
+ %0 = tail call ptr @llvm.preserve.union.access.index.p0.u1s.p0.u1s(ptr %arg, i32 1), !dbg !34, !llvm.preserve.access.index !16
+ %1 = tail call ptr @llvm.preserve.struct.access.index.p0.p0.s1s(ptr elementtype(%struct.s1) %0, i32 0, i32 0), !dbg !35, !llvm.preserve.access.index !21
+ %2 = tail call i32 @llvm.bpf.preserve.field.info.p0(ptr %1, i64 4), !dbg !36
call void @llvm.dbg.value(metadata i32 %2, metadata !29, metadata !DIExpression()), !dbg !33
- %3 = tail call i32* @llvm.preserve.struct.access.index.p0i32.p0s_struct.s1s(%struct.s1* elementtype(%struct.s1) %b2, i32 0, i32 1), !dbg !37, !llvm.preserve.access.index !21
- %4 = tail call i32 @llvm.bpf.preserve.field.info.p0i32(i32* %3, i64 4), !dbg !38
+ %3 = tail call ptr @llvm.preserve.struct.access.index.p0.p0.s1s(ptr elementtype(%struct.s1) %0, i32 0, i32 1), !dbg !37, !llvm.preserve.access.index !21
+ %4 = tail call i32 @llvm.bpf.preserve.field.info.p0(ptr %3, i64 4), !dbg !38
call void @llvm.dbg.value(metadata i32 %4, metadata !30, metadata !DIExpression()), !dbg !33
- %5 = tail call i32* @llvm.preserve.struct.access.index.p0i32.p0s_struct.s1s(%struct.s1* elementtype(%struct.s1) %b2, i32 0, i32 2), !dbg !39, !llvm.preserve.access.index !21
- %6 = tail call i32 @llvm.bpf.preserve.field.info.p0i32(i32* %5, i64 4), !dbg !40
+ %5 = tail call ptr @llvm.preserve.struct.access.index.p0.p0.s1s(ptr elementtype(%struct.s1) %0, i32 0, i32 2), !dbg !39, !llvm.preserve.access.index !21
+ %6 = tail call i32 @llvm.bpf.preserve.field.info.p0(ptr %5, i64 4), !dbg !40
call void @llvm.dbg.value(metadata i32 %6, metadata !31, metadata !DIExpression()), !dbg !33
- %7 = tail call i32* @llvm.preserve.struct.access.index.p0i32.p0s_struct.s1s(%struct.s1* elementtype(%struct.s1) %b2, i32 0, i32 3), !dbg !41, !llvm.preserve.access.index !21
- %8 = tail call i32 @llvm.bpf.preserve.field.info.p0i32(i32* %7, i64 4), !dbg !42
+ %7 = tail call ptr @llvm.preserve.struct.access.index.p0.p0.s1s(ptr elementtype(%struct.s1) %0, i32 0, i32 3), !dbg !41, !llvm.preserve.access.index !21
+ %8 = tail call i32 @llvm.bpf.preserve.field.info.p0(ptr %7, i64 4), !dbg !42
call void @llvm.dbg.value(metadata i32 %8, metadata !32, metadata !DIExpression()), !dbg !33
%add = add i32 %4, %2, !dbg !43
%add4 = add i32 %add, %6, !dbg !44
@@ -87,13 +86,13 @@ entry:
; CHECK-NEXT: .long 4
; Function Attrs: nounwind readnone
-declare %union.u1* @llvm.preserve.union.access.index.p0s_union.u1s.p0s_union.u1s(%union.u1*, i32) #1
+declare ptr @llvm.preserve.union.access.index.p0.u1s.p0.u1s(ptr, i32) #1
; Function Attrs: nounwind readnone
-declare i32* @llvm.preserve.struct.access.index.p0i32.p0s_struct.s1s(%struct.s1*, i32, i32) #1
+declare ptr @llvm.preserve.struct.access.index.p0.p0.s1s(ptr, i32, i32) #1
; Function Attrs: nounwind readnone
-declare i32 @llvm.bpf.preserve.field.info.p0i32(i32*, i64) #1
+declare i32 @llvm.bpf.preserve.field.info.p0(ptr, i64) #1
; Function Attrs: nounwind readnone speculatable willreturn
declare void @llvm.dbg.value(metadata, metadata, metadata) #2
diff --git a/llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-lshift-1.ll b/llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-lshift-1.ll
index ffd9f716b0cec..342a9b7029196 100644
--- a/llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-lshift-1.ll
+++ b/llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-lshift-1.ll
@@ -23,22 +23,21 @@ target triple = "bpfel"
%struct.s1 = type { i32 }
; Function Attrs: nounwind readnone
-define dso_local i32 @test(%union.u1* %arg) local_unnamed_addr #0 !dbg !11 {
+define dso_local i32 @test(ptr %arg) local_unnamed_addr #0 !dbg !11 {
entry:
- call void @llvm.dbg.value(metadata %union.u1* %arg, metadata !28, metadata !DIExpression()), !dbg !33
- %0 = tail call %union.u1* @llvm.preserve.union.access.index.p0s_union.u1s.p0s_union.u1s(%union.u1* %arg, i32 1), !dbg !34, !llvm.preserve.access.index !16
- %b2 = bitcast %union.u1* %0 to %struct.s1*, !dbg !34
- %1 = tail call i32* @llvm.preserve.struct.access.index.p0i32.p0s_struct.s1s(%struct.s1* elementtype(%struct.s1) %b2, i32 0, i32 0), !dbg !35, !llvm.preserve.access.index !21
- %2 = tail call i32 @llvm.bpf.preserve.field.info.p0i32(i32* %1, i64 4), !dbg !36
+ call void @llvm.dbg.value(metadata ptr %arg, metadata !28, metadata !DIExpression()), !dbg !33
+ %0 = tail call ptr @llvm.preserve.union.access.index.p0.u1s.p0.u1s(ptr %arg, i32 1), !dbg !34, !llvm.preserve.access.index !16
+ %1 = tail call ptr @llvm.preserve.struct.access.index.p0.p0.s1s(ptr elementtype(%struct.s1) %0, i32 0, i32 0), !dbg !35, !llvm.preserve.access.index !21
+ %2 = tail call i32 @llvm.bpf.preserve.field.info.p0(ptr %1, i64 4), !dbg !36
call void @llvm.dbg.value(metadata i32 %2, metadata !29, metadata !DIExpression()), !dbg !33
- %3 = tail call i32* @llvm.preserve.struct.access.index.p0i32.p0s_struct.s1s(%struct.s1* elementtype(%struct.s1) %b2, i32 0, i32 1), !dbg !37, !llvm.preserve.access.index !21
- %4 = tail call i32 @llvm.bpf.preserve.field.info.p0i32(i32* %3, i64 4), !dbg !38
+ %3 = tail call ptr @llvm.preserve.struct.access.index.p0.p0.s1s(ptr elementtype(%struct.s1) %0, i32 0, i32 1), !dbg !37, !llvm.preserve.access.index !21
+ %4 = tail call i32 @llvm.bpf.preserve.field.info.p0(ptr %3, i64 4), !dbg !38
call void @llvm.dbg.value(metadata i32 %4, metadata !30, metadata !DIExpression()), !dbg !33
- %5 = tail call i32* @llvm.preserve.struct.access.index.p0i32.p0s_struct.s1s(%struct.s1* elementtype(%struct.s1) %b2, i32 0, i32 2), !dbg !39, !llvm.preserve.access.index !21
- %6 = tail call i32 @llvm.bpf.preserve.field.info.p0i32(i32* %5, i64 4), !dbg !40
+ %5 = tail call ptr @llvm.preserve.struct.access.index.p0.p0.s1s(ptr elementtype(%struct.s1) %0, i32 0, i32 2), !dbg !39, !llvm.preserve.access.index !21
+ %6 = tail call i32 @llvm.bpf.preserve.field.info.p0(ptr %5, i64 4), !dbg !40
call void @llvm.dbg.value(metadata i32 %6, metadata !31, metadata !DIExpression()), !dbg !33
- %7 = tail call i32* @llvm.preserve.struct.access.index.p0i32.p0s_struct.s1s(%struct.s1* elementtype(%struct.s1) %b2, i32 0, i32 3), !dbg !41, !llvm.preserve.access.index !21
- %8 = tail call i32 @llvm.bpf.preserve.field.info.p0i32(i32* %7, i64 4), !dbg !42
+ %7 = tail call ptr @llvm.preserve.struct.access.index.p0.p0.s1s(ptr elementtype(%struct.s1) %0, i32 0, i32 3), !dbg !41, !llvm.preserve.access.index !21
+ %8 = tail call i32 @llvm.bpf.preserve.field.info.p0(ptr %7, i64 4), !dbg !42
call void @llvm.dbg.value(metadata i32 %8, metadata !32, metadata !DIExpression()), !dbg !33
%add = add i32 %4, %2, !dbg !43
%add4 = add i32 %add, %6, !dbg !44
@@ -87,13 +86,13 @@ entry:
; CHECK-NEXT: .long 4
; Function Attrs: nounwind readnone
-declare %union.u1* @llvm.preserve.union.access.index.p0s_union.u1s.p0s_union.u1s(%union.u1*, i32) #1
+declare ptr @llvm.preserve.union.access.index.p0.u1s.p0.u1s(ptr, i32) #1
; Function Attrs: nounwind readnone
-declare i32* @llvm.preserve.struct.access.index.p0i32.p0s_struct.s1s(%struct.s1*, i32, i32) #1
+declare ptr @llvm.preserve.struct.access.index.p0.p0.s1s(ptr, i32, i32) #1
; Function Attrs: nounwind readnone
-declare i32 @llvm.bpf.preserve.field.info.p0i32(i32*, i64) #1
+declare i32 @llvm.bpf.preserve.field.info.p0(ptr, i64) #1
; Function Attrs: nounwind readnone speculatable willreturn
declare void @llvm.dbg.value(metadata, metadata, metadata) #2
diff --git a/llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-lshift-2.ll b/llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-lshift-2.ll
index 9fe96a87e06a1..13c79563d4fcb 100644
--- a/llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-lshift-2.ll
+++ b/llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-lshift-2.ll
@@ -21,16 +21,15 @@ target triple = "bpf"
%struct.s1 = type { i32, i16 }
; Function Attrs: nounwind readnone
-define dso_local i32 @test(%union.u1* %arg) local_unnamed_addr #0 !dbg !11 {
+define dso_local i32 @test(ptr %arg) local_unnamed_addr #0 !dbg !11 {
entry:
- call void @llvm.dbg.value(metadata %union.u1* %arg, metadata !27, metadata !DIExpression()), !dbg !30
- %0 = tail call %union.u1* @llvm.preserve.union.access.index.p0s_union.u1s.p0s_union.u1s(%union.u1* %arg, i32 1), !dbg !31, !llvm.preserve.access.index !16
- %b2 = getelementptr %union.u1, %union.u1* %0, i64 0, i32 0, !dbg !31
- %1 = tail call i32* @llvm.preserve.struct.access.index.p0i32.p0s_struct.s1s(%struct.s1* elementtype(%struct.s1) %b2, i32 0, i32 0), !dbg !32, !llvm.preserve.access.index !21
- %2 = tail call i32 @llvm.bpf.preserve.field.info.p0i32(i32* %1, i64 4), !dbg !33
+ call void @llvm.dbg.value(metadata ptr %arg, metadata !27, metadata !DIExpression()), !dbg !30
+ %0 = tail call ptr @llvm.preserve.union.access.index.p0.u1s.p0.u1s(ptr %arg, i32 1), !dbg !31, !llvm.preserve.access.index !16
+ %1 = tail call ptr @llvm.preserve.struct.access.index.p0.p0.s1s(ptr elementtype(%struct.s1) %0, i32 0, i32 0), !dbg !32, !llvm.preserve.access.index !21
+ %2 = tail call i32 @llvm.bpf.preserve.field.info.p0(ptr %1, i64 4), !dbg !33
call void @llvm.dbg.value(metadata i32 %2, metadata !28, metadata !DIExpression()), !dbg !30
- %3 = tail call i16* @llvm.preserve.struct.access.index.p0i16.p0s_struct.s1s(%struct.s1* elementtype(%struct.s1) %b2, i32 1, i32 1), !dbg !34, !llvm.preserve.access.index !21
- %4 = tail call i32 @llvm.bpf.preserve.field.info.p0i16(i16* %3, i64 4), !dbg !35
+ %3 = tail call ptr @llvm.preserve.struct.access.index.p0.p0.s1s(ptr elementtype(%struct.s1) %0, i32 1, i32 1), !dbg !34, !llvm.preserve.access.index !21
+ %4 = tail call i32 @llvm.bpf.preserve.field.info.p0(ptr %3, i64 4), !dbg !35
call void @llvm.dbg.value(metadata i32 %4, metadata !29, metadata !DIExpression()), !dbg !30
%add = add i32 %4, %2, !dbg !36
ret i32 %add, !dbg !37
@@ -61,19 +60,17 @@ entry:
; CHECK-NEXT: .long 4
; Function Attrs: nounwind readnone
-declare %union.u1* @llvm.preserve.union.access.index.p0s_union.u1s.p0s_union.u1s(%union.u1*, i32) #1
+declare ptr @llvm.preserve.union.access.index.p0.u1s.p0.u1s(ptr, i32) #1
; Function Attrs: nounwind readnone
-declare i32* @llvm.preserve.struct.access.index.p0i32.p0s_struct.s1s(%struct.s1*, i32, i32) #1
+declare ptr @llvm.preserve.struct.access.index.p0.p0.s1s(ptr, i32, i32) #1
; Function Attrs: nounwind readnone
-declare i32 @llvm.bpf.preserve.field.info.p0i32(i32*, i64) #1
+declare i32 @llvm.bpf.preserve.field.info.p0(ptr, i64) #1
; Function Attrs: nounwind readnone
-declare i16* @llvm.preserve.struct.access.index.p0i16.p0s_struct.s1s(%struct.s1*, i32, i32) #1
; Function Attrs: nounwind readnone
-declare i32 @llvm.bpf.preserve.field.info.p0i16(i16*, i64) #1
; Function Attrs: nounwind readnone speculatable willreturn
declare void @llvm.dbg.value(metadata, metadata, metadata) #2
diff --git a/llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-rshift-1.ll b/llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-rshift-1.ll
index 46ae2c793f033..7790273a4978d 100644
--- a/llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-rshift-1.ll
+++ b/llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-rshift-1.ll
@@ -22,22 +22,21 @@ target triple = "bpf"
%struct.s1 = type { i32 }
; Function Attrs: nounwind readnone
-define dso_local i32 @test(%union.u1* %arg) local_unnamed_addr #0 !dbg !11 {
+define dso_local i32 @test(ptr %arg) local_unnamed_addr #0 !dbg !11 {
entry:
- call void @llvm.dbg.value(metadata %union.u1* %arg, metadata !28, metadata !DIExpression()), !dbg !33
- %0 = tail call %union.u1* @llvm.preserve.union.access.index.p0s_union.u1s.p0s_union.u1s(%union.u1* %arg, i32 1), !dbg !34, !llvm.preserve.access.index !16
- %b2 = bitcast %union.u1* %0 to %struct.s1*, !dbg !34
- %1 = tail call i32* @llvm.preserve.struct.access.index.p0i32.p0s_struct.s1s(%struct.s1* elementtype(%struct.s1) %b2, i32 0, i32 0), !dbg !35, !llvm.preserve.access.index !21
- %2 = tail call i32 @llvm.bpf.preserve.field.info.p0i32(i32* %1, i64 5), !dbg !36
+ call void @llvm.dbg.value(metadata ptr %arg, metadata !28, metadata !DIExpression()), !dbg !33
+ %0 = tail call ptr @llvm.preserve.union.access.index.p0.u1s.p0.u1s(ptr %arg, i32 1), !dbg !34, !llvm.preserve.access.index !16
+ %1 = tail call ptr @llvm.preserve.struct.access.index.p0.p0.s1s(ptr elementtype(%struct.s1) %0, i32 0, i32 0), !dbg !35, !llvm.preserve.access.index !21
+ %2 = tail call i32 @llvm.bpf.preserve.field.info.p0(ptr %1, i64 5), !dbg !36
call void @llvm.dbg.value(metadata i32 %2, metadata !29, metadata !DIExpression()), !dbg !33
- %3 = tail call i32* @llvm.preserve.struct.access.index.p0i32.p0s_struct.s1s(%struct.s1* elementtype(%struct.s1) %b2, i32 0, i32 1), !dbg !37, !llvm.preserve.access.index !21
- %4 = tail call i32 @llvm.bpf.preserve.field.info.p0i32(i32* %3, i64 5), !dbg !38
+ %3 = tail call ptr @llvm.preserve.struct.access.index.p0.p0.s1s(ptr elementtype(%struct.s1) %0, i32 0, i32 1), !dbg !37, !llvm.preserve.access.index !21
+ %4 = tail call i32 @llvm.bpf.preserve.field.info.p0(ptr %3, i64 5), !dbg !38
call void @llvm.dbg.value(metadata i32 %4, metadata !30, metadata !DIExpression()), !dbg !33
- %5 = tail call i32* @llvm.preserve.struct.access.index.p0i32.p0s_struct.s1s(%struct.s1* elementtype(%struct.s1) %b2, i32 0, i32 2), !dbg !39, !llvm.preserve.access.index !21
- %6 = tail call i32 @llvm.bpf.preserve.field.info.p0i32(i32* %5, i64 5), !dbg !40
+ %5 = tail call ptr @llvm.preserve.struct.access.index.p0.p0.s1s(ptr elementtype(%struct.s1) %0, i32 0, i32 2), !dbg !39, !llvm.preserve.access.index !21
+ %6 = tail call i32 @llvm.bpf.preserve.field.info.p0(ptr %5, i64 5), !dbg !40
call void @llvm.dbg.value(metadata i32 %6, metadata !31, metadata !DIExpression()), !dbg !33
- %7 = tail call i32* @llvm.preserve.struct.access.index.p0i32.p0s_struct.s1s(%struct.s1* elementtype(%struct.s1) %b2, i32 0, i32 3), !dbg !41, !llvm.preserve.access.index !21
- %8 = tail call i32 @llvm.bpf.preserve.field.info.p0i32(i32* %7, i64 5), !dbg !42
+ %7 = tail call ptr @llvm.preserve.struct.access.index.p0.p0.s1s(ptr elementtype(%struct.s1) %0, i32 0, i32 3), !dbg !41, !llvm.preserve.access.index !21
+ %8 = tail call i32 @llvm.bpf.preserve.field.info.p0(ptr %7, i64 5), !dbg !42
call void @llvm.dbg.value(metadata i32 %8, metadata !32, metadata !DIExpression()), !dbg !33
%add = add i32 %4, %2, !dbg !43
%add4 = add i32 %add, %6, !dbg !44
@@ -86,13 +85,13 @@ entry:
; CHECK-NEXT: .long 5
; Function Attrs: nounwind readnone
-declare %union.u1* @llvm.preserve.union.access.index.p0s_union.u1s.p0s_union.u1s(%union.u1*, i32) #1
+declare ptr @llvm.preserve.union.access.index.p0.u1s.p0.u1s(ptr, i32) #1
; Function Attrs: nounwind readnone
-declare i32* @llvm.preserve.struct.access.index.p0i32.p0s_struct.s1s(%struct.s1*, i32, i32) #1
+declare ptr @llvm.preserve.struct.access.index.p0.p0.s1s(ptr, i32, i32) #1
; Function Attrs: nounwind readnone
-declare i32 @llvm.bpf.preserve.field.info.p0i32(i32*, i64) #1
+declare i32 @llvm.bpf.preserve.field.info.p0(ptr, i64) #1
; Function Attrs: nounwind readnone speculatable willreturn
declare void @llvm.dbg.value(metadata, metadata, metadata) #2
diff --git a/llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-rshift-2.ll b/llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-rshift-2.ll
index 426341b365e2e..f41c6a788f6e7 100644
--- a/llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-rshift-2.ll
+++ b/llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-rshift-2.ll
@@ -20,16 +20,15 @@ target triple = "bpf"
%struct.s1 = type { i32, i8 }
; Function Attrs: nounwind readnone
-define dso_local i32 @test(%union.u1* %arg) local_unnamed_addr #0 !dbg !11 {
+define dso_local i32 @test(ptr %arg) local_unnamed_addr #0 !dbg !11 {
entry:
- call void @llvm.dbg.value(metadata %union.u1* %arg, metadata !27, metadata !DIExpression()), !dbg !30
- %0 = tail call %union.u1* @llvm.preserve.union.access.index.p0s_union.u1s.p0s_union.u1s(%union.u1* %arg, i32 1), !dbg !31, !llvm.preserve.access.index !16
- %b2 = getelementptr inbounds %union.u1, %union.u1* %0, i64 0, i32 0, !dbg !31
- %1 = tail call i32* @llvm.preserve.struct.access.index.p0i32.p0s_struct.s1s(%struct.s1* elementtype(%struct.s1) %b2, i32 0, i32 0), !dbg !32, !llvm.preserve.access.index !21
- %2 = tail call i32 @llvm.bpf.preserve.field.info.p0i32(i32* %1, i64 5), !dbg !33
+ call void @llvm.dbg.value(metadata ptr %arg, metadata !27, metadata !DIExpression()), !dbg !30
+ %0 = tail call ptr @llvm.preserve.union.access.index.p0.u1s.p0.u1s(ptr %arg, i32 1), !dbg !31, !llvm.preserve.access.index !16
+ %1 = tail call ptr @llvm.preserve.struct.access.index.p0.p0.s1s(ptr elementtype(%struct.s1) %0, i32 0, i32 0), !dbg !32, !llvm.preserve.access.index !21
+ %2 = tail call i32 @llvm.bpf.preserve.field.info.p0(ptr %1, i64 5), !dbg !33
call void @llvm.dbg.value(metadata i32 %2, metadata !28, metadata !DIExpression()), !dbg !30
- %3 = tail call i8* @llvm.preserve.struct.access.index.p0i8.p0s_struct.s1s(%struct.s1* elementtype(%struct.s1) %b2, i32 1, i32 1), !dbg !34, !llvm.preserve.access.index !21
- %4 = tail call i32 @llvm.bpf.preserve.field.info.p0i8(i8* %3, i64 5), !dbg !35
+ %3 = tail call ptr @llvm.preserve.struct.access.index.p0.p0.s1s(ptr elementtype(%struct.s1) %0, i32 1, i32 1), !dbg !34, !llvm.preserve.access.index !21
+ %4 = tail call i32 @llvm.bpf.preserve.field.info.p0(ptr %3, i64 5), !dbg !35
call void @llvm.dbg.value(metadata i32 %4, metadata !29, metadata !DIExpression()), !dbg !30
%add = add i32 %4, %2, !dbg !36
ret i32 %add, !dbg !37
@@ -60,19 +59,17 @@ entry:
; CHECK-NEXT: .long 5
; Function Attrs: nounwind readnone
-declare %union.u1* @llvm.preserve.union.access.index.p0s_union.u1s.p0s_union.u1s(%union.u1*, i32) #1
+declare ptr @llvm.preserve.union.access.index.p0.u1s.p0.u1s(ptr, i32) #1
; Function Attrs: nounwind readnone
-declare i32* @llvm.preserve.struct.access.index.p0i32.p0s_struct.s1s(%struct.s1*, i32, i32) #1
+declare ptr @llvm.preserve.struct.access.index.p0.p0.s1s(ptr, i32, i32) #1
; Function Attrs: nounwind readnone
-declare i32 @llvm.bpf.preserve.field.info.p0i32(i32*, i64) #1
+declare i32 @llvm.bpf.preserve.field.info.p0(ptr, i64) #1
; Function Attrs: nounwind readnone
-declare i8* @llvm.preserve.struct.access.index.p0i8.p0s_struct.s1s(%struct.s1*, i32, i32) #1
; Function Attrs: nounwind readnone
-declare i32 @llvm.bpf.preserve.field.info.p0i8(i8*, i64) #1
; Function Attrs: nounwind readnone speculatable willreturn
declare void @llvm.dbg.value(metadata, metadata, metadata) #2
diff --git a/llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-rshift-3.ll b/llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-rshift-3.ll
index 966d5947e3120..2ede30701e95b 100644
--- a/llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-rshift-3.ll
+++ b/llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-rshift-3.ll
@@ -20,17 +20,16 @@ target triple = "bpf"
%struct.s1 = type { [5 x [5 x i8]] }
; Function Attrs: nounwind readnone
-define dso_local i32 @test(%union.u1* %arg) local_unnamed_addr #0 !dbg !18 {
+define dso_local i32 @test(ptr %arg) local_unnamed_addr #0 !dbg !18 {
entry:
- call void @llvm.dbg.value(metadata %union.u1* %arg, metadata !32, metadata !DIExpression()), !dbg !35
- %0 = tail call %union.u1* @llvm.preserve.union.access.index.p0s_union.u1s.p0s_union.u1s(%union.u1* %arg, i32 1), !dbg !36, !llvm.preserve.access.index !23
- %b2 = bitcast %union.u1* %0 to %struct.s1*, !dbg !36
- %1 = tail call [5 x [5 x i8]]* @llvm.preserve.struct.access.index.p0a5a5i8.p0s_struct.s1s(%struct.s1* elementtype(%struct.s1) %b2, i32 0, i32 0), !dbg !37, !llvm.preserve.access.index !28
- %2 = tail call [5 x i8]* @llvm.preserve.array.access.index.p0a5i8.p0a5a5i8([5 x [5 x i8]]* elementtype([5 x [5 x i8]]) %1, i32 1, i32 3), !dbg !38, !llvm.preserve.access.index !8
- %3 = tail call i32 @llvm.bpf.preserve.field.info.p0a5i8([5 x i8]* %2, i64 5), !dbg !39
+ call void @llvm.dbg.value(metadata ptr %arg, metadata !32, metadata !DIExpression()), !dbg !35
+ %0 = tail call ptr @llvm.preserve.union.access.index.p0.u1s.p0.u1s(ptr %arg, i32 1), !dbg !36, !llvm.preserve.access.index !23
+ %1 = tail call ptr @llvm.preserve.struct.access.index.p0.p0.s1s(ptr elementtype(%struct.s1) %0, i32 0, i32 0), !dbg !37, !llvm.preserve.access.index !28
+ %2 = tail call ptr @llvm.preserve.array.access.index.p0.p0(ptr elementtype([5 x [5 x i8]]) %1, i32 1, i32 3), !dbg !38, !llvm.preserve.access.index !8
+ %3 = tail call i32 @llvm.bpf.preserve.field.info.p0(ptr %2, i64 5), !dbg !39
call void @llvm.dbg.value(metadata i32 %3, metadata !33, metadata !DIExpression()), !dbg !35
- %4 = tail call i8* @llvm.preserve.array.access.index.p0i8.p0a5i8([5 x i8]* elementtype([5 x i8]) %2, i32 1, i32 3), !dbg !40, !llvm.preserve.access.index !12
- %5 = tail call i32 @llvm.bpf.preserve.field.info.p0i8(i8* %4, i64 5), !dbg !41
+ %4 = tail call ptr @llvm.preserve.array.access.index.p0.p0(ptr elementtype([5 x i8]) %2, i32 1, i32 3), !dbg !40, !llvm.preserve.access.index !12
+ %5 = tail call i32 @llvm.bpf.preserve.field.info.p0(ptr %4, i64 5), !dbg !41
call void @llvm.dbg.value(metadata i32 %5, metadata !34, metadata !DIExpression()), !dbg !35
%add = add i32 %5, %3, !dbg !42
ret i32 %add, !dbg !43
@@ -61,22 +60,20 @@ entry:
; CHECK-NEXT: .long 5
; Function Attrs: nounwind readnone
-declare %union.u1* @llvm.preserve.union.access.index.p0s_union.u1s.p0s_union.u1s(%union.u1*, i32) #1
+declare ptr @llvm.preserve.union.access.index.p0.u1s.p0.u1s(ptr, i32) #1
; Function Attrs: nounwind readnone
-declare [5 x [5 x i8]]* @llvm.preserve.struct.access.index.p0a5a5i8.p0s_struct.s1s(%struct.s1*, i32, i32) #1
+declare ptr @llvm.preserve.struct.access.index.p0.p0.s1s(ptr, i32, i32) #1
; Function Attrs: nounwind readnone
-declare [5 x i8]* @llvm.preserve.array.access.index.p0a5i8.p0a5a5i8([5 x [5 x i8]]*, i32, i32) #1
+declare ptr @llvm.preserve.array.access.index.p0.p0(ptr, i32, i32) #1
; Function Attrs: nounwind readnone
-declare i32 @llvm.bpf.preserve.field.info.p0a5i8([5 x i8]*, i64) #1
+declare i32 @llvm.bpf.preserve.field.info.p0(ptr, i64) #1
; Function Attrs: nounwind readnone
-declare i8* @llvm.preserve.array.access.index.p0i8.p0a5i8([5 x i8]*, i32, i32) #1
; Function Attrs: nounwind readnone
-declare i32 @llvm.bpf.preserve.field.info.p0i8(i8*, i64) #1
; Function Attrs: nounwind readnone speculatable willreturn
declare void @llvm.dbg.value(metadata, metadata, metadata) #2
diff --git a/llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-signedness-1.ll b/llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-signedness-1.ll
index 750c926c4217d..9242183d15a33 100644
--- a/llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-signedness-1.ll
+++ b/llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-signedness-1.ll
@@ -22,27 +22,25 @@ target triple = "bpf"
%union.u1 = type { i32 }
; Function Attrs: nounwind readnone
-define dso_local i32 @test(%struct.s1* %arg1, %union.u1* %arg2) local_unnamed_addr #0 !dbg !11 {
+define dso_local i32 @test(ptr %arg1, ptr %arg2) local_unnamed_addr #0 !dbg !11 {
entry:
- call void @llvm.dbg.value(metadata %struct.s1* %arg1, metadata !29, metadata !DIExpression()), !dbg !35
- call void @llvm.dbg.value(metadata %union.u1* %arg2, metadata !30, metadata !DIExpression()), !dbg !35
- %0 = tail call i32* @llvm.preserve.struct.access.index.p0i32.p0s_struct.s1s(%struct.s1* elementtype(%struct.s1) %arg1, i32 0, i32 0), !dbg !36, !llvm.preserve.access.index !16
- %1 = tail call i32 @llvm.bpf.preserve.field.info.p0i32(i32* %0, i64 3), !dbg !37
+ call void @llvm.dbg.value(metadata ptr %arg1, metadata !29, metadata !DIExpression()), !dbg !35
+ call void @llvm.dbg.value(metadata ptr %arg2, metadata !30, metadata !DIExpression()), !dbg !35
+ %0 = tail call ptr @llvm.preserve.struct.access.index.p0.p0.s1s(ptr elementtype(%struct.s1) %arg1, i32 0, i32 0), !dbg !36, !llvm.preserve.access.index !16
+ %1 = tail call i32 @llvm.bpf.preserve.field.info.p0(ptr %0, i64 3), !dbg !37
call void @llvm.dbg.value(metadata i32 %1, metadata !31, metadata !DIExpression()), !dbg !35
- %2 = tail call i16* @llvm.preserve.struct.access.index.p0i16.p0s_struct.s1s(%struct.s1* elementtype(%struct.s1) %arg1, i32 1, i32 2), !dbg !38, !llvm.preserve.access.index !16
- %3 = tail call i32 @llvm.bpf.preserve.field.info.p0i16(i16* %2, i64 3), !dbg !39
+ %2 = tail call ptr @llvm.preserve.struct.access.index.p0.p0.s1s(ptr elementtype(%struct.s1) %arg1, i32 1, i32 2), !dbg !38, !llvm.preserve.access.index !16
+ %3 = tail call i32 @llvm.bpf.preserve.field.info.p0(ptr %2, i64 3), !dbg !39
call void @llvm.dbg.value(metadata i32 %3, metadata !32, metadata !DIExpression()), !dbg !35
- %4 = tail call %union.u1* @llvm.preserve.union.access.index.p0s_union.u1s.p0s_union.u1s(%union.u1* %arg2, i32 0), !dbg !40, !llvm.preserve.access.index !23
- %b1 = getelementptr inbounds %union.u1, %union.u1* %4, i64 0, i32 0, !dbg !40
- %5 = tail call i32 @llvm.bpf.preserve.field.info.p0i32(i32* %b1, i64 3), !dbg !41
+ %4 = tail call ptr @llvm.preserve.union.access.index.p0.u1s.p0.u1s(ptr %arg2, i32 0), !dbg !40, !llvm.preserve.access.index !23
+ %5 = tail call i32 @llvm.bpf.preserve.field.info.p0(ptr %4, i64 3), !dbg !41
call void @llvm.dbg.value(metadata i32 %5, metadata !33, metadata !DIExpression()), !dbg !35
- %6 = tail call i32* @llvm.preserve.struct.access.index.p0i32.p0s_union.u1s(%union.u1* elementtype(%union.u1) %arg2, i32 0, i32 2), !dbg !42, !llvm.preserve.access.index !23
- %7 = bitcast i32* %6 to i8*, !dbg !42
- %8 = tail call i32 @llvm.bpf.preserve.field.info.p0i8(i8* %7, i64 3), !dbg !43
- call void @llvm.dbg.value(metadata i32 %8, metadata !34, metadata !DIExpression()), !dbg !35
+ %6 = tail call ptr @llvm.preserve.struct.access.index.p0.p0.u1s(ptr elementtype(%union.u1) %arg2, i32 0, i32 2), !dbg !42, !llvm.preserve.access.index !23
+ %7 = tail call i32 @llvm.bpf.preserve.field.info.p0(ptr %6, i64 3), !dbg !43
+ call void @llvm.dbg.value(metadata i32 %7, metadata !34, metadata !DIExpression()), !dbg !35
%add = add i32 %3, %1, !dbg !44
%add1 = add i32 %add, %5, !dbg !45
- %add2 = add i32 %add1, %8, !dbg !46
+ %add2 = add i32 %add1, %7, !dbg !46
ret i32 %add2, !dbg !47
}
@@ -87,25 +85,22 @@ entry:
; CHECK-NEXT: .long 3
; Function Attrs: nounwind readnone
-declare i32* @llvm.preserve.struct.access.index.p0i32.p0s_struct.s1s(%struct.s1*, i32, i32) #1
+declare ptr @llvm.preserve.struct.access.index.p0.p0.s1s(ptr, i32, i32) #1
; Function Attrs: nounwind readnone
-declare i32 @llvm.bpf.preserve.field.info.p0i32(i32*, i64) #1
+declare i32 @llvm.bpf.preserve.field.info.p0(ptr, i64) #1
; Function Attrs: nounwind readnone
-declare i16* @llvm.preserve.struct.access.index.p0i16.p0s_struct.s1s(%struct.s1*, i32, i32) #1
; Function Attrs: nounwind readnone
-declare i32 @llvm.bpf.preserve.field.info.p0i16(i16*, i64) #1
; Function Attrs: nounwind readnone
-declare %union.u1* @llvm.preserve.union.access.index.p0s_union.u1s.p0s_union.u1s(%union.u1*, i32) #1
+declare ptr @llvm.preserve.union.access.index.p0.u1s.p0.u1s(ptr, i32) #1
; Function Attrs: nounwind readnone
-declare i32* @llvm.preserve.struct.access.index.p0i32.p0s_union.u1s(%union.u1*, i32, i32) #1
+declare ptr @llvm.preserve.struct.access.index.p0.p0.u1s(ptr, i32, i32) #1
; Function Attrs: nounwind readnone
-declare i32 @llvm.bpf.preserve.field.info.p0i8(i8*, i64) #1
; Function Attrs: nounwind readnone speculatable willreturn
declare void @llvm.dbg.value(metadata, metadata, metadata) #2
diff --git a/llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-signedness-2.ll b/llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-signedness-2.ll
index a066d74dbc713..d5fbc657d4ba7 100644
--- a/llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-signedness-2.ll
+++ b/llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-signedness-2.ll
@@ -25,19 +25,18 @@ target triple = "bpf"
%struct.s1 = type { i32, i16 }
; Function Attrs: nounwind readnone
-define dso_local i32 @test(%union.u1* %arg) local_unnamed_addr #0 !dbg !20 {
+define dso_local i32 @test(ptr %arg) local_unnamed_addr #0 !dbg !20 {
entry:
- call void @llvm.dbg.value(metadata %union.u1* %arg, metadata !37, metadata !DIExpression()), !dbg !41
- %0 = tail call %union.u1* @llvm.preserve.union.access.index.p0s_union.u1s.p0s_union.u1s(%union.u1* %arg, i32 1), !dbg !42, !llvm.preserve.access.index !24
- %b2 = getelementptr inbounds %union.u1, %union.u1* %0, i64 0, i32 0, !dbg !42
- %1 = tail call i32* @llvm.preserve.struct.access.index.p0i32.p0s_struct.s1s(%struct.s1* elementtype(%struct.s1) %b2, i32 0, i32 0), !dbg !43, !llvm.preserve.access.index !28
- %2 = tail call i32 @llvm.bpf.preserve.field.info.p0i32(i32* %1, i64 3), !dbg !44
+ call void @llvm.dbg.value(metadata ptr %arg, metadata !37, metadata !DIExpression()), !dbg !41
+ %0 = tail call ptr @llvm.preserve.union.access.index.p0.u1s.p0.u1s(ptr %arg, i32 1), !dbg !42, !llvm.preserve.access.index !24
+ %1 = tail call ptr @llvm.preserve.struct.access.index.p0.p0.s1s(ptr elementtype(%struct.s1) %0, i32 0, i32 0), !dbg !43, !llvm.preserve.access.index !28
+ %2 = tail call i32 @llvm.bpf.preserve.field.info.p0(ptr %1, i64 3), !dbg !44
call void @llvm.dbg.value(metadata i32 %2, metadata !38, metadata !DIExpression()), !dbg !41
- %3 = tail call i16* @llvm.preserve.struct.access.index.p0i16.p0s_struct.s1s(%struct.s1* elementtype(%struct.s1) %b2, i32 1, i32 1), !dbg !45, !llvm.preserve.access.index !28
- %4 = tail call i32 @llvm.bpf.preserve.field.info.p0i16(i16* %3, i64 3), !dbg !46
+ %3 = tail call ptr @llvm.preserve.struct.access.index.p0.p0.s1s(ptr elementtype(%struct.s1) %0, i32 1, i32 1), !dbg !45, !llvm.preserve.access.index !28
+ %4 = tail call i32 @llvm.bpf.preserve.field.info.p0(ptr %3, i64 3), !dbg !46
call void @llvm.dbg.value(metadata i32 %4, metadata !39, metadata !DIExpression()), !dbg !41
- %5 = tail call i16* @llvm.preserve.struct.access.index.p0i16.p0s_struct.s1s(%struct.s1* elementtype(%struct.s1) %b2, i32 1, i32 2), !dbg !47, !llvm.preserve.access.index !28
- %6 = tail call i32 @llvm.bpf.preserve.field.info.p0i16(i16* %5, i64 3), !dbg !48
+ %5 = tail call ptr @llvm.preserve.struct.access.index.p0.p0.s1s(ptr elementtype(%struct.s1) %0, i32 1, i32 2), !dbg !47, !llvm.preserve.access.index !28
+ %6 = tail call i32 @llvm.bpf.preserve.field.info.p0(ptr %5, i64 3), !dbg !48
call void @llvm.dbg.value(metadata i32 %6, metadata !40, metadata !DIExpression()), !dbg !41
%add = add i32 %4, %2, !dbg !49
%add3 = add i32 %add, %6, !dbg !50
@@ -77,19 +76,17 @@ entry:
; CHECK-NEXT: .long 3
; Function Attrs: nounwind readnone
-declare %union.u1* @llvm.preserve.union.access.index.p0s_union.u1s.p0s_union.u1s(%union.u1*, i32) #1
+declare ptr @llvm.preserve.union.access.index.p0.u1s.p0.u1s(ptr, i32) #1
; Function Attrs: nounwind readnone
-declare i32* @llvm.preserve.struct.access.index.p0i32.p0s_struct.s1s(%struct.s1*, i32, i32) #1
+declare ptr @llvm.preserve.struct.access.index.p0.p0.s1s(ptr, i32, i32) #1
; Function Attrs: nounwind readnone
-declare i32 @llvm.bpf.preserve.field.info.p0i32(i32*, i64) #1
+declare i32 @llvm.bpf.preserve.field.info.p0(ptr, i64) #1
; Function Attrs: nounwind readnone
-declare i16* @llvm.preserve.struct.access.index.p0i16.p0s_struct.s1s(%struct.s1*, i32, i32) #1
; Function Attrs: nounwind readnone
-declare i32 @llvm.bpf.preserve.field.info.p0i16(i16*, i64) #1
; Function Attrs: nounwind readnone speculatable willreturn
declare void @llvm.dbg.value(metadata, metadata, metadata) #2
diff --git a/llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-signedness-3.ll b/llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-signedness-3.ll
index ea9e3d088f3e5..5a2a1b7031c33 100644
--- a/llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-signedness-3.ll
+++ b/llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-signedness-3.ll
@@ -24,19 +24,18 @@ target triple = "bpf"
%struct.s1 = type { [10 x i32], [10 x [10 x i32]] }
; Function Attrs: nounwind readnone
-define dso_local i32 @test(%union.u1* %arg) local_unnamed_addr #0 !dbg !29 {
+define dso_local i32 @test(ptr %arg) local_unnamed_addr #0 !dbg !29 {
entry:
- call void @llvm.dbg.value(metadata %union.u1* %arg, metadata !43, metadata !DIExpression()), !dbg !46
- %0 = tail call %union.u1* @llvm.preserve.union.access.index.p0s_union.u1s.p0s_union.u1s(%union.u1* %arg, i32 1), !dbg !47, !llvm.preserve.access.index !33
- %b2 = getelementptr inbounds %union.u1, %union.u1* %0, i64 0, i32 0, !dbg !47
- %1 = tail call [10 x i32]* @llvm.preserve.struct.access.index.p0a10i32.p0s_struct.s1s(%struct.s1* elementtype(%struct.s1) %b2, i32 0, i32 0), !dbg !48, !llvm.preserve.access.index !38
- %2 = tail call i32* @llvm.preserve.array.access.index.p0i32.p0a10i32([10 x i32]* elementtype([10 x i32]) %1, i32 1, i32 5), !dbg !49, !llvm.preserve.access.index !17
- %3 = tail call i32 @llvm.bpf.preserve.field.info.p0i32(i32* %2, i64 3), !dbg !50
+ call void @llvm.dbg.value(metadata ptr %arg, metadata !43, metadata !DIExpression()), !dbg !46
+ %0 = tail call ptr @llvm.preserve.union.access.index.p0.u1s.p0.u1s(ptr %arg, i32 1), !dbg !47, !llvm.preserve.access.index !33
+ %1 = tail call ptr @llvm.preserve.struct.access.index.p0.p0.s1s(ptr elementtype(%struct.s1) %0, i32 0, i32 0), !dbg !48, !llvm.preserve.access.index !38
+ %2 = tail call ptr @llvm.preserve.array.access.index.p0.p0(ptr elementtype([10 x i32]) %1, i32 1, i32 5), !dbg !49, !llvm.preserve.access.index !17
+ %3 = tail call i32 @llvm.bpf.preserve.field.info.p0(ptr %2, i64 3), !dbg !50
call void @llvm.dbg.value(metadata i32 %3, metadata !44, metadata !DIExpression()), !dbg !46
- %4 = tail call [10 x [10 x i32]]* @llvm.preserve.struct.access.index.p0a10a10i32.p0s_struct.s1s(%struct.s1* elementtype(%struct.s1) %b2, i32 1, i32 1), !dbg !51, !llvm.preserve.access.index !38
- %5 = tail call [10 x i32]* @llvm.preserve.array.access.index.p0a10i32.p0a10a10i32([10 x [10 x i32]]* elementtype([10 x [10 x i32]]) %4, i32 1, i32 5), !dbg !52, !llvm.preserve.access.index !21
- %6 = tail call i32* @llvm.preserve.array.access.index.p0i32.p0a10i32([10 x i32]* elementtype([10 x i32]) %5, i32 1, i32 5), !dbg !52, !llvm.preserve.access.index !24
- %7 = tail call i32 @llvm.bpf.preserve.field.info.p0i32(i32* %6, i64 3), !dbg !53
+ %4 = tail call ptr @llvm.preserve.struct.access.index.p0.p0.s1s(ptr elementtype(%struct.s1) %0, i32 1, i32 1), !dbg !51, !llvm.preserve.access.index !38
+ %5 = tail call ptr @llvm.preserve.array.access.index.p0.p0(ptr elementtype([10 x [10 x i32]]) %4, i32 1, i32 5), !dbg !52, !llvm.preserve.access.index !21
+ %6 = tail call ptr @llvm.preserve.array.access.index.p0.p0(ptr elementtype([10 x i32]) %5, i32 1, i32 5), !dbg !52, !llvm.preserve.access.index !24
+ %7 = tail call i32 @llvm.bpf.preserve.field.info.p0(ptr %6, i64 3), !dbg !53
call void @llvm.dbg.value(metadata i32 %7, metadata !45, metadata !DIExpression()), !dbg !46
%add = add i32 %7, %3, !dbg !54
ret i32 %add, !dbg !55
@@ -67,22 +66,20 @@ entry:
; CHECK-NEXT: .long 3
; Function Attrs: nounwind readnone
-declare %union.u1* @llvm.preserve.union.access.index.p0s_union.u1s.p0s_union.u1s(%union.u1*, i32) #1
+declare ptr @llvm.preserve.union.access.index.p0.u1s.p0.u1s(ptr, i32) #1
; Function Attrs: nounwind readnone
-declare [10 x i32]* @llvm.preserve.struct.access.index.p0a10i32.p0s_struct.s1s(%struct.s1*, i32, i32) #1
+declare ptr @llvm.preserve.struct.access.index.p0.p0.s1s(ptr, i32, i32) #1
; Function Attrs: nounwind readnone
-declare i32* @llvm.preserve.array.access.index.p0i32.p0a10i32([10 x i32]*, i32, i32) #1
+declare ptr @llvm.preserve.array.access.index.p0.p0(ptr, i32, i32) #1
; Function Attrs: nounwind readnone
-declare i32 @llvm.bpf.preserve.field.info.p0i32(i32*, i64) #1
+declare i32 @llvm.bpf.preserve.field.info.p0(ptr, i64) #1
; Function Attrs: nounwind readnone
-declare [10 x [10 x i32]]* @llvm.preserve.struct.access.index.p0a10a10i32.p0s_struct.s1s(%struct.s1*, i32, i32) #1
; Function Attrs: nounwind readnone
-declare [10 x i32]* @llvm.preserve.array.access.index.p0a10i32.p0a10a10i32([10 x [10 x i32]]*, i32, i32) #1
; Function Attrs: nounwind readnone speculatable willreturn
declare void @llvm.dbg.value(metadata, metadata, metadata) #2
diff --git a/llvm/test/CodeGen/BPF/CORE/intrinsic-struct.ll b/llvm/test/CodeGen/BPF/CORE/intrinsic-struct.ll
index 1a8d0da813a91..8b95b1c48e79f 100644
--- a/llvm/test/CodeGen/BPF/CORE/intrinsic-struct.ll
+++ b/llvm/test/CodeGen/BPF/CORE/intrinsic-struct.ll
@@ -5,7 +5,7 @@
; Source code:
; struct s { int a; int b; };
; #define _(x) (__builtin_preserve_access_index(x))
-; int get_value(const void *addr);
+; int get_value(const ptr addr);
; int test(struct s *arg) { return get_value(_(&arg->b)); }
; Compiler flag to generate IR:
; clang -target bpf -S -O2 -g -emit-llvm -Xclang -disable-llvm-passes test.c
@@ -15,12 +15,11 @@ target triple = "bpf"
%struct.s = type { i32, i32 }
; Function Attrs: nounwind
-define dso_local i32 @test(%struct.s* %arg) local_unnamed_addr #0 !dbg !7 {
+define dso_local i32 @test(ptr %arg) local_unnamed_addr #0 !dbg !7 {
entry:
- call void @llvm.dbg.value(metadata %struct.s* %arg, metadata !17, metadata !DIExpression()), !dbg !18
- %0 = tail call i32* @llvm.preserve.struct.access.index.p0i32.p0s_struct.ss(%struct.s* elementtype(%struct.s) %arg, i32 1, i32 1), !dbg !19, !llvm.preserve.access.index !12
- %1 = bitcast i32* %0 to i8*, !dbg !19
- %call = tail call i32 @get_value(i8* %1) #4, !dbg !20
+ call void @llvm.dbg.value(metadata ptr %arg, metadata !17, metadata !DIExpression()), !dbg !18
+ %0 = tail call ptr @llvm.preserve.struct.access.index.p0.p0.ss(ptr elementtype(%struct.s) %arg, i32 1, i32 1), !dbg !19, !llvm.preserve.access.index !12
+ %call = tail call i32 @get_value(ptr %0) #4, !dbg !20
ret i32 %call, !dbg !21
}
@@ -40,10 +39,10 @@ entry:
; CHECK-NEXT: .long 26
; CHECK-NEXT: .long 0
-declare dso_local i32 @get_value(i8*) local_unnamed_addr #1
+declare dso_local i32 @get_value(ptr) local_unnamed_addr #1
; Function Attrs: nounwind readnone
-declare i32* @llvm.preserve.struct.access.index.p0i32.p0s_struct.ss(%struct.s*, i32 immarg, i32 immarg) #2
+declare ptr @llvm.preserve.struct.access.index.p0.p0.ss(ptr, i32 immarg, i32 immarg) #2
; Function Attrs: nounwind readnone speculatable
declare void @llvm.dbg.value(metadata, metadata, metadata) #3
diff --git a/llvm/test/CodeGen/BPF/CORE/intrinsic-typeinfo-enum-value.ll b/llvm/test/CodeGen/BPF/CORE/intrinsic-typeinfo-enum-value.ll
index 7692c4c432b29..88658b66972c8 100644
--- a/llvm/test/CodeGen/BPF/CORE/intrinsic-typeinfo-enum-value.ll
+++ b/llvm/test/CodeGen/BPF/CORE/intrinsic-typeinfo-enum-value.ll
@@ -22,10 +22,10 @@ target triple = "bpf"
; Function Attrs: nounwind readnone
define dso_local i32 @test() local_unnamed_addr #0 !dbg !18 {
entry:
- %0 = tail call i64 @llvm.bpf.preserve.enum.value(i32 0, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @0, i64 0, i64 0), i64 0), !dbg !23, !llvm.preserve.access.index !3
- %1 = tail call i64 @llvm.bpf.preserve.enum.value(i32 1, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @1, i64 0, i64 0), i64 1), !dbg !24, !llvm.preserve.access.index !3
+ %0 = tail call i64 @llvm.bpf.preserve.enum.value(i32 0, ptr @0, i64 0), !dbg !23, !llvm.preserve.access.index !3
+ %1 = tail call i64 @llvm.bpf.preserve.enum.value(i32 1, ptr @1, i64 1), !dbg !24, !llvm.preserve.access.index !3
%add = add i64 %1, %0, !dbg !25
- %2 = tail call i64 @llvm.bpf.preserve.enum.value(i32 2, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @2, i64 0, i64 0), i64 1), !dbg !26, !llvm.preserve.access.index !13
+ %2 = tail call i64 @llvm.bpf.preserve.enum.value(i32 2, ptr @2, i64 1), !dbg !26, !llvm.preserve.access.index !13
%add1 = add i64 %add, %2, !dbg !27
%conv = trunc i64 %add1 to i32, !dbg !23
ret i32 %conv, !dbg !28
@@ -81,7 +81,7 @@ entry:
; CHECK-NEXT: .long 11
; Function Attrs: nounwind readnone
-declare i64 @llvm.bpf.preserve.enum.value(i32, i8*, i64) #1
+declare i64 @llvm.bpf.preserve.enum.value(i32, ptr, i64) #1
attributes #0 = { nounwind readnone "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "frame-pointer"="all" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
attributes #1 = { nounwind readnone }
diff --git a/llvm/test/CodeGen/BPF/CORE/intrinsic-typeinfo-type-size-2.ll b/llvm/test/CodeGen/BPF/CORE/intrinsic-typeinfo-type-size-2.ll
index 693268d7d296a..b2f8e485a0814 100644
--- a/llvm/test/CodeGen/BPF/CORE/intrinsic-typeinfo-type-size-2.ll
+++ b/llvm/test/CodeGen/BPF/CORE/intrinsic-typeinfo-type-size-2.ll
@@ -22,9 +22,9 @@ target triple = "bpf"
; Function Attrs: nounwind readnone
define dso_local i32 @test() local_unnamed_addr #0 !dbg !17 {
entry:
- call void @llvm.dbg.declare(metadata [10 x i32]* undef, metadata !20, metadata !DIExpression()), !dbg !28
- call void @llvm.dbg.declare(metadata i32 ()** undef, metadata !19, metadata !DIExpression()), !dbg !29
- call void @llvm.dbg.declare(metadata i32* undef, metadata !27, metadata !DIExpression()), !dbg !30
+ call void @llvm.dbg.declare(metadata ptr undef, metadata !20, metadata !DIExpression()), !dbg !28
+ call void @llvm.dbg.declare(metadata ptr undef, metadata !19, metadata !DIExpression()), !dbg !29
+ call void @llvm.dbg.declare(metadata ptr undef, metadata !27, metadata !DIExpression()), !dbg !30
%0 = tail call i32 @llvm.bpf.preserve.type.info(i32 0, i64 1), !dbg !31, !llvm.preserve.access.index !8
%1 = tail call i32 @llvm.bpf.preserve.type.info(i32 1, i64 1), !dbg !32, !llvm.preserve.access.index !21
%add = add i32 %1, %0, !dbg !33
diff --git a/llvm/test/CodeGen/BPF/CORE/intrinsic-union.ll b/llvm/test/CodeGen/BPF/CORE/intrinsic-union.ll
index 5010774cfadea..ef360929014fd 100644
--- a/llvm/test/CodeGen/BPF/CORE/intrinsic-union.ll
+++ b/llvm/test/CodeGen/BPF/CORE/intrinsic-union.ll
@@ -5,7 +5,7 @@
; Source code:
; union u { int a; int b; };
; #define _(x) (__builtin_preserve_access_index(x))
-; int get_value(const void *addr);
+; int get_value(const ptr addr);
; int test(union u *arg) { return get_value(_(&arg->b)); }
; Compiler flag to generate IR:
; clang -target bpf -S -O2 -g -emit-llvm -Xclang -disable-llvm-passes test.c
@@ -15,12 +15,11 @@ target triple = "bpf"
%union.u = type { i32 }
; Function Attrs: nounwind
-define dso_local i32 @test(%union.u* %arg) local_unnamed_addr #0 !dbg !7 {
+define dso_local i32 @test(ptr %arg) local_unnamed_addr #0 !dbg !7 {
entry:
- call void @llvm.dbg.value(metadata %union.u* %arg, metadata !17, metadata !DIExpression()), !dbg !18
- %0 = tail call %union.u* @llvm.preserve.union.access.index.p0s_union.us.p0s_union.us(%union.u* %arg, i32 1), !dbg !19, !llvm.preserve.access.index !12
- %1 = bitcast %union.u* %0 to i8*, !dbg !19
- %call = tail call i32 @get_value(i8* %1) #4, !dbg !20
+ call void @llvm.dbg.value(metadata ptr %arg, metadata !17, metadata !DIExpression()), !dbg !18
+ %0 = tail call ptr @llvm.preserve.union.access.index.p0.us.p0.us(ptr %arg, i32 1), !dbg !19, !llvm.preserve.access.index !12
+ %call = tail call i32 @get_value(ptr %0) #4, !dbg !20
ret i32 %call, !dbg !21
}
; CHECK-LABEL: test
@@ -39,10 +38,10 @@ entry:
; CHECK-NEXT: .long 26
; CHECK-NEXT: .long 0
-declare dso_local i32 @get_value(i8*) local_unnamed_addr #1
+declare dso_local i32 @get_value(ptr) local_unnamed_addr #1
; Function Attrs: nounwind readnone
-declare %union.u* @llvm.preserve.union.access.index.p0s_union.us.p0s_union.us(%union.u*, i32 immarg) #2
+declare ptr @llvm.preserve.union.access.index.p0.us.p0.us(ptr, i32 immarg) #2
; Function Attrs: nounwind readnone speculatable
declare void @llvm.dbg.value(metadata, metadata, metadata) #3
diff --git a/llvm/test/CodeGen/BPF/CORE/no-elf-ama-symbol.ll b/llvm/test/CodeGen/BPF/CORE/no-elf-ama-symbol.ll
index a080146ffaab7..4c6ce1ef14579 100644
--- a/llvm/test/CodeGen/BPF/CORE/no-elf-ama-symbol.ll
+++ b/llvm/test/CodeGen/BPF/CORE/no-elf-ama-symbol.ll
@@ -15,18 +15,18 @@ target triple = "bpf"
%struct.tt = type { i32 }
; Function Attrs: nounwind readonly
-define dso_local i32 @test(%struct.tt* readonly %arg) local_unnamed_addr #0 !dbg !7 {
+define dso_local i32 @test(ptr readonly %arg) local_unnamed_addr #0 !dbg !7 {
entry:
- call void @llvm.dbg.value(metadata %struct.tt* %arg, metadata !16, metadata !DIExpression()), !dbg !17
- %0 = tail call i32* @llvm.preserve.struct.access.index.p0i32.p0s_struct.tts(%struct.tt* elementtype(%struct.tt) %arg, i32 0, i32 0), !dbg !18, !llvm.preserve.access.index !12
- %1 = load i32, i32* %0, align 4, !dbg !18, !tbaa !19
+ call void @llvm.dbg.value(metadata ptr %arg, metadata !16, metadata !DIExpression()), !dbg !17
+ %0 = tail call ptr @llvm.preserve.struct.access.index.p0.p0.tts(ptr elementtype(%struct.tt) %arg, i32 0, i32 0), !dbg !18, !llvm.preserve.access.index !12
+ %1 = load i32, ptr %0, align 4, !dbg !18, !tbaa !19
ret i32 %1, !dbg !24
}
; CHECK-NOT: llvm.tt:0:0$0:0
; Function Attrs: nounwind readnone
-declare i32* @llvm.preserve.struct.access.index.p0i32.p0s_struct.tts(%struct.tt*, i32, i32) #1
+declare ptr @llvm.preserve.struct.access.index.p0.p0.tts(ptr, i32, i32) #1
; Function Attrs: nounwind readnone speculatable
declare void @llvm.dbg.value(metadata, metadata, metadata) #2
diff --git a/llvm/test/CodeGen/BPF/CORE/no-narrow-load.ll b/llvm/test/CodeGen/BPF/CORE/no-narrow-load.ll
index c9fd74e86772e..b154b1d29fa24 100644
--- a/llvm/test/CodeGen/BPF/CORE/no-narrow-load.ll
+++ b/llvm/test/CodeGen/BPF/CORE/no-narrow-load.ll
@@ -10,7 +10,7 @@
; int flags;
; } __attribute__((preserve_access_index));
;
-; extern void output(void *);
+; extern void output(ptr);
; void test(struct info_t * args) {
; int is_mask2 = args->flags & 0x10000;
; struct data_t data = {};
@@ -28,44 +28,40 @@ target triple = "bpf"
%struct.data_t = type { i32, i32 }
; Function Attrs: nounwind
-define dso_local void @test(%struct.info_t* readonly %args) local_unnamed_addr #0 !dbg !12 {
+define dso_local void @test(ptr readonly %args) local_unnamed_addr #0 !dbg !12 {
entry:
%data = alloca i64, align 8
- %tmpcast = bitcast i64* %data to %struct.data_t*
- call void @llvm.dbg.value(metadata %struct.info_t* %args, metadata !22, metadata !DIExpression()), !dbg !29
- %0 = tail call i32* @llvm.preserve.struct.access.index.p0i32.p0s_struct.info_ts(%struct.info_t* elementtype(%struct.info_t) %args, i32 1, i32 1), !dbg !30, !llvm.preserve.access.index !16
- %1 = load i32, i32* %0, align 4, !dbg !30, !tbaa !31
+ call void @llvm.dbg.value(metadata ptr %args, metadata !22, metadata !DIExpression()), !dbg !29
+ %0 = tail call ptr @llvm.preserve.struct.access.index.p0.p0.info_ts(ptr elementtype(%struct.info_t) %args, i32 1, i32 1), !dbg !30, !llvm.preserve.access.index !16
+ %1 = load i32, ptr %0, align 4, !dbg !30, !tbaa !31
%and = and i32 %1, 65536, !dbg !36
call void @llvm.dbg.value(metadata i32 %and, metadata !23, metadata !DIExpression()), !dbg !29
- %2 = bitcast i64* %data to i8*, !dbg !37
- call void @llvm.lifetime.start.p0i8(i64 8, i8* nonnull %2) #5, !dbg !37
- call void @llvm.dbg.declare(metadata %struct.data_t* %tmpcast, metadata !24, metadata !DIExpression()), !dbg !38
- store i64 0, i64* %data, align 8, !dbg !38
+ call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %data) #5, !dbg !37
+ call void @llvm.dbg.declare(metadata ptr %data, metadata !24, metadata !DIExpression()), !dbg !38
+ store i64 0, ptr %data, align 8, !dbg !38
%tobool = icmp eq i32 %and, 0, !dbg !39
br i1 %tobool, label %cond.false, label %lor.end.critedge, !dbg !39
cond.false: ; preds = %entry
- %3 = tail call i32* @llvm.preserve.struct.access.index.p0i32.p0s_struct.info_ts(%struct.info_t* elementtype(%struct.info_t) %args, i32 0, i32 0), !dbg !40, !llvm.preserve.access.index !16
- %4 = load i32, i32* %3, align 4, !dbg !40, !tbaa !41
- %d1 = bitcast i64* %data to i32*, !dbg !42
- store i32 %4, i32* %d1, align 8, !dbg !43, !tbaa !44
- %5 = load i32, i32* %0, align 4, !dbg !46, !tbaa !31
- %and2 = and i32 %5, 32768, !dbg !47
+ %2 = tail call ptr @llvm.preserve.struct.access.index.p0.p0.info_ts(ptr elementtype(%struct.info_t) %args, i32 0, i32 0), !dbg !40, !llvm.preserve.access.index !16
+ %3 = load i32, ptr %2, align 4, !dbg !40, !tbaa !41
+ store i32 %3, ptr %data, align 8, !dbg !43, !tbaa !44
+ %4 = load i32, ptr %0, align 4, !dbg !46, !tbaa !31
+ %and2 = and i32 %4, 32768, !dbg !47
%tobool3 = icmp eq i32 %and2, 0, !dbg !48
%phitmp = select i1 %tobool3, i32 2, i32 1, !dbg !48
br label %lor.end, !dbg !48
lor.end.critedge: ; preds = %entry
- %d1.c = bitcast i64* %data to i32*, !dbg !42
- store i32 2, i32* %d1.c, align 8, !dbg !43, !tbaa !44
+ store i32 2, ptr %data, align 8, !dbg !43, !tbaa !44
br label %lor.end, !dbg !48
lor.end: ; preds = %lor.end.critedge, %cond.false
- %6 = phi i32 [ %phitmp, %cond.false ], [ 1, %lor.end.critedge ]
- %d2 = getelementptr inbounds %struct.data_t, %struct.data_t* %tmpcast, i64 0, i32 1, !dbg !49
- store i32 %6, i32* %d2, align 4, !dbg !50, !tbaa !51
- call void @output(i8* nonnull %2) #5, !dbg !52
- call void @llvm.lifetime.end.p0i8(i64 8, i8* nonnull %2) #5, !dbg !53
+ %5 = phi i32 [ %phitmp, %cond.false ], [ 1, %lor.end.critedge ]
+ %d2 = getelementptr inbounds %struct.data_t, ptr %data, i64 0, i32 1, !dbg !49
+ store i32 %5, ptr %d2, align 4, !dbg !50, !tbaa !51
+ call void @output(ptr nonnull %data) #5, !dbg !52
+ call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %data) #5, !dbg !53
ret void, !dbg !53
}
@@ -78,15 +74,15 @@ lor.end: ; preds = %lor.end.critedge, %
declare void @llvm.dbg.declare(metadata, metadata, metadata) #1
; Function Attrs: argmemonly nounwind willreturn
-declare void @llvm.lifetime.start.p0i8(i64 immarg, i8* nocapture) #2
+declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nounwind readnone
-declare i32* @llvm.preserve.struct.access.index.p0i32.p0s_struct.info_ts(%struct.info_t*, i32 immarg, i32 immarg) #3
+declare ptr @llvm.preserve.struct.access.index.p0.p0.info_ts(ptr, i32 immarg, i32 immarg) #3
-declare !dbg !4 dso_local void @output(i8*) local_unnamed_addr #4
+declare !dbg !4 dso_local void @output(ptr) local_unnamed_addr #4
; Function Attrs: argmemonly nounwind willreturn
-declare void @llvm.lifetime.end.p0i8(i64 immarg, i8* nocapture) #2
+declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nounwind readnone speculatable willreturn
declare void @llvm.dbg.value(metadata, metadata, metadata) #1
diff --git a/llvm/test/CodeGen/BPF/CORE/offset-reloc-access-str.ll b/llvm/test/CodeGen/BPF/CORE/offset-reloc-access-str.ll
index 7b94918cf3363..5da2bbd43fa09 100644
--- a/llvm/test/CodeGen/BPF/CORE/offset-reloc-access-str.ll
+++ b/llvm/test/CodeGen/BPF/CORE/offset-reloc-access-str.ll
@@ -6,7 +6,7 @@
; struct s { int a; int b; };
; struct t { int c; int d; };
; #define _(x) (__builtin_preserve_access_index(x))
-; int get_value(const void *addr1, const void *addr2);
+; int get_value(const ptr addr1, const ptr addr2);
; int test(struct s *arg1, struct t *arg2) {
; return get_value(_(&arg1->b), _(&arg2->d));
; }
@@ -18,15 +18,13 @@ target triple = "bpf"
%struct.t = type { i32, i32 }
; Function Attrs: nounwind
-define dso_local i32 @test(%struct.s* %arg1, %struct.t* %arg2) local_unnamed_addr #0 !dbg !7 {
+define dso_local i32 @test(ptr %arg1, ptr %arg2) local_unnamed_addr #0 !dbg !7 {
entry:
- call void @llvm.dbg.value(metadata %struct.s* %arg1, metadata !22, metadata !DIExpression()), !dbg !24
- call void @llvm.dbg.value(metadata %struct.t* %arg2, metadata !23, metadata !DIExpression()), !dbg !24
- %0 = tail call i32* @llvm.preserve.struct.access.index.p0i32.p0s_struct.ss(%struct.s* elementtype(%struct.s) %arg1, i32 1, i32 1), !dbg !25, !llvm.preserve.access.index !12
- %1 = bitcast i32* %0 to i8*, !dbg !25
- %2 = tail call i32* @llvm.preserve.struct.access.index.p0i32.p0s_struct.ts(%struct.t* elementtype(%struct.t) %arg2, i32 1, i32 1), !dbg !26, !llvm.preserve.access.index !17
- %3 = bitcast i32* %2 to i8*, !dbg !26
- %call = tail call i32 @get_value(i8* %1, i8* %3) #4, !dbg !27
+ call void @llvm.dbg.value(metadata ptr %arg1, metadata !22, metadata !DIExpression()), !dbg !24
+ call void @llvm.dbg.value(metadata ptr %arg2, metadata !23, metadata !DIExpression()), !dbg !24
+ %0 = tail call ptr @llvm.preserve.struct.access.index.p0.p0.ss(ptr elementtype(%struct.s) %arg1, i32 1, i32 1), !dbg !25, !llvm.preserve.access.index !12
+ %1 = tail call ptr @llvm.preserve.struct.access.index.p0.p0.ts(ptr elementtype(%struct.t) %arg2, i32 1, i32 1), !dbg !26, !llvm.preserve.access.index !17
+ %call = tail call i32 @get_value(ptr %0, ptr %1) #4, !dbg !27
ret i32 %call, !dbg !28
}
@@ -48,13 +46,13 @@ entry:
; CHECK-NEXT: .long [[ACCESS_STR]]
; CHECK-NEXT: .long 0
-declare dso_local i32 @get_value(i8*, i8*) local_unnamed_addr #1
+declare dso_local i32 @get_value(ptr, ptr) local_unnamed_addr #1
; Function Attrs: nounwind readnone
-declare i32* @llvm.preserve.struct.access.index.p0i32.p0s_struct.ss(%struct.s*, i32 immarg, i32 immarg) #2
+declare ptr @llvm.preserve.struct.access.index.p0.p0.ss(ptr, i32 immarg, i32 immarg) #2
; Function Attrs: nounwind readnone
-declare i32* @llvm.preserve.struct.access.index.p0i32.p0s_struct.ts(%struct.t*, i32 immarg, i32 immarg) #2
+declare ptr @llvm.preserve.struct.access.index.p0.p0.ts(ptr, i32 immarg, i32 immarg) #2
; Function Attrs: nounwind readnone speculatable
declare void @llvm.dbg.value(metadata, metadata, metadata) #3
diff --git a/llvm/test/CodeGen/BPF/CORE/offset-reloc-basic.ll b/llvm/test/CodeGen/BPF/CORE/offset-reloc-basic.ll
index 85bd7fa6d5b6e..8ca8a66027379 100644
--- a/llvm/test/CodeGen/BPF/CORE/offset-reloc-basic.ll
+++ b/llvm/test/CodeGen/BPF/CORE/offset-reloc-basic.ll
@@ -7,8 +7,8 @@
; struct net_device *dev;
; };
; #define _(x) (__builtin_preserve_access_index(x))
-; static int (*bpf_probe_read)(void *dst, int size, void *unsafe_ptr)
-; = (void *) 4;
+; static int (*bpf_probe_read)(ptr dst, int size, ptr unsafe_ptr)
+; = (ptr) 4;
;
; int bpf_prog(struct sk_buff *ctx) {
; struct net_device *dev = 0;
@@ -20,26 +20,24 @@
target triple = "bpf"
-%struct.sk_buff = type { i32, %struct.net_device* }
+%struct.sk_buff = type { i32, ptr }
%struct.net_device = type opaque
; Function Attrs: nounwind
-define dso_local i32 @bpf_prog(%struct.sk_buff*) local_unnamed_addr #0 !dbg !15 {
- %2 = alloca %struct.net_device*, align 8
- call void @llvm.dbg.value(metadata %struct.sk_buff* %0, metadata !26, metadata !DIExpression()), !dbg !28
- %3 = bitcast %struct.net_device** %2 to i8*, !dbg !29
- call void @llvm.lifetime.start.p0i8(i64 8, i8* nonnull %3) #4, !dbg !29
- call void @llvm.dbg.value(metadata %struct.net_device* null, metadata !27, metadata !DIExpression()), !dbg !28
- store %struct.net_device* null, %struct.net_device** %2, align 8, !dbg !30, !tbaa !31
- %4 = tail call %struct.net_device** @llvm.preserve.struct.access.index.p0p0s_struct.net_devices.p0s_struct.sk_buffs(%struct.sk_buff* elementtype(%struct.sk_buff) %0, i32 1, i32 1), !dbg !35, !llvm.preserve.access.index !19
- %5 = bitcast %struct.net_device** %4 to i8*, !dbg !35
- %6 = call i32 inttoptr (i64 4 to i32 (i8*, i32, i8*)*)(i8* nonnull %3, i32 8, i8* %5) #4, !dbg !36
- %7 = load %struct.net_device*, %struct.net_device** %2, align 8, !dbg !37, !tbaa !31
- call void @llvm.dbg.value(metadata %struct.net_device* %7, metadata !27, metadata !DIExpression()), !dbg !28
- %8 = icmp ne %struct.net_device* %7, null, !dbg !38
- %9 = zext i1 %8 to i32, !dbg !38
- call void @llvm.lifetime.end.p0i8(i64 8, i8* nonnull %3) #4, !dbg !39
- ret i32 %9, !dbg !40
+define dso_local i32 @bpf_prog(ptr) local_unnamed_addr #0 !dbg !15 {
+ %2 = alloca ptr, align 8
+ call void @llvm.dbg.value(metadata ptr %0, metadata !26, metadata !DIExpression()), !dbg !28
+ call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #4, !dbg !29
+ call void @llvm.dbg.value(metadata ptr null, metadata !27, metadata !DIExpression()), !dbg !28
+ store ptr null, ptr %2, align 8, !dbg !30, !tbaa !31
+ %3 = tail call ptr @llvm.preserve.struct.access.index.p0.net_devices.p0.sk_buffs(ptr elementtype(%struct.sk_buff) %0, i32 1, i32 1), !dbg !35, !llvm.preserve.access.index !19
+ %4 = call i32 inttoptr (i64 4 to ptr)(ptr nonnull %2, i32 8, ptr %3) #4, !dbg !36
+ %5 = load ptr, ptr %2, align 8, !dbg !37, !tbaa !31
+ call void @llvm.dbg.value(metadata ptr %5, metadata !27, metadata !DIExpression()), !dbg !28
+ %6 = icmp ne ptr %5, null, !dbg !38
+ %7 = zext i1 %6 to i32, !dbg !38
+ call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #4, !dbg !39
+ ret i32 %7, !dbg !40
}
; CHECK: .section .BTF,"", at progbits
@@ -124,13 +122,13 @@ define dso_local i32 @bpf_prog(%struct.sk_buff*) local_unnamed_addr #0 !dbg !15
; CHECK-NEXT: .long 0
; Function Attrs: argmemonly nounwind
-declare void @llvm.lifetime.start.p0i8(i64 immarg, i8* nocapture) #1
+declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nounwind readnone
-declare %struct.net_device** @llvm.preserve.struct.access.index.p0p0s_struct.net_devices.p0s_struct.sk_buffs(%struct.sk_buff*, i32 immarg, i32 immarg) #2
+declare ptr @llvm.preserve.struct.access.index.p0.net_devices.p0.sk_buffs(ptr, i32 immarg, i32 immarg) #2
; Function Attrs: argmemonly nounwind
-declare void @llvm.lifetime.end.p0i8(i64 immarg, i8* nocapture) #1
+declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nounwind readnone speculatable
declare void @llvm.dbg.value(metadata, metadata, metadata) #3
diff --git a/llvm/test/CodeGen/BPF/CORE/offset-reloc-cast-struct-1.ll b/llvm/test/CodeGen/BPF/CORE/offset-reloc-cast-struct-1.ll
index bf0730c4a74fc..bbff3f6695ea9 100644
--- a/llvm/test/CodeGen/BPF/CORE/offset-reloc-cast-struct-1.ll
+++ b/llvm/test/CodeGen/BPF/CORE/offset-reloc-cast-struct-1.ll
@@ -21,13 +21,12 @@ target triple = "bpf"
%struct.v1 = type { i32, i32 }
; Function Attrs: nounwind
-define dso_local i32 @test(%struct.v3* %arg) local_unnamed_addr #0 !dbg !14 {
+define dso_local i32 @test(ptr %arg) local_unnamed_addr #0 !dbg !14 {
entry:
- call void @llvm.dbg.value(metadata %struct.v3* %arg, metadata !28, metadata !DIExpression()), !dbg !29
- %0 = tail call %struct.v2* @llvm.preserve.struct.access.index.p0s_struct.v2s.p0s_struct.v3s(%struct.v3* elementtype(%struct.v3) %arg, i32 1, i32 1), !dbg !30, !llvm.preserve.access.index !18
- %1 = bitcast %struct.v2* %0 to %struct.v1*, !dbg !30
- %2 = tail call i32* @llvm.preserve.struct.access.index.p0i32.p0s_struct.v1s(%struct.v1* elementtype(%struct.v1) %1, i32 1, i32 1), !dbg !30, !llvm.preserve.access.index !5
- %call = tail call i32 @get_value(i32* %2) #4, !dbg !31
+ call void @llvm.dbg.value(metadata ptr %arg, metadata !28, metadata !DIExpression()), !dbg !29
+ %0 = tail call ptr @llvm.preserve.struct.access.index.p0.v2s.p0.v3s(ptr elementtype(%struct.v3) %arg, i32 1, i32 1), !dbg !30, !llvm.preserve.access.index !18
+ %1 = tail call ptr @llvm.preserve.struct.access.index.p0.p0.v1s(ptr elementtype(%struct.v1) %0, i32 1, i32 1), !dbg !30, !llvm.preserve.access.index !5
+ %call = tail call i32 @get_value(ptr %1) #4, !dbg !31
ret i32 %call, !dbg !32
}
@@ -61,13 +60,13 @@ entry:
; CHECK-NEXT: .long [[ACCESS_STR]]
; CHECK-NEXT: .long 0
-declare dso_local i32 @get_value(i32*) local_unnamed_addr #1
+declare dso_local i32 @get_value(ptr) local_unnamed_addr #1
; Function Attrs: nounwind readnone
-declare %struct.v2* @llvm.preserve.struct.access.index.p0s_struct.v2s.p0s_struct.v3s(%struct.v3*, i32, i32) #2
+declare ptr @llvm.preserve.struct.access.index.p0.v2s.p0.v3s(ptr, i32, i32) #2
; Function Attrs: nounwind readnone
-declare i32* @llvm.preserve.struct.access.index.p0i32.p0s_struct.v1s(%struct.v1*, i32, i32) #2
+declare ptr @llvm.preserve.struct.access.index.p0.p0.v1s(ptr, i32, i32) #2
; Function Attrs: nounwind readnone speculatable willreturn
declare void @llvm.dbg.value(metadata, metadata, metadata) #3
diff --git a/llvm/test/CodeGen/BPF/CORE/offset-reloc-cast-struct-2.ll b/llvm/test/CodeGen/BPF/CORE/offset-reloc-cast-struct-2.ll
index eb396cf89034b..bdc17e626ec30 100644
--- a/llvm/test/CodeGen/BPF/CORE/offset-reloc-cast-struct-2.ll
+++ b/llvm/test/CodeGen/BPF/CORE/offset-reloc-cast-struct-2.ll
@@ -24,13 +24,12 @@ target triple = "bpf"
%struct.v1 = type { i32, i32 }
; Function Attrs: nounwind
-define dso_local i32 @test(%struct.v3* %arg) local_unnamed_addr #0 !dbg !15 {
+define dso_local i32 @test(ptr %arg) local_unnamed_addr #0 !dbg !15 {
entry:
- call void @llvm.dbg.value(metadata %struct.v3* %arg, metadata !33, metadata !DIExpression()), !dbg !34
- %0 = tail call %struct.v2* @llvm.preserve.struct.access.index.p0s_struct.v2s.p0s_struct.v3s(%struct.v3* elementtype(%struct.v3) %arg, i32 1, i32 1), !dbg !35, !llvm.preserve.access.index !20
- %1 = bitcast %struct.v2* %0 to %struct.v1*, !dbg !35
- %2 = tail call i32* @llvm.preserve.struct.access.index.p0i32.p0s_struct.v1s(%struct.v1* elementtype(%struct.v1) %1, i32 1, i32 1), !dbg !35, !llvm.preserve.access.index !6
- %call = tail call i32 @get_value(i32* %2) #4, !dbg !36
+ call void @llvm.dbg.value(metadata ptr %arg, metadata !33, metadata !DIExpression()), !dbg !34
+ %0 = tail call ptr @llvm.preserve.struct.access.index.p0.v2s.p0.v3s(ptr elementtype(%struct.v3) %arg, i32 1, i32 1), !dbg !35, !llvm.preserve.access.index !20
+ %1 = tail call ptr @llvm.preserve.struct.access.index.p0.p0.v1s(ptr elementtype(%struct.v1) %0, i32 1, i32 1), !dbg !35, !llvm.preserve.access.index !6
+ %call = tail call i32 @get_value(ptr %1) #4, !dbg !36
ret i32 %call, !dbg !37
}
@@ -61,13 +60,13 @@ entry:
; CHECK-NEXT: .long 45
; CHECK-NEXT: .long 0
-declare dso_local i32 @get_value(i32*) local_unnamed_addr #1
+declare dso_local i32 @get_value(ptr) local_unnamed_addr #1
; Function Attrs: nounwind readnone
-declare %struct.v2* @llvm.preserve.struct.access.index.p0s_struct.v2s.p0s_struct.v3s(%struct.v3*, i32, i32) #2
+declare ptr @llvm.preserve.struct.access.index.p0.v2s.p0.v3s(ptr, i32, i32) #2
; Function Attrs: nounwind readnone
-declare i32* @llvm.preserve.struct.access.index.p0i32.p0s_struct.v1s(%struct.v1*, i32, i32) #2
+declare ptr @llvm.preserve.struct.access.index.p0.p0.v1s(ptr, i32, i32) #2
; Function Attrs: nounwind readnone speculatable willreturn
declare void @llvm.dbg.value(metadata, metadata, metadata) #3
diff --git a/llvm/test/CodeGen/BPF/CORE/offset-reloc-end-load.ll b/llvm/test/CodeGen/BPF/CORE/offset-reloc-end-load.ll
index 621f2e8519c80..7980c02bde428 100644
--- a/llvm/test/CodeGen/BPF/CORE/offset-reloc-end-load.ll
+++ b/llvm/test/CodeGen/BPF/CORE/offset-reloc-end-load.ll
@@ -14,11 +14,11 @@ target triple = "bpf"
%struct.s = type { i32, i32 }
; Function Attrs: nounwind readonly
-define dso_local i32 @test(%struct.s* readonly %arg) local_unnamed_addr #0 !dbg !11 {
+define dso_local i32 @test(ptr readonly %arg) local_unnamed_addr #0 !dbg !11 {
entry:
- call void @llvm.dbg.value(metadata %struct.s* %arg, metadata !20, metadata !DIExpression()), !dbg !21
- %0 = tail call i32* @llvm.preserve.struct.access.index.p0i32.p0s_struct.ss(%struct.s* elementtype(%struct.s) %arg, i32 1, i32 1), !dbg !22, !llvm.preserve.access.index !15
- %1 = load i32, i32* %0, align 4, !dbg !23, !tbaa !24
+ call void @llvm.dbg.value(metadata ptr %arg, metadata !20, metadata !DIExpression()), !dbg !21
+ %0 = tail call ptr @llvm.preserve.struct.access.index.p0.p0.ss(ptr elementtype(%struct.s) %arg, i32 1, i32 1), !dbg !22, !llvm.preserve.access.index !15
+ %1 = load i32, ptr %0, align 4, !dbg !23, !tbaa !24
ret i32 %1, !dbg !28
}
@@ -42,7 +42,7 @@ entry:
; CHECK-NEXT: .long 0
; Function Attrs: nounwind readnone
-declare i32* @llvm.preserve.struct.access.index.p0i32.p0s_struct.ss(%struct.s*, i32, i32) #1
+declare ptr @llvm.preserve.struct.access.index.p0.p0.ss(ptr, i32, i32) #1
; Function Attrs: nounwind readnone speculatable willreturn
declare void @llvm.dbg.value(metadata, metadata, metadata) #2
diff --git a/llvm/test/CodeGen/BPF/CORE/offset-reloc-end-ret.ll b/llvm/test/CodeGen/BPF/CORE/offset-reloc-end-ret.ll
index b2a1b2878e044..2aadbdfd3aafb 100644
--- a/llvm/test/CodeGen/BPF/CORE/offset-reloc-end-ret.ll
+++ b/llvm/test/CodeGen/BPF/CORE/offset-reloc-end-ret.ll
@@ -5,7 +5,7 @@
; Source Code:
; #define _(x) (__builtin_preserve_access_index(x))
; struct s {int a; int b;};
-; const void *test(struct s *arg) { return _(&arg->b); }
+; const ptr test(struct s *arg) { return _(&arg->b); }
; Compiler flag to generate IR:
; clang -target bpf -S -O2 -g -emit-llvm -Xclang -disable-llvm-passes test.c
@@ -14,12 +14,11 @@ target triple = "bpf"
%struct.s = type { i32, i32 }
; Function Attrs: nounwind readnone
-define dso_local i8* @test(%struct.s* readnone %arg) local_unnamed_addr #0 !dbg !7 {
+define dso_local ptr @test(ptr readnone %arg) local_unnamed_addr #0 !dbg !7 {
entry:
- call void @llvm.dbg.value(metadata %struct.s* %arg, metadata !19, metadata !DIExpression()), !dbg !20
- %0 = tail call i32* @llvm.preserve.struct.access.index.p0i32.p0s_struct.ss(%struct.s* elementtype(%struct.s) %arg, i32 1, i32 1), !dbg !21, !llvm.preserve.access.index !13
- %1 = bitcast i32* %0 to i8*, !dbg !21
- ret i8* %1, !dbg !22
+ call void @llvm.dbg.value(metadata ptr %arg, metadata !19, metadata !DIExpression()), !dbg !20
+ %0 = tail call ptr @llvm.preserve.struct.access.index.p0.p0.ss(ptr elementtype(%struct.s) %arg, i32 1, i32 1), !dbg !21, !llvm.preserve.access.index !13
+ ret ptr %0, !dbg !22
}
; CHECK-LABEL: test
@@ -43,7 +42,7 @@ entry:
; CHECK-NEXT: .long 0
; Function Attrs: nounwind readnone
-declare i32* @llvm.preserve.struct.access.index.p0i32.p0s_struct.ss(%struct.s*, i32, i32) #1
+declare ptr @llvm.preserve.struct.access.index.p0.p0.ss(ptr, i32, i32) #1
; Function Attrs: nounwind readnone speculatable willreturn
declare void @llvm.dbg.value(metadata, metadata, metadata) #2
diff --git a/llvm/test/CodeGen/BPF/CORE/offset-reloc-fieldinfo-1.ll b/llvm/test/CodeGen/BPF/CORE/offset-reloc-fieldinfo-1.ll
index 506f9edc5c768..a0febc3a98a76 100644
--- a/llvm/test/CodeGen/BPF/CORE/offset-reloc-fieldinfo-1.ll
+++ b/llvm/test/CodeGen/BPF/CORE/offset-reloc-fieldinfo-1.ll
@@ -15,14 +15,14 @@
; FIELD_LSHIFT_U64,
; FIELD_RSHIFT_U64,
; };
-; void bpf_probe_read(void *, unsigned, const void *);
+; void bpf_probe_read(ptr, unsigned, const ptr);
; int field_read(struct s *arg) {
; unsigned long long ull;
; unsigned offset = __builtin_preserve_field_info(arg->b2, FIELD_BYTE_OFFSET);
; unsigned size = __builtin_preserve_field_info(arg->b2, FIELD_BYTE_SIZE);
; unsigned lshift;
;
-; bpf_probe_read(&ull, size, (const void *)arg + offset);
+; bpf_probe_read(&ull, size, (const ptr)arg + offset);
; lshift = __builtin_preserve_field_info(arg->b2, FIELD_LSHIFT_U64);
; #if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
; lshift = lshift + (size << 3) - 64;
@@ -40,37 +40,35 @@ target triple = "bpfel"
%struct.s = type { i32, i16 }
; Function Attrs: nounwind
-define dso_local i32 @field_read(%struct.s* %arg) local_unnamed_addr #0 !dbg !20 {
+define dso_local i32 @field_read(ptr %arg) local_unnamed_addr #0 !dbg !20 {
entry:
%ull = alloca i64, align 8
- call void @llvm.dbg.value(metadata %struct.s* %arg, metadata !31, metadata !DIExpression()), !dbg !37
- %0 = bitcast i64* %ull to i8*, !dbg !38
- call void @llvm.lifetime.start.p0i8(i64 8, i8* nonnull %0) #5, !dbg !38
- %1 = tail call i16* @llvm.preserve.struct.access.index.p0i16.p0s_struct.ss(%struct.s* elementtype(%struct.s) %arg, i32 1, i32 2), !dbg !39, !llvm.preserve.access.index !25
- %2 = tail call i32 @llvm.bpf.preserve.field.info.p0i16(i16* %1, i64 0), !dbg !40
- call void @llvm.dbg.value(metadata i32 %2, metadata !34, metadata !DIExpression()), !dbg !37
- %3 = tail call i32 @llvm.bpf.preserve.field.info.p0i16(i16* %1, i64 1), !dbg !41
- call void @llvm.dbg.value(metadata i32 %3, metadata !35, metadata !DIExpression()), !dbg !37
- %4 = bitcast %struct.s* %arg to i8*, !dbg !42
- %idx.ext = zext i32 %2 to i64, !dbg !43
- %add.ptr = getelementptr i8, i8* %4, i64 %idx.ext, !dbg !43
- call void @bpf_probe_read(i8* nonnull %0, i32 %3, i8* %add.ptr) #5, !dbg !44
- %5 = call i32 @llvm.bpf.preserve.field.info.p0i16(i16* %1, i64 4), !dbg !45
- call void @llvm.dbg.value(metadata i32 %5, metadata !36, metadata !DIExpression()), !dbg !37
- %6 = load i64, i64* %ull, align 8, !dbg !46, !tbaa !47
- call void @llvm.dbg.value(metadata i64 %6, metadata !32, metadata !DIExpression()), !dbg !37
- %sh_prom = zext i32 %5 to i64, !dbg !46
- %shl = shl i64 %6, %sh_prom, !dbg !46
+ call void @llvm.dbg.value(metadata ptr %arg, metadata !31, metadata !DIExpression()), !dbg !37
+ call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %ull) #5, !dbg !38
+ %0 = tail call ptr @llvm.preserve.struct.access.index.p0.p0.ss(ptr elementtype(%struct.s) %arg, i32 1, i32 2), !dbg !39, !llvm.preserve.access.index !25
+ %1 = tail call i32 @llvm.bpf.preserve.field.info.p0(ptr %0, i64 0), !dbg !40
+ call void @llvm.dbg.value(metadata i32 %1, metadata !34, metadata !DIExpression()), !dbg !37
+ %2 = tail call i32 @llvm.bpf.preserve.field.info.p0(ptr %0, i64 1), !dbg !41
+ call void @llvm.dbg.value(metadata i32 %2, metadata !35, metadata !DIExpression()), !dbg !37
+ %idx.ext = zext i32 %1 to i64, !dbg !43
+ %add.ptr = getelementptr i8, ptr %arg, i64 %idx.ext, !dbg !43
+ call void @bpf_probe_read(ptr nonnull %ull, i32 %2, ptr %add.ptr) #5, !dbg !44
+ %3 = call i32 @llvm.bpf.preserve.field.info.p0(ptr %0, i64 4), !dbg !45
+ call void @llvm.dbg.value(metadata i32 %3, metadata !36, metadata !DIExpression()), !dbg !37
+ %4 = load i64, ptr %ull, align 8, !dbg !46, !tbaa !47
+ call void @llvm.dbg.value(metadata i64 %4, metadata !32, metadata !DIExpression()), !dbg !37
+ %sh_prom = zext i32 %3 to i64, !dbg !46
+ %shl = shl i64 %4, %sh_prom, !dbg !46
call void @llvm.dbg.value(metadata i64 %shl, metadata !32, metadata !DIExpression()), !dbg !37
- %7 = call i32 @llvm.bpf.preserve.field.info.p0i16(i16* %1, i64 3), !dbg !51
- %tobool = icmp eq i32 %7, 0, !dbg !51
- %8 = call i32 @llvm.bpf.preserve.field.info.p0i16(i16* %1, i64 5), !dbg !37
- %sh_prom1 = zext i32 %8 to i64, !dbg !37
+ %5 = call i32 @llvm.bpf.preserve.field.info.p0(ptr %0, i64 3), !dbg !51
+ %tobool = icmp eq i32 %5, 0, !dbg !51
+ %6 = call i32 @llvm.bpf.preserve.field.info.p0(ptr %0, i64 5), !dbg !37
+ %sh_prom1 = zext i32 %6 to i64, !dbg !37
%shr = ashr i64 %shl, %sh_prom1, !dbg !53
%shr3 = lshr i64 %shl, %sh_prom1, !dbg !53
%retval.0.in = select i1 %tobool, i64 %shr3, i64 %shr, !dbg !53
%retval.0 = trunc i64 %retval.0.in to i32, !dbg !37
- call void @llvm.lifetime.end.p0i8(i64 8, i8* nonnull %0) #5, !dbg !54
+ call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %ull) #5, !dbg !54
ret i32 %retval.0, !dbg !54
}
@@ -116,18 +114,18 @@ entry:
; CHECK-NEXT: .long 3
; Function Attrs: argmemonly nounwind willreturn
-declare void @llvm.lifetime.start.p0i8(i64, i8* nocapture) #1
+declare void @llvm.lifetime.start.p0(i64, ptr nocapture) #1
; Function Attrs: nounwind readnone
-declare i16* @llvm.preserve.struct.access.index.p0i16.p0s_struct.ss(%struct.s*, i32, i32) #2
+declare ptr @llvm.preserve.struct.access.index.p0.p0.ss(ptr, i32, i32) #2
; Function Attrs: nounwind readnone
-declare i32 @llvm.bpf.preserve.field.info.p0i16(i16*, i64) #2
+declare i32 @llvm.bpf.preserve.field.info.p0(ptr, i64) #2
-declare dso_local void @bpf_probe_read(i8*, i32, i8*) local_unnamed_addr #3
+declare dso_local void @bpf_probe_read(ptr, i32, ptr) local_unnamed_addr #3
; Function Attrs: argmemonly nounwind willreturn
-declare void @llvm.lifetime.end.p0i8(i64, i8* nocapture) #1
+declare void @llvm.lifetime.end.p0(i64, ptr nocapture) #1
; Function Attrs: nounwind readnone speculatable willreturn
declare void @llvm.dbg.value(metadata, metadata, metadata) #4
diff --git a/llvm/test/CodeGen/BPF/CORE/offset-reloc-fieldinfo-2-bpfeb.ll b/llvm/test/CodeGen/BPF/CORE/offset-reloc-fieldinfo-2-bpfeb.ll
index 4cd2b5361f970..6fdf985aec641 100644
--- a/llvm/test/CodeGen/BPF/CORE/offset-reloc-fieldinfo-2-bpfeb.ll
+++ b/llvm/test/CodeGen/BPF/CORE/offset-reloc-fieldinfo-2-bpfeb.ll
@@ -21,13 +21,13 @@
; unsigned size = __builtin_preserve_field_info(arg->b2, FIELD_BYTE_SIZE);
; switch(size) {
; case 1:
-; ull = *(unsigned char *)((void *)arg + offset); break;
+; ull = *(unsigned char *)((ptr)arg + offset); break;
; case 2:
-; ull = *(unsigned short *)((void *)arg + offset); break;
+; ull = *(unsigned short *)((ptr)arg + offset); break;
; case 4:
-; ull = *(unsigned int *)((void *)arg + offset); break;
+; ull = *(unsigned int *)((ptr)arg + offset); break;
; case 8:
-; ull = *(unsigned long long *)((void *)arg + offset); break;
+; ull = *(unsigned long long *)((ptr)arg + offset); break;
; }
; ull <<= __builtin_preserve_field_info(arg->b2, FIELD_LSHIFT_U64);
; if (__builtin_preserve_field_info(arg->b2, FIELD_SIGNEDNESS))
@@ -42,13 +42,13 @@ target triple = "bpfeb"
%struct.s = type { i32, i16 }
; Function Attrs: nounwind readonly
-define dso_local i32 @field_read(%struct.s* %arg) local_unnamed_addr #0 !dbg !26 {
+define dso_local i32 @field_read(ptr %arg) local_unnamed_addr #0 !dbg !26 {
entry:
- call void @llvm.dbg.value(metadata %struct.s* %arg, metadata !37, metadata !DIExpression()), !dbg !41
- %0 = tail call i16* @llvm.preserve.struct.access.index.p0i16.p0s_struct.ss(%struct.s* elementtype(%struct.s) %arg, i32 1, i32 2), !dbg !42, !llvm.preserve.access.index !31
- %1 = tail call i32 @llvm.bpf.preserve.field.info.p0i16(i16* %0, i64 0), !dbg !43
+ call void @llvm.dbg.value(metadata ptr %arg, metadata !37, metadata !DIExpression()), !dbg !41
+ %0 = tail call ptr @llvm.preserve.struct.access.index.p0.p0.ss(ptr elementtype(%struct.s) %arg, i32 1, i32 2), !dbg !42, !llvm.preserve.access.index !31
+ %1 = tail call i32 @llvm.bpf.preserve.field.info.p0(ptr %0, i64 0), !dbg !43
call void @llvm.dbg.value(metadata i32 %1, metadata !39, metadata !DIExpression()), !dbg !41
- %2 = tail call i32 @llvm.bpf.preserve.field.info.p0i16(i16* %0, i64 1), !dbg !44
+ %2 = tail call i32 @llvm.bpf.preserve.field.info.p0(ptr %0, i64 1), !dbg !44
call void @llvm.dbg.value(metadata i32 %2, metadata !40, metadata !DIExpression()), !dbg !41
switch i32 %2, label %sw.epilog [
i32 1, label %sw.bb
@@ -58,54 +58,47 @@ entry:
], !dbg !45
sw.bb: ; preds = %entry
- %3 = bitcast %struct.s* %arg to i8*, !dbg !46
%idx.ext = zext i32 %1 to i64, !dbg !48
- %add.ptr = getelementptr i8, i8* %3, i64 %idx.ext, !dbg !48
- %4 = load i8, i8* %add.ptr, align 1, !dbg !49, !tbaa !50
- %conv = zext i8 %4 to i64, !dbg !49
+ %add.ptr = getelementptr i8, ptr %arg, i64 %idx.ext, !dbg !48
+ %3 = load i8, ptr %add.ptr, align 1, !dbg !49, !tbaa !50
+ %conv = zext i8 %3 to i64, !dbg !49
call void @llvm.dbg.value(metadata i64 %conv, metadata !38, metadata !DIExpression()), !dbg !41
br label %sw.epilog, !dbg !53
sw.bb1: ; preds = %entry
- %5 = bitcast %struct.s* %arg to i8*, !dbg !54
%idx.ext2 = zext i32 %1 to i64, !dbg !55
- %add.ptr3 = getelementptr i8, i8* %5, i64 %idx.ext2, !dbg !55
- %6 = bitcast i8* %add.ptr3 to i16*, !dbg !56
- %7 = load i16, i16* %6, align 2, !dbg !57, !tbaa !58
- %conv4 = zext i16 %7 to i64, !dbg !57
+ %add.ptr3 = getelementptr i8, ptr %arg, i64 %idx.ext2, !dbg !55
+ %4 = load i16, ptr %add.ptr3, align 2, !dbg !57, !tbaa !58
+ %conv4 = zext i16 %4 to i64, !dbg !57
call void @llvm.dbg.value(metadata i64 %conv4, metadata !38, metadata !DIExpression()), !dbg !41
br label %sw.epilog, !dbg !60
sw.bb5: ; preds = %entry
- %8 = bitcast %struct.s* %arg to i8*, !dbg !61
%idx.ext6 = zext i32 %1 to i64, !dbg !62
- %add.ptr7 = getelementptr i8, i8* %8, i64 %idx.ext6, !dbg !62
- %9 = bitcast i8* %add.ptr7 to i32*, !dbg !63
- %10 = load i32, i32* %9, align 4, !dbg !64, !tbaa !65
- %conv8 = zext i32 %10 to i64, !dbg !64
+ %add.ptr7 = getelementptr i8, ptr %arg, i64 %idx.ext6, !dbg !62
+ %5 = load i32, ptr %add.ptr7, align 4, !dbg !64, !tbaa !65
+ %conv8 = zext i32 %5 to i64, !dbg !64
call void @llvm.dbg.value(metadata i64 %conv8, metadata !38, metadata !DIExpression()), !dbg !41
br label %sw.epilog, !dbg !67
sw.bb9: ; preds = %entry
- %11 = bitcast %struct.s* %arg to i8*, !dbg !68
%idx.ext10 = zext i32 %1 to i64, !dbg !69
- %add.ptr11 = getelementptr i8, i8* %11, i64 %idx.ext10, !dbg !69
- %12 = bitcast i8* %add.ptr11 to i64*, !dbg !70
- %13 = load i64, i64* %12, align 8, !dbg !71, !tbaa !72
- call void @llvm.dbg.value(metadata i64 %13, metadata !38, metadata !DIExpression()), !dbg !41
+ %add.ptr11 = getelementptr i8, ptr %arg, i64 %idx.ext10, !dbg !69
+ %6 = load i64, ptr %add.ptr11, align 8, !dbg !71, !tbaa !72
+ call void @llvm.dbg.value(metadata i64 %6, metadata !38, metadata !DIExpression()), !dbg !41
br label %sw.epilog, !dbg !74
sw.epilog: ; preds = %entry, %sw.bb9, %sw.bb5, %sw.bb1, %sw.bb
- %ull.0 = phi i64 [ undef, %entry ], [ %13, %sw.bb9 ], [ %conv8, %sw.bb5 ], [ %conv4, %sw.bb1 ], [ %conv, %sw.bb ]
+ %ull.0 = phi i64 [ undef, %entry ], [ %6, %sw.bb9 ], [ %conv8, %sw.bb5 ], [ %conv4, %sw.bb1 ], [ %conv, %sw.bb ]
call void @llvm.dbg.value(metadata i64 %ull.0, metadata !38, metadata !DIExpression()), !dbg !41
- %14 = tail call i32 @llvm.bpf.preserve.field.info.p0i16(i16* %0, i64 4), !dbg !75
- %sh_prom = zext i32 %14 to i64, !dbg !76
+ %7 = tail call i32 @llvm.bpf.preserve.field.info.p0(ptr %0, i64 4), !dbg !75
+ %sh_prom = zext i32 %7 to i64, !dbg !76
%shl = shl i64 %ull.0, %sh_prom, !dbg !76
call void @llvm.dbg.value(metadata i64 %shl, metadata !38, metadata !DIExpression()), !dbg !41
- %15 = tail call i32 @llvm.bpf.preserve.field.info.p0i16(i16* %0, i64 3), !dbg !77
- %tobool = icmp eq i32 %15, 0, !dbg !77
- %16 = tail call i32 @llvm.bpf.preserve.field.info.p0i16(i16* %0, i64 5), !dbg !41
- %sh_prom12 = zext i32 %16 to i64, !dbg !41
+ %8 = tail call i32 @llvm.bpf.preserve.field.info.p0(ptr %0, i64 3), !dbg !77
+ %tobool = icmp eq i32 %8, 0, !dbg !77
+ %9 = tail call i32 @llvm.bpf.preserve.field.info.p0(ptr %0, i64 5), !dbg !41
+ %sh_prom12 = zext i32 %9 to i64, !dbg !41
%shr = ashr i64 %shl, %sh_prom12, !dbg !79
%shr15 = lshr i64 %shl, %sh_prom12, !dbg !79
%retval.0.in = select i1 %tobool, i64 %shr15, i64 %shr, !dbg !79
@@ -164,10 +157,10 @@ sw.epilog: ; preds = %entry, %sw.bb9, %sw
; CHECK-NEXT: .long 3
; Function Attrs: nounwind readnone
-declare i16* @llvm.preserve.struct.access.index.p0i16.p0s_struct.ss(%struct.s*, i32, i32) #1
+declare ptr @llvm.preserve.struct.access.index.p0.p0.ss(ptr, i32, i32) #1
; Function Attrs: nounwind readnone
-declare i32 @llvm.bpf.preserve.field.info.p0i16(i16*, i64) #1
+declare i32 @llvm.bpf.preserve.field.info.p0(ptr, i64) #1
; Function Attrs: nounwind readnone speculatable willreturn
declare void @llvm.dbg.value(metadata, metadata, metadata) #2
diff --git a/llvm/test/CodeGen/BPF/CORE/offset-reloc-fieldinfo-2.ll b/llvm/test/CodeGen/BPF/CORE/offset-reloc-fieldinfo-2.ll
index 81a372ec53547..5cbafa15d643b 100644
--- a/llvm/test/CodeGen/BPF/CORE/offset-reloc-fieldinfo-2.ll
+++ b/llvm/test/CodeGen/BPF/CORE/offset-reloc-fieldinfo-2.ll
@@ -21,13 +21,13 @@
; unsigned size = __builtin_preserve_field_info(arg->b2, FIELD_BYTE_SIZE);
; switch(size) {
; case 1:
-; ull = *(unsigned char *)((void *)arg + offset); break;
+; ull = *(unsigned char *)((ptr)arg + offset); break;
; case 2:
-; ull = *(unsigned short *)((void *)arg + offset); break;
+; ull = *(unsigned short *)((ptr)arg + offset); break;
; case 4:
-; ull = *(unsigned int *)((void *)arg + offset); break;
+; ull = *(unsigned int *)((ptr)arg + offset); break;
; case 8:
-; ull = *(unsigned long long *)((void *)arg + offset); break;
+; ull = *(unsigned long long *)((ptr)arg + offset); break;
; }
; ull <<= __builtin_preserve_field_info(arg->b2, FIELD_LSHIFT_U64);
; if (__builtin_preserve_field_info(arg->b2, FIELD_SIGNEDNESS))
@@ -42,13 +42,13 @@ target triple = "bpfel"
%struct.s = type { i32, i16 }
; Function Attrs: nounwind readonly
-define dso_local i32 @field_read(%struct.s* %arg) local_unnamed_addr #0 !dbg !26 {
+define dso_local i32 @field_read(ptr %arg) local_unnamed_addr #0 !dbg !26 {
entry:
- call void @llvm.dbg.value(metadata %struct.s* %arg, metadata !37, metadata !DIExpression()), !dbg !41
- %0 = tail call i16* @llvm.preserve.struct.access.index.p0i16.p0s_struct.ss(%struct.s* elementtype(%struct.s) %arg, i32 1, i32 2), !dbg !42, !llvm.preserve.access.index !31
- %1 = tail call i32 @llvm.bpf.preserve.field.info.p0i16(i16* %0, i64 0), !dbg !43
+ call void @llvm.dbg.value(metadata ptr %arg, metadata !37, metadata !DIExpression()), !dbg !41
+ %0 = tail call ptr @llvm.preserve.struct.access.index.p0.p0.ss(ptr elementtype(%struct.s) %arg, i32 1, i32 2), !dbg !42, !llvm.preserve.access.index !31
+ %1 = tail call i32 @llvm.bpf.preserve.field.info.p0(ptr %0, i64 0), !dbg !43
call void @llvm.dbg.value(metadata i32 %1, metadata !39, metadata !DIExpression()), !dbg !41
- %2 = tail call i32 @llvm.bpf.preserve.field.info.p0i16(i16* %0, i64 1), !dbg !44
+ %2 = tail call i32 @llvm.bpf.preserve.field.info.p0(ptr %0, i64 1), !dbg !44
call void @llvm.dbg.value(metadata i32 %2, metadata !40, metadata !DIExpression()), !dbg !41
switch i32 %2, label %sw.epilog [
i32 1, label %sw.bb
@@ -58,54 +58,47 @@ entry:
], !dbg !45
sw.bb: ; preds = %entry
- %3 = bitcast %struct.s* %arg to i8*, !dbg !46
%idx.ext = zext i32 %1 to i64, !dbg !48
- %add.ptr = getelementptr i8, i8* %3, i64 %idx.ext, !dbg !48
- %4 = load i8, i8* %add.ptr, align 1, !dbg !49, !tbaa !50
- %conv = zext i8 %4 to i64, !dbg !49
+ %add.ptr = getelementptr i8, ptr %arg, i64 %idx.ext, !dbg !48
+ %3 = load i8, ptr %add.ptr, align 1, !dbg !49, !tbaa !50
+ %conv = zext i8 %3 to i64, !dbg !49
call void @llvm.dbg.value(metadata i64 %conv, metadata !38, metadata !DIExpression()), !dbg !41
br label %sw.epilog, !dbg !53
sw.bb1: ; preds = %entry
- %5 = bitcast %struct.s* %arg to i8*, !dbg !54
%idx.ext2 = zext i32 %1 to i64, !dbg !55
- %add.ptr3 = getelementptr i8, i8* %5, i64 %idx.ext2, !dbg !55
- %6 = bitcast i8* %add.ptr3 to i16*, !dbg !56
- %7 = load i16, i16* %6, align 2, !dbg !57, !tbaa !58
- %conv4 = zext i16 %7 to i64, !dbg !57
+ %add.ptr3 = getelementptr i8, ptr %arg, i64 %idx.ext2, !dbg !55
+ %4 = load i16, ptr %add.ptr3, align 2, !dbg !57, !tbaa !58
+ %conv4 = zext i16 %4 to i64, !dbg !57
call void @llvm.dbg.value(metadata i64 %conv4, metadata !38, metadata !DIExpression()), !dbg !41
br label %sw.epilog, !dbg !60
sw.bb5: ; preds = %entry
- %8 = bitcast %struct.s* %arg to i8*, !dbg !61
%idx.ext6 = zext i32 %1 to i64, !dbg !62
- %add.ptr7 = getelementptr i8, i8* %8, i64 %idx.ext6, !dbg !62
- %9 = bitcast i8* %add.ptr7 to i32*, !dbg !63
- %10 = load i32, i32* %9, align 4, !dbg !64, !tbaa !65
- %conv8 = zext i32 %10 to i64, !dbg !64
+ %add.ptr7 = getelementptr i8, ptr %arg, i64 %idx.ext6, !dbg !62
+ %5 = load i32, ptr %add.ptr7, align 4, !dbg !64, !tbaa !65
+ %conv8 = zext i32 %5 to i64, !dbg !64
call void @llvm.dbg.value(metadata i64 %conv8, metadata !38, metadata !DIExpression()), !dbg !41
br label %sw.epilog, !dbg !67
sw.bb9: ; preds = %entry
- %11 = bitcast %struct.s* %arg to i8*, !dbg !68
%idx.ext10 = zext i32 %1 to i64, !dbg !69
- %add.ptr11 = getelementptr i8, i8* %11, i64 %idx.ext10, !dbg !69
- %12 = bitcast i8* %add.ptr11 to i64*, !dbg !70
- %13 = load i64, i64* %12, align 8, !dbg !71, !tbaa !72
- call void @llvm.dbg.value(metadata i64 %13, metadata !38, metadata !DIExpression()), !dbg !41
+ %add.ptr11 = getelementptr i8, ptr %arg, i64 %idx.ext10, !dbg !69
+ %6 = load i64, ptr %add.ptr11, align 8, !dbg !71, !tbaa !72
+ call void @llvm.dbg.value(metadata i64 %6, metadata !38, metadata !DIExpression()), !dbg !41
br label %sw.epilog, !dbg !74
sw.epilog: ; preds = %entry, %sw.bb9, %sw.bb5, %sw.bb1, %sw.bb
- %ull.0 = phi i64 [ undef, %entry ], [ %13, %sw.bb9 ], [ %conv8, %sw.bb5 ], [ %conv4, %sw.bb1 ], [ %conv, %sw.bb ]
+ %ull.0 = phi i64 [ undef, %entry ], [ %6, %sw.bb9 ], [ %conv8, %sw.bb5 ], [ %conv4, %sw.bb1 ], [ %conv, %sw.bb ]
call void @llvm.dbg.value(metadata i64 %ull.0, metadata !38, metadata !DIExpression()), !dbg !41
- %14 = tail call i32 @llvm.bpf.preserve.field.info.p0i16(i16* %0, i64 4), !dbg !75
- %sh_prom = zext i32 %14 to i64, !dbg !76
+ %7 = tail call i32 @llvm.bpf.preserve.field.info.p0(ptr %0, i64 4), !dbg !75
+ %sh_prom = zext i32 %7 to i64, !dbg !76
%shl = shl i64 %ull.0, %sh_prom, !dbg !76
call void @llvm.dbg.value(metadata i64 %shl, metadata !38, metadata !DIExpression()), !dbg !41
- %15 = tail call i32 @llvm.bpf.preserve.field.info.p0i16(i16* %0, i64 3), !dbg !77
- %tobool = icmp eq i32 %15, 0, !dbg !77
- %16 = tail call i32 @llvm.bpf.preserve.field.info.p0i16(i16* %0, i64 5), !dbg !41
- %sh_prom12 = zext i32 %16 to i64, !dbg !41
+ %8 = tail call i32 @llvm.bpf.preserve.field.info.p0(ptr %0, i64 3), !dbg !77
+ %tobool = icmp eq i32 %8, 0, !dbg !77
+ %9 = tail call i32 @llvm.bpf.preserve.field.info.p0(ptr %0, i64 5), !dbg !41
+ %sh_prom12 = zext i32 %9 to i64, !dbg !41
%shr = ashr i64 %shl, %sh_prom12, !dbg !79
%shr15 = lshr i64 %shl, %sh_prom12, !dbg !79
%retval.0.in = select i1 %tobool, i64 %shr15, i64 %shr, !dbg !79
@@ -164,10 +157,10 @@ sw.epilog: ; preds = %entry, %sw.bb9, %sw
; CHECK-NEXT: .long 3
; Function Attrs: nounwind readnone
-declare i16* @llvm.preserve.struct.access.index.p0i16.p0s_struct.ss(%struct.s*, i32, i32) #1
+declare ptr @llvm.preserve.struct.access.index.p0.p0.ss(ptr, i32, i32) #1
; Function Attrs: nounwind readnone
-declare i32 @llvm.bpf.preserve.field.info.p0i16(i16*, i64) #1
+declare i32 @llvm.bpf.preserve.field.info.p0(ptr, i64) #1
; Function Attrs: nounwind readnone speculatable willreturn
declare void @llvm.dbg.value(metadata, metadata, metadata) #2
diff --git a/llvm/test/CodeGen/BPF/CORE/offset-reloc-global-1.ll b/llvm/test/CodeGen/BPF/CORE/offset-reloc-global-1.ll
index 1a39e64e014f2..7657b7897bb25 100644
--- a/llvm/test/CodeGen/BPF/CORE/offset-reloc-global-1.ll
+++ b/llvm/test/CodeGen/BPF/CORE/offset-reloc-global-1.ll
@@ -21,8 +21,8 @@ target triple = "bpf"
; Function Attrs: nounwind
define dso_local i32 @test() local_unnamed_addr #0 !dbg !16 {
entry:
- %0 = tail call i32* @llvm.preserve.struct.access.index.p0i32.p0s_struct.v3s(%struct.v3* elementtype(%struct.v3) nonnull @g, i32 1, i32 1), !dbg !19, !llvm.preserve.access.index !7
- %call = tail call i32 @get_value(i32* %0) #3, !dbg !20
+ %0 = tail call ptr @llvm.preserve.struct.access.index.p0.p0.v3s(ptr elementtype(%struct.v3) nonnull @g, i32 1, i32 1), !dbg !19, !llvm.preserve.access.index !7
+ %call = tail call i32 @get_value(ptr %0) #3, !dbg !20
ret i32 %call, !dbg !21
}
@@ -45,10 +45,10 @@ entry:
; CHECK-NEXT: .long 23
; CHECK-NEXT: .long 0
-declare dso_local i32 @get_value(i32*) local_unnamed_addr #1
+declare dso_local i32 @get_value(ptr) local_unnamed_addr #1
; Function Attrs: nounwind readnone
-declare i32* @llvm.preserve.struct.access.index.p0i32.p0s_struct.v3s(%struct.v3*, i32, i32) #2
+declare ptr @llvm.preserve.struct.access.index.p0.p0.v3s(ptr, i32, i32) #2
attributes #0 = { nounwind "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "frame-pointer"="all" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
attributes #1 = { "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "frame-pointer"="all" "less-precise-fpmad"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
diff --git a/llvm/test/CodeGen/BPF/CORE/offset-reloc-global-2.ll b/llvm/test/CodeGen/BPF/CORE/offset-reloc-global-2.ll
index 450eb915d5e12..bed14ab4ea15d 100644
--- a/llvm/test/CodeGen/BPF/CORE/offset-reloc-global-2.ll
+++ b/llvm/test/CodeGen/BPF/CORE/offset-reloc-global-2.ll
@@ -21,10 +21,10 @@ target triple = "bpf"
; Function Attrs: nounwind
define dso_local i32 @test() local_unnamed_addr #0 !dbg !23 {
entry:
- %0 = tail call [5 x %struct.v3]* @llvm.preserve.array.access.index.p0a5s_struct.v3s.p0a4a5s_struct.v3s([4 x [5 x %struct.v3]]* elementtype([4 x [5 x %struct.v3]]) nonnull @g, i32 1, i32 1), !dbg !26, !llvm.preserve.access.index !6
- %1 = tail call %struct.v3* @llvm.preserve.array.access.index.p0s_struct.v3s.p0a5s_struct.v3s([5 x %struct.v3]* elementtype([5 x %struct.v3]) %0, i32 1, i32 2), !dbg !26, !llvm.preserve.access.index !16
- %2 = tail call i32* @llvm.preserve.struct.access.index.p0i32.p0s_struct.v3s(%struct.v3* elementtype(%struct.v3) %1, i32 1, i32 1), !dbg !26, !llvm.preserve.access.index !8
- %call = tail call i32 @get_value(i32* %2) #3, !dbg !27
+ %0 = tail call ptr @llvm.preserve.array.access.index.p0.v3s.p0.v3s(ptr elementtype([4 x [5 x %struct.v3]]) nonnull @g, i32 1, i32 1), !dbg !26, !llvm.preserve.access.index !6
+ %1 = tail call ptr @llvm.preserve.array.access.index.p0.v3s.p0.v3s(ptr elementtype([5 x %struct.v3]) %0, i32 1, i32 2), !dbg !26, !llvm.preserve.access.index !16
+ %2 = tail call ptr @llvm.preserve.struct.access.index.p0.p0.v3s(ptr elementtype(%struct.v3) %1, i32 1, i32 1), !dbg !26, !llvm.preserve.access.index !8
+ %call = tail call i32 @get_value(ptr %2) #3, !dbg !27
ret i32 %call, !dbg !28
}
@@ -48,16 +48,15 @@ entry:
; CHECK-NEXT: .long 0
-declare dso_local i32 @get_value(i32*) local_unnamed_addr #1
+declare dso_local i32 @get_value(ptr) local_unnamed_addr #1
; Function Attrs: nounwind readnone
-declare [5 x %struct.v3]* @llvm.preserve.array.access.index.p0a5s_struct.v3s.p0a4a5s_struct.v3s([4 x [5 x %struct.v3]]*, i32, i32) #2
+declare ptr @llvm.preserve.array.access.index.p0.v3s.p0.v3s(ptr, i32, i32) #2
; Function Attrs: nounwind readnone
-declare %struct.v3* @llvm.preserve.array.access.index.p0s_struct.v3s.p0a5s_struct.v3s([5 x %struct.v3]*, i32, i32) #2
; Function Attrs: nounwind readnone
-declare i32* @llvm.preserve.struct.access.index.p0i32.p0s_struct.v3s(%struct.v3*, i32, i32) #2
+declare ptr @llvm.preserve.struct.access.index.p0.p0.v3s(ptr, i32, i32) #2
attributes #0 = { nounwind "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "frame-pointer"="all" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
attributes #1 = { "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "frame-pointer"="all" "less-precise-fpmad"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
diff --git a/llvm/test/CodeGen/BPF/CORE/offset-reloc-global-3.ll b/llvm/test/CodeGen/BPF/CORE/offset-reloc-global-3.ll
index 80b01a7bfdf36..49b89e2e49277 100644
--- a/llvm/test/CodeGen/BPF/CORE/offset-reloc-global-3.ll
+++ b/llvm/test/CodeGen/BPF/CORE/offset-reloc-global-3.ll
@@ -16,14 +16,14 @@ target triple = "bpf"
%struct.v3 = type { i32, i32 }
- at g = dso_local local_unnamed_addr global %struct.v3* null, section "stats", align 8, !dbg !0
+ at g = dso_local local_unnamed_addr global ptr null, section "stats", align 8, !dbg !0
; Function Attrs: nounwind
define dso_local i32 @test() local_unnamed_addr #0 !dbg !17 {
entry:
- %0 = load %struct.v3*, %struct.v3** @g, align 8, !dbg !20, !tbaa !21
- %1 = tail call i32* @llvm.preserve.struct.access.index.p0i32.p0s_struct.v3s(%struct.v3* elementtype(%struct.v3) %0, i32 1, i32 1), !dbg !20, !llvm.preserve.access.index !8
- %call = tail call i32 @get_value(i32* %1) #3, !dbg !25
+ %0 = load ptr, ptr @g, align 8, !dbg !20, !tbaa !21
+ %1 = tail call ptr @llvm.preserve.struct.access.index.p0.p0.v3s(ptr elementtype(%struct.v3) %0, i32 1, i32 1), !dbg !20, !llvm.preserve.access.index !8
+ %call = tail call i32 @get_value(ptr %1) #3, !dbg !25
ret i32 %call, !dbg !26
}
@@ -45,10 +45,10 @@ entry:
; CHECK-NEXT: .long 23
; CHECK-NEXT: .long 0
-declare dso_local i32 @get_value(i32*) local_unnamed_addr #1
+declare dso_local i32 @get_value(ptr) local_unnamed_addr #1
; Function Attrs: nounwind readnone
-declare i32* @llvm.preserve.struct.access.index.p0i32.p0s_struct.v3s(%struct.v3*, i32, i32) #2
+declare ptr @llvm.preserve.struct.access.index.p0.p0.v3s(ptr, i32, i32) #2
attributes #0 = { nounwind "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "frame-pointer"="all" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
attributes #1 = { "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "frame-pointer"="all" "less-precise-fpmad"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
diff --git a/llvm/test/CodeGen/BPF/CORE/offset-reloc-ignore.ll b/llvm/test/CodeGen/BPF/CORE/offset-reloc-ignore.ll
index 2778382c2c044..4ff170cf4c0f6 100644
--- a/llvm/test/CodeGen/BPF/CORE/offset-reloc-ignore.ll
+++ b/llvm/test/CodeGen/BPF/CORE/offset-reloc-ignore.ll
@@ -13,11 +13,11 @@
target triple = "bpf"
; Function Attrs: nounwind
-define dso_local i32 @test(i32* %arg) local_unnamed_addr #0 !dbg !10 {
+define dso_local i32 @test(ptr %arg) local_unnamed_addr #0 !dbg !10 {
entry:
- call void @llvm.dbg.value(metadata i32* %arg, metadata !14, metadata !DIExpression()), !dbg !15
- %0 = tail call i32* @llvm.preserve.array.access.index.p0i32.p0i32(i32* elementtype(i32) %arg, i32 0, i32 4), !dbg !16, !llvm.preserve.access.index !4
- %call = tail call i32 @get_value(i32* %0) #4, !dbg !17
+ call void @llvm.dbg.value(metadata ptr %arg, metadata !14, metadata !DIExpression()), !dbg !15
+ %0 = tail call ptr @llvm.preserve.array.access.index.p0.p0(ptr elementtype(i32) %arg, i32 0, i32 4), !dbg !16, !llvm.preserve.access.index !4
+ %call = tail call i32 @get_value(ptr %0) #4, !dbg !17
ret i32 %call, !dbg !18
}
@@ -26,10 +26,10 @@ entry:
; CHECK: .section .BTF.ext,"", at progbits
; CHECK-NOT: .long 16 # FieldReloc
-declare dso_local i32 @get_value(i32*) local_unnamed_addr #1
+declare dso_local i32 @get_value(ptr) local_unnamed_addr #1
; Function Attrs: nounwind readnone
-declare i32* @llvm.preserve.array.access.index.p0i32.p0i32(i32*, i32, i32) #2
+declare ptr @llvm.preserve.array.access.index.p0.p0(ptr, i32, i32) #2
; Function Attrs: nounwind readnone speculatable willreturn
declare void @llvm.dbg.value(metadata, metadata, metadata) #3
diff --git a/llvm/test/CodeGen/BPF/CORE/offset-reloc-middle-chain.ll b/llvm/test/CodeGen/BPF/CORE/offset-reloc-middle-chain.ll
index c7471958a903c..e5f86c2a473f9 100644
--- a/llvm/test/CodeGen/BPF/CORE/offset-reloc-middle-chain.ll
+++ b/llvm/test/CodeGen/BPF/CORE/offset-reloc-middle-chain.ll
@@ -12,7 +12,7 @@
; struct s1 a;
; };
; #define _(x) __builtin_preserve_access_index(x)
-; void test1(void *p1, void *p2, void *p3);
+; void test1(ptr p1, ptr p2, ptr p3);
; void test(struct r1 *arg) {
; struct s1 *ps = _(&arg->a);
; struct t1 *pt = _(&arg->a.b);
@@ -29,19 +29,16 @@ target triple = "bpf"
%struct.t1 = type { i32 }
; Function Attrs: nounwind
-define dso_local void @test(%struct.r1* %arg) local_unnamed_addr #0 !dbg !7 {
+define dso_local void @test(ptr %arg) local_unnamed_addr #0 !dbg !7 {
entry:
- call void @llvm.dbg.value(metadata %struct.r1* %arg, metadata !22, metadata !DIExpression()), !dbg !29
- %0 = tail call %struct.s1* @llvm.preserve.struct.access.index.p0s_struct.s1s.p0s_struct.r1s(%struct.r1* elementtype(%struct.r1) %arg, i32 0, i32 0), !dbg !30, !llvm.preserve.access.index !11
- call void @llvm.dbg.value(metadata %struct.s1* %0, metadata !23, metadata !DIExpression()), !dbg !29
- %1 = tail call %struct.t1* @llvm.preserve.struct.access.index.p0s_struct.t1s.p0s_struct.s1s(%struct.s1* elementtype(%struct.s1) %0, i32 0, i32 0), !dbg !31, !llvm.preserve.access.index !14
- call void @llvm.dbg.value(metadata %struct.t1* %1, metadata !25, metadata !DIExpression()), !dbg !29
- %2 = tail call i32* @llvm.preserve.struct.access.index.p0i32.p0s_struct.t1s(%struct.t1* elementtype(%struct.t1) %1, i32 0, i32 0), !dbg !32, !llvm.preserve.access.index !17
- call void @llvm.dbg.value(metadata i32* %2, metadata !27, metadata !DIExpression()), !dbg !29
- %3 = bitcast %struct.s1* %0 to i8*, !dbg !33
- %4 = bitcast %struct.t1* %1 to i8*, !dbg !34
- %5 = bitcast i32* %2 to i8*, !dbg !35
- tail call void @test1(i8* %3, i8* %4, i8* %5) #4, !dbg !36
+ call void @llvm.dbg.value(metadata ptr %arg, metadata !22, metadata !DIExpression()), !dbg !29
+ %0 = tail call ptr @llvm.preserve.struct.access.index.p0.s1s.p0.r1s(ptr elementtype(%struct.r1) %arg, i32 0, i32 0), !dbg !30, !llvm.preserve.access.index !11
+ call void @llvm.dbg.value(metadata ptr %0, metadata !23, metadata !DIExpression()), !dbg !29
+ %1 = tail call ptr @llvm.preserve.struct.access.index.p0.t1s.p0.s1s(ptr elementtype(%struct.s1) %0, i32 0, i32 0), !dbg !31, !llvm.preserve.access.index !14
+ call void @llvm.dbg.value(metadata ptr %1, metadata !25, metadata !DIExpression()), !dbg !29
+ %2 = tail call ptr @llvm.preserve.struct.access.index.p0.p0.t1s(ptr elementtype(%struct.t1) %1, i32 0, i32 0), !dbg !32, !llvm.preserve.access.index !17
+ call void @llvm.dbg.value(metadata ptr %2, metadata !27, metadata !DIExpression()), !dbg !29
+ tail call void @test1(ptr %0, ptr %1, ptr %2) #4, !dbg !36
ret void, !dbg !37
}
@@ -70,15 +67,15 @@ entry:
; CHECK-NEXT: .long 0
; Function Attrs: nounwind readnone
-declare %struct.s1* @llvm.preserve.struct.access.index.p0s_struct.s1s.p0s_struct.r1s(%struct.r1*, i32, i32) #1
+declare ptr @llvm.preserve.struct.access.index.p0.s1s.p0.r1s(ptr, i32, i32) #1
; Function Attrs: nounwind readnone
-declare %struct.t1* @llvm.preserve.struct.access.index.p0s_struct.t1s.p0s_struct.s1s(%struct.s1*, i32, i32) #1
+declare ptr @llvm.preserve.struct.access.index.p0.t1s.p0.s1s(ptr, i32, i32) #1
; Function Attrs: nounwind readnone
-declare i32* @llvm.preserve.struct.access.index.p0i32.p0s_struct.t1s(%struct.t1*, i32, i32) #1
+declare ptr @llvm.preserve.struct.access.index.p0.p0.t1s(ptr, i32, i32) #1
-declare dso_local void @test1(i8*, i8*, i8*) local_unnamed_addr #2
+declare dso_local void @test1(ptr, ptr, ptr) local_unnamed_addr #2
; Function Attrs: nounwind readnone speculatable willreturn
declare void @llvm.dbg.value(metadata, metadata, metadata) #3
diff --git a/llvm/test/CodeGen/BPF/CORE/offset-reloc-multi-array-1.ll b/llvm/test/CodeGen/BPF/CORE/offset-reloc-multi-array-1.ll
index d5f1484f3bc00..8ca3ef5d3f6cc 100644
--- a/llvm/test/CodeGen/BPF/CORE/offset-reloc-multi-array-1.ll
+++ b/llvm/test/CodeGen/BPF/CORE/offset-reloc-multi-array-1.ll
@@ -17,14 +17,14 @@ target triple = "bpf"
%struct.v3 = type { i32, [4 x [4 x i32]] }
; Function Attrs: nounwind
-define dso_local i32 @test(%struct.v3* %arg) local_unnamed_addr #0 !dbg !21 {
+define dso_local i32 @test(ptr %arg) local_unnamed_addr #0 !dbg !21 {
entry:
- call void @llvm.dbg.value(metadata %struct.v3* %arg, metadata !25, metadata !DIExpression()), !dbg !26
- %0 = tail call %struct.v3* @llvm.preserve.array.access.index.p0s_struct.v3s.p0s_struct.v3s(%struct.v3* elementtype(%struct.v3) %arg, i32 0, i32 1), !dbg !27, !llvm.preserve.access.index !4
- %1 = tail call [4 x [4 x i32]]* @llvm.preserve.struct.access.index.p0a4a4i32.p0s_struct.v3s(%struct.v3* elementtype(%struct.v3) %0, i32 1, i32 1), !dbg !27, !llvm.preserve.access.index !6
- %2 = tail call [4 x i32]* @llvm.preserve.array.access.index.p0a4i32.p0a4a4i32([4 x [4 x i32]]* elementtype([4 x [4 x i32]]) %1, i32 1, i32 2), !dbg !27, !llvm.preserve.access.index !11
- %3 = tail call i32* @llvm.preserve.array.access.index.p0i32.p0a4i32([4 x i32]* elementtype([4 x i32]) %2, i32 1, i32 3), !dbg !27, !llvm.preserve.access.index !15
- %call = tail call i32 @get_value(i32* %3) #4, !dbg !28
+ call void @llvm.dbg.value(metadata ptr %arg, metadata !25, metadata !DIExpression()), !dbg !26
+ %0 = tail call ptr @llvm.preserve.array.access.index.p0.v3s.p0.v3s(ptr elementtype(%struct.v3) %arg, i32 0, i32 1), !dbg !27, !llvm.preserve.access.index !4
+ %1 = tail call ptr @llvm.preserve.struct.access.index.p0.p0.v3s(ptr elementtype(%struct.v3) %0, i32 1, i32 1), !dbg !27, !llvm.preserve.access.index !6
+ %2 = tail call ptr @llvm.preserve.array.access.index.p0.p0(ptr elementtype([4 x [4 x i32]]) %1, i32 1, i32 2), !dbg !27, !llvm.preserve.access.index !11
+ %3 = tail call ptr @llvm.preserve.array.access.index.p0.p0(ptr elementtype([4 x i32]) %2, i32 1, i32 3), !dbg !27, !llvm.preserve.access.index !15
+ %call = tail call i32 @get_value(ptr %3) #4, !dbg !28
ret i32 %call, !dbg !29
}
@@ -46,19 +46,18 @@ entry:
; CHECK-NEXT: .long 58
; CHECK-NEXT: .long 0
-declare dso_local i32 @get_value(i32*) local_unnamed_addr #1
+declare dso_local i32 @get_value(ptr) local_unnamed_addr #1
; Function Attrs: nounwind readnone
-declare %struct.v3* @llvm.preserve.array.access.index.p0s_struct.v3s.p0s_struct.v3s(%struct.v3*, i32, i32) #2
+declare ptr @llvm.preserve.array.access.index.p0.v3s.p0.v3s(ptr, i32, i32) #2
; Function Attrs: nounwind readnone
-declare [4 x [4 x i32]]* @llvm.preserve.struct.access.index.p0a4a4i32.p0s_struct.v3s(%struct.v3*, i32, i32) #2
+declare ptr @llvm.preserve.struct.access.index.p0.p0.v3s(ptr, i32, i32) #2
; Function Attrs: nounwind readnone
-declare [4 x i32]* @llvm.preserve.array.access.index.p0a4i32.p0a4a4i32([4 x [4 x i32]]*, i32, i32) #2
+declare ptr @llvm.preserve.array.access.index.p0.p0(ptr, i32, i32) #2
; Function Attrs: nounwind readnone
-declare i32* @llvm.preserve.array.access.index.p0i32.p0a4i32([4 x i32]*, i32, i32) #2
; Function Attrs: nounwind readnone speculatable willreturn
declare void @llvm.dbg.value(metadata, metadata, metadata) #3
diff --git a/llvm/test/CodeGen/BPF/CORE/offset-reloc-multi-array-2.ll b/llvm/test/CodeGen/BPF/CORE/offset-reloc-multi-array-2.ll
index 99bdbaa51e017..b2ba5a8386bd4 100644
--- a/llvm/test/CodeGen/BPF/CORE/offset-reloc-multi-array-2.ll
+++ b/llvm/test/CodeGen/BPF/CORE/offset-reloc-multi-array-2.ll
@@ -17,15 +17,15 @@ target triple = "bpf"
%struct.v3 = type { i32, [4 x [4 x [4 x i32]]] }
; Function Attrs: nounwind
-define dso_local i32 @test(%struct.v3* %arg) local_unnamed_addr #0 !dbg !23 {
+define dso_local i32 @test(ptr %arg) local_unnamed_addr #0 !dbg !23 {
entry:
- call void @llvm.dbg.value(metadata %struct.v3* %arg, metadata !27, metadata !DIExpression()), !dbg !28
- %0 = tail call %struct.v3* @llvm.preserve.array.access.index.p0s_struct.v3s.p0s_struct.v3s(%struct.v3* elementtype(%struct.v3) %arg, i32 0, i32 1), !dbg !29, !llvm.preserve.access.index !4
- %1 = tail call [4 x [4 x [4 x i32]]]* @llvm.preserve.struct.access.index.p0a4a4a4i32.p0s_struct.v3s(%struct.v3* elementtype(%struct.v3) %0, i32 1, i32 1), !dbg !29, !llvm.preserve.access.index !6
- %2 = tail call [4 x [4 x i32]]* @llvm.preserve.array.access.index.p0a4a4i32.p0a4a4a4i32([4 x [4 x [4 x i32]]]* elementtype([4 x [4 x [4 x i32]]]) %1, i32 1, i32 2), !dbg !29, !llvm.preserve.access.index !11
- %3 = tail call [4 x i32]* @llvm.preserve.array.access.index.p0a4i32.p0a4a4i32([4 x [4 x i32]]* elementtype([4 x [4 x i32]]) %2, i32 1, i32 3), !dbg !29, !llvm.preserve.access.index !15
- %4 = tail call i32* @llvm.preserve.array.access.index.p0i32.p0a4i32([4 x i32]* elementtype([4 x i32]) %3, i32 1, i32 2), !dbg !29, !llvm.preserve.access.index !17
- %call = tail call i32 @get_value(i32* %4) #4, !dbg !30
+ call void @llvm.dbg.value(metadata ptr %arg, metadata !27, metadata !DIExpression()), !dbg !28
+ %0 = tail call ptr @llvm.preserve.array.access.index.p0.v3s.p0.v3s(ptr elementtype(%struct.v3) %arg, i32 0, i32 1), !dbg !29, !llvm.preserve.access.index !4
+ %1 = tail call ptr @llvm.preserve.struct.access.index.p0.p0.v3s(ptr elementtype(%struct.v3) %0, i32 1, i32 1), !dbg !29, !llvm.preserve.access.index !6
+ %2 = tail call ptr @llvm.preserve.array.access.index.p0.p0(ptr elementtype([4 x [4 x [4 x i32]]]) %1, i32 1, i32 2), !dbg !29, !llvm.preserve.access.index !11
+ %3 = tail call ptr @llvm.preserve.array.access.index.p0.p0(ptr elementtype([4 x [4 x i32]]) %2, i32 1, i32 3), !dbg !29, !llvm.preserve.access.index !15
+ %4 = tail call ptr @llvm.preserve.array.access.index.p0.p0(ptr elementtype([4 x i32]) %3, i32 1, i32 2), !dbg !29, !llvm.preserve.access.index !17
+ %call = tail call i32 @get_value(ptr %4) #4, !dbg !30
ret i32 %call, !dbg !31
}
@@ -47,22 +47,20 @@ entry:
; CHECK-NEXT: .long 58
; CHECK-NEXT: .long 0
-declare dso_local i32 @get_value(i32*) local_unnamed_addr #1
+declare dso_local i32 @get_value(ptr) local_unnamed_addr #1
; Function Attrs: nounwind readnone
-declare %struct.v3* @llvm.preserve.array.access.index.p0s_struct.v3s.p0s_struct.v3s(%struct.v3*, i32, i32) #2
+declare ptr @llvm.preserve.array.access.index.p0.v3s.p0.v3s(ptr, i32, i32) #2
; Function Attrs: nounwind readnone
-declare [4 x [4 x [4 x i32]]]* @llvm.preserve.struct.access.index.p0a4a4a4i32.p0s_struct.v3s(%struct.v3*, i32, i32) #2
+declare ptr @llvm.preserve.struct.access.index.p0.p0.v3s(ptr, i32, i32) #2
; Function Attrs: nounwind readnone
-declare [4 x [4 x i32]]* @llvm.preserve.array.access.index.p0a4a4i32.p0a4a4a4i32([4 x [4 x [4 x i32]]]*, i32, i32) #2
+declare ptr @llvm.preserve.array.access.index.p0.p0(ptr, i32, i32) #2
; Function Attrs: nounwind readnone
-declare [4 x i32]* @llvm.preserve.array.access.index.p0a4i32.p0a4a4i32([4 x [4 x i32]]*, i32, i32) #2
; Function Attrs: nounwind readnone
-declare i32* @llvm.preserve.array.access.index.p0i32.p0a4i32([4 x i32]*, i32, i32) #2
; Function Attrs: nounwind readnone speculatable willreturn
declare void @llvm.dbg.value(metadata, metadata, metadata) #3
diff --git a/llvm/test/CodeGen/BPF/CORE/offset-reloc-multilevel.ll b/llvm/test/CodeGen/BPF/CORE/offset-reloc-multilevel.ll
index 1ec1b90ed657b..e00bbb85d7234 100644
--- a/llvm/test/CodeGen/BPF/CORE/offset-reloc-multilevel.ll
+++ b/llvm/test/CodeGen/BPF/CORE/offset-reloc-multilevel.ll
@@ -11,8 +11,8 @@
; struct net_device dev;
; };
; #define _(x) (__builtin_preserve_access_index(x))
-; static int (*bpf_probe_read)(void *dst, int size, void *unsafe_ptr)
-; = (void *) 4;
+; static int (*bpf_probe_read)(ptr dst, int size, ptr unsafe_ptr)
+; = (ptr) 4;
;
; int bpf_prog(struct sk_buff *ctx) {
; int dev_id;
@@ -28,19 +28,17 @@ target triple = "bpf"
%struct.net_device = type { i32, i32 }
; Function Attrs: nounwind
-define dso_local i32 @bpf_prog(%struct.sk_buff*) local_unnamed_addr #0 !dbg !15 {
+define dso_local i32 @bpf_prog(ptr) local_unnamed_addr #0 !dbg !15 {
%2 = alloca i32, align 4
- call void @llvm.dbg.value(metadata %struct.sk_buff* %0, metadata !28, metadata !DIExpression()), !dbg !30
- %3 = bitcast i32* %2 to i8*, !dbg !31
- call void @llvm.lifetime.start.p0i8(i64 4, i8* nonnull %3) #4, !dbg !31
- %4 = tail call %struct.net_device* @llvm.preserve.struct.access.index.p0s_struct.net_devices.p0s_struct.sk_buffs(%struct.sk_buff* elementtype(%struct.sk_buff) %0, i32 1, i32 1), !dbg !32, !llvm.preserve.access.index !19
- %5 = tail call i32* @llvm.preserve.struct.access.index.p0i32.p0s_struct.net_devices(%struct.net_device* elementtype(%struct.net_device) %4, i32 0, i32 0), !dbg !32, !llvm.preserve.access.index !23
- %6 = bitcast i32* %5 to i8*, !dbg !32
- %7 = call i32 inttoptr (i64 4 to i32 (i8*, i32, i8*)*)(i8* nonnull %3, i32 4, i8* %6) #4, !dbg !33
- %8 = load i32, i32* %2, align 4, !dbg !34, !tbaa !35
- call void @llvm.dbg.value(metadata i32 %8, metadata !29, metadata !DIExpression()), !dbg !30
- call void @llvm.lifetime.end.p0i8(i64 4, i8* nonnull %3) #4, !dbg !39
- ret i32 %8, !dbg !40
+ call void @llvm.dbg.value(metadata ptr %0, metadata !28, metadata !DIExpression()), !dbg !30
+ call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #4, !dbg !31
+ %3 = tail call ptr @llvm.preserve.struct.access.index.p0.net_devices.p0.sk_buffs(ptr elementtype(%struct.sk_buff) %0, i32 1, i32 1), !dbg !32, !llvm.preserve.access.index !19
+ %4 = tail call ptr @llvm.preserve.struct.access.index.p0.p0.net_devices(ptr elementtype(%struct.net_device) %3, i32 0, i32 0), !dbg !32, !llvm.preserve.access.index !23
+ %5 = call i32 inttoptr (i64 4 to ptr)(ptr nonnull %2, i32 4, ptr %4) #4, !dbg !33
+ %6 = load i32, ptr %2, align 4, !dbg !34, !tbaa !35
+ call void @llvm.dbg.value(metadata i32 %6, metadata !29, metadata !DIExpression()), !dbg !30
+ call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #4, !dbg !39
+ ret i32 %6, !dbg !40
}
; CHECK: .section .BTF,"", at progbits
@@ -132,16 +130,16 @@ define dso_local i32 @bpf_prog(%struct.sk_buff*) local_unnamed_addr #0 !dbg !15
; CHECK-NEXT: .long 0
; Function Attrs: argmemonly nounwind
-declare void @llvm.lifetime.start.p0i8(i64 immarg, i8* nocapture) #1
+declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nounwind readnone
-declare %struct.net_device* @llvm.preserve.struct.access.index.p0s_struct.net_devices.p0s_struct.sk_buffs(%struct.sk_buff*, i32 immarg, i32 immarg) #2
+declare ptr @llvm.preserve.struct.access.index.p0.net_devices.p0.sk_buffs(ptr, i32 immarg, i32 immarg) #2
; Function Attrs: nounwind readnone
-declare i32* @llvm.preserve.struct.access.index.p0i32.p0s_struct.net_devices(%struct.net_device*, i32 immarg, i32 immarg) #2
+declare ptr @llvm.preserve.struct.access.index.p0.p0.net_devices(ptr, i32 immarg, i32 immarg) #2
; Function Attrs: argmemonly nounwind
-declare void @llvm.lifetime.end.p0i8(i64 immarg, i8* nocapture) #1
+declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nounwind readnone speculatable
declare void @llvm.dbg.value(metadata, metadata, metadata) #3
diff --git a/llvm/test/CodeGen/BPF/CORE/offset-reloc-pointer-1.ll b/llvm/test/CodeGen/BPF/CORE/offset-reloc-pointer-1.ll
index 7413cc8781384..b4d18449dd378 100644
--- a/llvm/test/CodeGen/BPF/CORE/offset-reloc-pointer-1.ll
+++ b/llvm/test/CodeGen/BPF/CORE/offset-reloc-pointer-1.ll
@@ -16,12 +16,11 @@ target triple = "bpf"
%struct.v3 = type { i32, i32 }
; Function Attrs: nounwind
-define dso_local i32 @test(%struct.v3* %arg) local_unnamed_addr #0 !dbg !15 {
+define dso_local i32 @test(ptr %arg) local_unnamed_addr #0 !dbg !15 {
entry:
- call void @llvm.dbg.value(metadata %struct.v3* %arg, metadata !19, metadata !DIExpression()), !dbg !20
- %0 = tail call %struct.v3* @llvm.preserve.array.access.index.p0s_struct.v3s.p0s_struct.v3s(%struct.v3* elementtype(%struct.v3) %arg, i32 0, i32 1), !dbg !21, !llvm.preserve.access.index !4
- %1 = getelementptr inbounds %struct.v3, %struct.v3* %0, i64 0, i32 0, !dbg !21
- %call = tail call i32 @get_value(i32* %1) #4, !dbg !22
+ call void @llvm.dbg.value(metadata ptr %arg, metadata !19, metadata !DIExpression()), !dbg !20
+ %0 = tail call ptr @llvm.preserve.array.access.index.p0.v3s.p0.v3s(ptr elementtype(%struct.v3) %arg, i32 0, i32 1), !dbg !21, !llvm.preserve.access.index !4
+ %call = tail call i32 @get_value(ptr %0) #4, !dbg !22
ret i32 %call, !dbg !23
}
@@ -43,10 +42,10 @@ entry:
; CHECK-NEXT: .long 32
; CHECK-NEXT: .long 0
-declare dso_local i32 @get_value(i32*) local_unnamed_addr #1
+declare dso_local i32 @get_value(ptr) local_unnamed_addr #1
; Function Attrs: nounwind readnone
-declare %struct.v3* @llvm.preserve.array.access.index.p0s_struct.v3s.p0s_struct.v3s(%struct.v3*, i32, i32) #2
+declare ptr @llvm.preserve.array.access.index.p0.v3s.p0.v3s(ptr, i32, i32) #2
; Function Attrs: nounwind readnone speculatable willreturn
declare void @llvm.dbg.value(metadata, metadata, metadata) #3
diff --git a/llvm/test/CodeGen/BPF/CORE/offset-reloc-pointer-2.ll b/llvm/test/CodeGen/BPF/CORE/offset-reloc-pointer-2.ll
index c0804570b8681..87b88bc925b4f 100644
--- a/llvm/test/CodeGen/BPF/CORE/offset-reloc-pointer-2.ll
+++ b/llvm/test/CodeGen/BPF/CORE/offset-reloc-pointer-2.ll
@@ -16,12 +16,12 @@ target triple = "bpf"
%struct.v3 = type { i32, i32 }
; Function Attrs: nounwind
-define dso_local i32 @test(%struct.v3* %arg) local_unnamed_addr #0 !dbg !15 {
+define dso_local i32 @test(ptr %arg) local_unnamed_addr #0 !dbg !15 {
entry:
- call void @llvm.dbg.value(metadata %struct.v3* %arg, metadata !19, metadata !DIExpression()), !dbg !20
- %0 = tail call %struct.v3* @llvm.preserve.array.access.index.p0s_struct.v3s.p0s_struct.v3s(%struct.v3* elementtype(%struct.v3) %arg, i32 0, i32 1), !dbg !21, !llvm.preserve.access.index !4
- %1 = tail call i32* @llvm.preserve.struct.access.index.p0i32.p0s_struct.v3s(%struct.v3* elementtype(%struct.v3) %0, i32 1, i32 1), !dbg !21, !llvm.preserve.access.index !6
- %call = tail call i32 @get_value(i32* %1) #4, !dbg !22
+ call void @llvm.dbg.value(metadata ptr %arg, metadata !19, metadata !DIExpression()), !dbg !20
+ %0 = tail call ptr @llvm.preserve.array.access.index.p0.v3s.p0.v3s(ptr elementtype(%struct.v3) %arg, i32 0, i32 1), !dbg !21, !llvm.preserve.access.index !4
+ %1 = tail call ptr @llvm.preserve.struct.access.index.p0.p0.v3s(ptr elementtype(%struct.v3) %0, i32 1, i32 1), !dbg !21, !llvm.preserve.access.index !6
+ %call = tail call i32 @get_value(ptr %1) #4, !dbg !22
ret i32 %call, !dbg !23
}
@@ -42,13 +42,13 @@ entry:
; CHECK-NEXT: .long 32
; CHECK-NEXT: .long 0
-declare dso_local i32 @get_value(i32*) local_unnamed_addr #1
+declare dso_local i32 @get_value(ptr) local_unnamed_addr #1
; Function Attrs: nounwind readnone
-declare %struct.v3* @llvm.preserve.array.access.index.p0s_struct.v3s.p0s_struct.v3s(%struct.v3*, i32, i32) #2
+declare ptr @llvm.preserve.array.access.index.p0.v3s.p0.v3s(ptr, i32, i32) #2
; Function Attrs: nounwind readnone
-declare i32* @llvm.preserve.struct.access.index.p0i32.p0s_struct.v3s(%struct.v3*, i32, i32) #2
+declare ptr @llvm.preserve.struct.access.index.p0.p0.v3s(ptr, i32, i32) #2
; Function Attrs: nounwind readnone speculatable willreturn
declare void @llvm.dbg.value(metadata, metadata, metadata) #3
diff --git a/llvm/test/CodeGen/BPF/CORE/offset-reloc-struct-anonymous.ll b/llvm/test/CodeGen/BPF/CORE/offset-reloc-struct-anonymous.ll
index 9822697d916ee..8ebbfeaac6a27 100644
--- a/llvm/test/CodeGen/BPF/CORE/offset-reloc-struct-anonymous.ll
+++ b/llvm/test/CodeGen/BPF/CORE/offset-reloc-struct-anonymous.ll
@@ -10,8 +10,8 @@
; } dev[10];
; };
; #define _(x) (__builtin_preserve_access_index(x))
-; static int (*bpf_probe_read)(void *dst, int size, void *unsafe_ptr)
-; = (void *) 4;
+; static int (*bpf_probe_read)(ptr dst, int size, ptr unsafe_ptr)
+; = (ptr) 4;
;
; int bpf_prog(struct sk_buff *ctx) {
; int dev_id;
@@ -27,20 +27,18 @@ target triple = "bpf"
%struct.anon = type { i32, i32 }
; Function Attrs: nounwind
-define dso_local i32 @bpf_prog(%struct.sk_buff*) local_unnamed_addr #0 !dbg !15 {
+define dso_local i32 @bpf_prog(ptr) local_unnamed_addr #0 !dbg !15 {
%2 = alloca i32, align 4
- call void @llvm.dbg.value(metadata %struct.sk_buff* %0, metadata !31, metadata !DIExpression()), !dbg !33
- %3 = bitcast i32* %2 to i8*, !dbg !34
- call void @llvm.lifetime.start.p0i8(i64 4, i8* nonnull %3) #4, !dbg !34
- %4 = tail call [10 x %struct.anon]* @llvm.preserve.struct.access.index.p0a10s_struct.anons.p0s_struct.sk_buffs(%struct.sk_buff* elementtype(%struct.sk_buff) %0, i32 1, i32 1), !dbg !35, !llvm.preserve.access.index !19
- %5 = tail call %struct.anon* @llvm.preserve.array.access.index.p0s_struct.anons.p0a10s_struct.anons([10 x %struct.anon]* elementtype([10 x %struct.anon]) %4, i32 1, i32 5), !dbg !35, !llvm.preserve.access.index !23
- %6 = tail call i32* @llvm.preserve.struct.access.index.p0i32.p0s_struct.anons(%struct.anon* elementtype(%struct.anon) %5, i32 0, i32 0), !dbg !35, !llvm.preserve.access.index !24
- %7 = bitcast i32* %6 to i8*, !dbg !35
- %8 = call i32 inttoptr (i64 4 to i32 (i8*, i32, i8*)*)(i8* nonnull %3, i32 4, i8* %7) #4, !dbg !36
- %9 = load i32, i32* %2, align 4, !dbg !37, !tbaa !38
- call void @llvm.dbg.value(metadata i32 %9, metadata !32, metadata !DIExpression()), !dbg !33
- call void @llvm.lifetime.end.p0i8(i64 4, i8* nonnull %3) #4, !dbg !42
- ret i32 %9, !dbg !43
+ call void @llvm.dbg.value(metadata ptr %0, metadata !31, metadata !DIExpression()), !dbg !33
+ call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #4, !dbg !34
+ %3 = tail call ptr @llvm.preserve.struct.access.index.p0.anons.p0.sk_buffs(ptr elementtype(%struct.sk_buff) %0, i32 1, i32 1), !dbg !35, !llvm.preserve.access.index !19
+ %4 = tail call ptr @llvm.preserve.array.access.index.p0.anons.p0.anons(ptr elementtype([10 x %struct.anon]) %3, i32 1, i32 5), !dbg !35, !llvm.preserve.access.index !23
+ %5 = tail call ptr @llvm.preserve.struct.access.index.p0.p0.anons(ptr elementtype(%struct.anon) %4, i32 0, i32 0), !dbg !35, !llvm.preserve.access.index !24
+ %6 = call i32 inttoptr (i64 4 to ptr)(ptr nonnull %2, i32 4, ptr %5) #4, !dbg !36
+ %7 = load i32, ptr %2, align 4, !dbg !37, !tbaa !38
+ call void @llvm.dbg.value(metadata i32 %7, metadata !32, metadata !DIExpression()), !dbg !33
+ call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #4, !dbg !42
+ ret i32 %7, !dbg !43
}
; CHECK: .section .BTF,"", at progbits
@@ -142,19 +140,19 @@ define dso_local i32 @bpf_prog(%struct.sk_buff*) local_unnamed_addr #0 !dbg !15
; CHECK-NEXT: .long 0
; Function Attrs: argmemonly nounwind
-declare void @llvm.lifetime.start.p0i8(i64 immarg, i8* nocapture) #1
+declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nounwind readnone
-declare [10 x %struct.anon]* @llvm.preserve.struct.access.index.p0a10s_struct.anons.p0s_struct.sk_buffs(%struct.sk_buff*, i32 immarg, i32 immarg) #2
+declare ptr @llvm.preserve.struct.access.index.p0.anons.p0.sk_buffs(ptr, i32 immarg, i32 immarg) #2
; Function Attrs: nounwind readnone
-declare %struct.anon* @llvm.preserve.array.access.index.p0s_struct.anons.p0a10s_struct.anons([10 x %struct.anon]*, i32 immarg, i32 immarg) #2
+declare ptr @llvm.preserve.array.access.index.p0.anons.p0.anons(ptr, i32 immarg, i32 immarg) #2
; Function Attrs: nounwind readnone
-declare i32* @llvm.preserve.struct.access.index.p0i32.p0s_struct.anons(%struct.anon*, i32 immarg, i32 immarg) #2
+declare ptr @llvm.preserve.struct.access.index.p0.p0.anons(ptr, i32 immarg, i32 immarg) #2
; Function Attrs: argmemonly nounwind
-declare void @llvm.lifetime.end.p0i8(i64 immarg, i8* nocapture) #1
+declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nounwind readnone speculatable
declare void @llvm.dbg.value(metadata, metadata, metadata) #3
diff --git a/llvm/test/CodeGen/BPF/CORE/offset-reloc-struct-array.ll b/llvm/test/CodeGen/BPF/CORE/offset-reloc-struct-array.ll
index 45d6963b05f66..64ec2504551cf 100644
--- a/llvm/test/CodeGen/BPF/CORE/offset-reloc-struct-array.ll
+++ b/llvm/test/CodeGen/BPF/CORE/offset-reloc-struct-array.ll
@@ -11,8 +11,8 @@
; struct net_device dev[10];
; };
; #define _(x) (__builtin_preserve_access_index(x))
-; static int (*bpf_probe_read)(void *dst, int size, void *unsafe_ptr)
-; = (void *) 4;
+; static int (*bpf_probe_read)(ptr dst, int size, ptr unsafe_ptr)
+; = (ptr) 4;
;
; int bpf_prog(struct sk_buff *ctx) {
; int dev_id;
@@ -28,20 +28,18 @@ target triple = "bpf"
%struct.net_device = type { i32, i32 }
; Function Attrs: nounwind
-define dso_local i32 @bpf_prog(%struct.sk_buff*) local_unnamed_addr #0 !dbg !15 {
+define dso_local i32 @bpf_prog(ptr) local_unnamed_addr #0 !dbg !15 {
%2 = alloca i32, align 4
- call void @llvm.dbg.value(metadata %struct.sk_buff* %0, metadata !31, metadata !DIExpression()), !dbg !33
- %3 = bitcast i32* %2 to i8*, !dbg !34
- call void @llvm.lifetime.start.p0i8(i64 4, i8* nonnull %3) #4, !dbg !34
- %4 = tail call [10 x %struct.net_device]* @llvm.preserve.struct.access.index.p0a10s_struct.net_devices.p0s_struct.sk_buffs(%struct.sk_buff* elementtype(%struct.sk_buff) %0, i32 1, i32 1), !dbg !35, !llvm.preserve.access.index !19
- %5 = tail call %struct.net_device* @llvm.preserve.array.access.index.p0s_struct.net_devices.p0a10s_struct.net_devices([10 x %struct.net_device]* elementtype([10 x %struct.net_device]) %4, i32 1, i32 5), !dbg !35, !llvm.preserve.access.index !23
- %6 = tail call i32* @llvm.preserve.struct.access.index.p0i32.p0s_struct.net_devices(%struct.net_device* elementtype(%struct.net_device) %5, i32 0, i32 0), !dbg !35, !llvm.preserve.access.index !24
- %7 = bitcast i32* %6 to i8*, !dbg !35
- %8 = call i32 inttoptr (i64 4 to i32 (i8*, i32, i8*)*)(i8* nonnull %3, i32 4, i8* %7) #4, !dbg !36
- %9 = load i32, i32* %2, align 4, !dbg !37, !tbaa !38
- call void @llvm.dbg.value(metadata i32 %9, metadata !32, metadata !DIExpression()), !dbg !33
- call void @llvm.lifetime.end.p0i8(i64 4, i8* nonnull %3) #4, !dbg !42
- ret i32 %9, !dbg !43
+ call void @llvm.dbg.value(metadata ptr %0, metadata !31, metadata !DIExpression()), !dbg !33
+ call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #4, !dbg !34
+ %3 = tail call ptr @llvm.preserve.struct.access.index.p0.net_devices.p0.sk_buffs(ptr elementtype(%struct.sk_buff) %0, i32 1, i32 1), !dbg !35, !llvm.preserve.access.index !19
+ %4 = tail call ptr @llvm.preserve.array.access.index.p0.net_devices.p0.net_devices(ptr elementtype([10 x %struct.net_device]) %3, i32 1, i32 5), !dbg !35, !llvm.preserve.access.index !23
+ %5 = tail call ptr @llvm.preserve.struct.access.index.p0.p0.net_devices(ptr elementtype(%struct.net_device) %4, i32 0, i32 0), !dbg !35, !llvm.preserve.access.index !24
+ %6 = call i32 inttoptr (i64 4 to ptr)(ptr nonnull %2, i32 4, ptr %5) #4, !dbg !36
+ %7 = load i32, ptr %2, align 4, !dbg !37, !tbaa !38
+ call void @llvm.dbg.value(metadata i32 %7, metadata !32, metadata !DIExpression()), !dbg !33
+ call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #4, !dbg !42
+ ret i32 %7, !dbg !43
}
; CHECK: .section .BTF,"", at progbits
@@ -145,19 +143,19 @@ define dso_local i32 @bpf_prog(%struct.sk_buff*) local_unnamed_addr #0 !dbg !15
; CHECK-NEXT: .long 0
; Function Attrs: argmemonly nounwind
-declare void @llvm.lifetime.start.p0i8(i64 immarg, i8* nocapture) #1
+declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nounwind readnone
-declare [10 x %struct.net_device]* @llvm.preserve.struct.access.index.p0a10s_struct.net_devices.p0s_struct.sk_buffs(%struct.sk_buff*, i32 immarg, i32 immarg) #2
+declare ptr @llvm.preserve.struct.access.index.p0.net_devices.p0.sk_buffs(ptr, i32 immarg, i32 immarg) #2
; Function Attrs: nounwind readnone
-declare %struct.net_device* @llvm.preserve.array.access.index.p0s_struct.net_devices.p0a10s_struct.net_devices([10 x %struct.net_device]*, i32 immarg, i32 immarg) #2
+declare ptr @llvm.preserve.array.access.index.p0.net_devices.p0.net_devices(ptr, i32 immarg, i32 immarg) #2
; Function Attrs: nounwind readnone
-declare i32* @llvm.preserve.struct.access.index.p0i32.p0s_struct.net_devices(%struct.net_device*, i32 immarg, i32 immarg) #2
+declare ptr @llvm.preserve.struct.access.index.p0.p0.net_devices(ptr, i32 immarg, i32 immarg) #2
; Function Attrs: argmemonly nounwind
-declare void @llvm.lifetime.end.p0i8(i64 immarg, i8* nocapture) #1
+declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nounwind readnone speculatable
declare void @llvm.dbg.value(metadata, metadata, metadata) #3
diff --git a/llvm/test/CodeGen/BPF/CORE/offset-reloc-typedef-array.ll b/llvm/test/CodeGen/BPF/CORE/offset-reloc-typedef-array.ll
index bade3f39bb2e7..ed462e1b35b10 100644
--- a/llvm/test/CodeGen/BPF/CORE/offset-reloc-typedef-array.ll
+++ b/llvm/test/CodeGen/BPF/CORE/offset-reloc-typedef-array.ll
@@ -9,7 +9,7 @@
; struct __s { _arr a; };
; typedef struct __s s;
; #define _(x) (__builtin_preserve_access_index(x))
-; int get_value(const void *addr);
+; int get_value(const ptr addr);
; int test(s *arg) {
; return get_value(_(&arg->a[1]));
; }
@@ -20,13 +20,12 @@ target triple = "bpf"
%struct.__s = type { [7 x i32] }
; Function Attrs: nounwind
-define dso_local i32 @test(%struct.__s* %arg) local_unnamed_addr #0 !dbg !7 {
+define dso_local i32 @test(ptr %arg) local_unnamed_addr #0 !dbg !7 {
entry:
- call void @llvm.dbg.value(metadata %struct.__s* %arg, metadata !24, metadata !DIExpression()), !dbg !25
- %0 = tail call [7 x i32]* @llvm.preserve.struct.access.index.p0a7i32.p0s_struct.__ss(%struct.__s* elementtype(%struct.__s) %arg, i32 0, i32 0), !dbg !26, !llvm.preserve.access.index !13
- %1 = tail call i32* @llvm.preserve.array.access.index.p0i32.p0a7i32([7 x i32]* elementtype([7 x i32]) %0, i32 1, i32 1), !dbg !26, !llvm.preserve.access.index !19
- %2 = bitcast i32* %1 to i8*, !dbg !26
- %call = tail call i32 @get_value(i8* %2) #4, !dbg !27
+ call void @llvm.dbg.value(metadata ptr %arg, metadata !24, metadata !DIExpression()), !dbg !25
+ %0 = tail call ptr @llvm.preserve.struct.access.index.p0.p0.__ss(ptr elementtype(%struct.__s) %arg, i32 0, i32 0), !dbg !26, !llvm.preserve.access.index !13
+ %1 = tail call ptr @llvm.preserve.array.access.index.p0.p0(ptr elementtype([7 x i32]) %0, i32 1, i32 1), !dbg !26, !llvm.preserve.access.index !19
+ %call = tail call i32 @get_value(ptr %1) #4, !dbg !27
ret i32 %call, !dbg !28
}
@@ -49,13 +48,13 @@ entry:
; CHECK-NEXT: .long [[ACCESS_STR]]
; CHECK-NEXT: .long 0
-declare dso_local i32 @get_value(i8*) local_unnamed_addr #1
+declare dso_local i32 @get_value(ptr) local_unnamed_addr #1
; Function Attrs: nounwind readnone
-declare [7 x i32]* @llvm.preserve.struct.access.index.p0a7i32.p0s_struct.__ss(%struct.__s*, i32 immarg, i32 immarg) #2
+declare ptr @llvm.preserve.struct.access.index.p0.p0.__ss(ptr, i32 immarg, i32 immarg) #2
; Function Attrs: nounwind readnone
-declare i32* @llvm.preserve.array.access.index.p0i32.p0a7i32([7 x i32]*, i32 immarg, i32 immarg) #2
+declare ptr @llvm.preserve.array.access.index.p0.p0(ptr, i32 immarg, i32 immarg) #2
; Function Attrs: nounwind readnone speculatable
declare void @llvm.dbg.value(metadata, metadata, metadata) #3
diff --git a/llvm/test/CodeGen/BPF/CORE/offset-reloc-typedef-struct-2.ll b/llvm/test/CodeGen/BPF/CORE/offset-reloc-typedef-struct-2.ll
index e479df5f5303c..6b806ae87e6d3 100644
--- a/llvm/test/CodeGen/BPF/CORE/offset-reloc-typedef-struct-2.ll
+++ b/llvm/test/CodeGen/BPF/CORE/offset-reloc-typedef-struct-2.ll
@@ -18,11 +18,11 @@ target triple = "bpf"
%struct.__t = type { i32 }
; Function Attrs: nounwind readonly
-define dso_local i32 @test(%struct.__t* readonly %arg) local_unnamed_addr #0 !dbg !13 {
+define dso_local i32 @test(ptr readonly %arg) local_unnamed_addr #0 !dbg !13 {
entry:
- call void @llvm.dbg.value(metadata %struct.__t* %arg, metadata !18, metadata !DIExpression()), !dbg !19
- %0 = tail call i32* @llvm.preserve.struct.access.index.p0i32.p0s_struct.__ts(%struct.__t* elementtype(%struct.__t) %arg, i32 0, i32 0), !dbg !20, !llvm.preserve.access.index !4
- %1 = load i32, i32* %0, align 4, !dbg !20, !tbaa !21
+ call void @llvm.dbg.value(metadata ptr %arg, metadata !18, metadata !DIExpression()), !dbg !19
+ %0 = tail call ptr @llvm.preserve.struct.access.index.p0.p0.__ts(ptr elementtype(%struct.__t) %arg, i32 0, i32 0), !dbg !20, !llvm.preserve.access.index !4
+ %1 = load i32, ptr %0, align 4, !dbg !20, !tbaa !21
ret i32 %1, !dbg !26
}
@@ -50,7 +50,7 @@ entry:
; CHECK-NEXT: .long 0
; Function Attrs: nounwind readnone
-declare i32* @llvm.preserve.struct.access.index.p0i32.p0s_struct.__ts(%struct.__t*, i32, i32) #1
+declare ptr @llvm.preserve.struct.access.index.p0.p0.__ts(ptr, i32, i32) #1
; Function Attrs: nounwind readnone speculatable
declare void @llvm.dbg.value(metadata, metadata, metadata) #2
diff --git a/llvm/test/CodeGen/BPF/CORE/offset-reloc-typedef-struct.ll b/llvm/test/CodeGen/BPF/CORE/offset-reloc-typedef-struct.ll
index 2198b4fff23ec..c2b5a116e9cd0 100644
--- a/llvm/test/CodeGen/BPF/CORE/offset-reloc-typedef-struct.ll
+++ b/llvm/test/CodeGen/BPF/CORE/offset-reloc-typedef-struct.ll
@@ -9,7 +9,7 @@
; typedef struct __s _s;
; typedef _s s;
; #define _(x) (__builtin_preserve_access_index(x))
-; int get_value(const void *addr);
+; int get_value(const ptr addr);
; int test(s *arg) {
; return get_value(_(&arg->b));
; }
@@ -20,12 +20,11 @@ target triple = "bpf"
%struct.__s = type { i32, i32 }
; Function Attrs: nounwind
-define dso_local i32 @test(%struct.__s* %arg) local_unnamed_addr #0 !dbg !7 {
+define dso_local i32 @test(ptr %arg) local_unnamed_addr #0 !dbg !7 {
entry:
- call void @llvm.dbg.value(metadata %struct.__s* %arg, metadata !21, metadata !DIExpression()), !dbg !22
- %0 = tail call i32* @llvm.preserve.struct.access.index.p0i32.p0s_struct.__ss(%struct.__s* elementtype(%struct.__s) %arg, i32 1, i32 1), !dbg !23, !llvm.preserve.access.index !14
- %1 = bitcast i32* %0 to i8*, !dbg !23
- %call = tail call i32 @get_value(i8* %1) #4, !dbg !24
+ call void @llvm.dbg.value(metadata ptr %arg, metadata !21, metadata !DIExpression()), !dbg !22
+ %0 = tail call ptr @llvm.preserve.struct.access.index.p0.p0.__ss(ptr elementtype(%struct.__s) %arg, i32 1, i32 1), !dbg !23, !llvm.preserve.access.index !14
+ %call = tail call i32 @get_value(ptr %0) #4, !dbg !24
ret i32 %call, !dbg !25
}
@@ -48,10 +47,10 @@ entry:
; CHECK-NEXT: .long [[ACCESS_STR]]
; CHECK-NEXT: .long 0
-declare dso_local i32 @get_value(i8*) local_unnamed_addr #1
+declare dso_local i32 @get_value(ptr) local_unnamed_addr #1
; Function Attrs: nounwind readnone
-declare i32* @llvm.preserve.struct.access.index.p0i32.p0s_struct.__ss(%struct.__s*, i32 immarg, i32 immarg) #2
+declare ptr @llvm.preserve.struct.access.index.p0.p0.__ss(ptr, i32 immarg, i32 immarg) #2
; Function Attrs: nounwind readnone speculatable
declare void @llvm.dbg.value(metadata, metadata, metadata) #3
diff --git a/llvm/test/CodeGen/BPF/CORE/offset-reloc-typedef-union-2.ll b/llvm/test/CodeGen/BPF/CORE/offset-reloc-typedef-union-2.ll
index 459c0a76a7c2c..a63b7e7296d36 100644
--- a/llvm/test/CodeGen/BPF/CORE/offset-reloc-typedef-union-2.ll
+++ b/llvm/test/CodeGen/BPF/CORE/offset-reloc-typedef-union-2.ll
@@ -18,12 +18,11 @@ target triple = "bpf"
%union.__t = type { i32 }
; Function Attrs: nounwind readonly
-define dso_local i32 @test(%union.__t* readonly %arg) local_unnamed_addr #0 !dbg !13 {
+define dso_local i32 @test(ptr readonly %arg) local_unnamed_addr #0 !dbg !13 {
entry:
- call void @llvm.dbg.value(metadata %union.__t* %arg, metadata !18, metadata !DIExpression()), !dbg !19
- %0 = tail call %union.__t* @llvm.preserve.union.access.index.p0s_union.__ts.p0s_union.__ts(%union.__t* %arg, i32 0), !dbg !20, !llvm.preserve.access.index !4
- %a = getelementptr %union.__t, %union.__t* %0, i64 0, i32 0, !dbg !20
- %1 = load i32, i32* %a, align 4, !dbg !20, !tbaa !21
+ call void @llvm.dbg.value(metadata ptr %arg, metadata !18, metadata !DIExpression()), !dbg !19
+ %0 = tail call ptr @llvm.preserve.union.access.index.p0.__ts.p0.__ts(ptr %arg, i32 0), !dbg !20, !llvm.preserve.access.index !4
+ %1 = load i32, ptr %0, align 4, !dbg !20, !tbaa !21
ret i32 %1, !dbg !24
}
@@ -51,7 +50,7 @@ entry:
; CHECK-NEXT: .long 0
; Function Attrs: nounwind readnone
-declare %union.__t* @llvm.preserve.union.access.index.p0s_union.__ts.p0s_union.__ts(%union.__t*, i32) #1
+declare ptr @llvm.preserve.union.access.index.p0.__ts.p0.__ts(ptr, i32) #1
; Function Attrs: nounwind readnone speculatable
declare void @llvm.dbg.value(metadata, metadata, metadata) #2
diff --git a/llvm/test/CodeGen/BPF/CORE/offset-reloc-typedef-union.ll b/llvm/test/CodeGen/BPF/CORE/offset-reloc-typedef-union.ll
index 257942cbe264e..4b3d178cffba6 100644
--- a/llvm/test/CodeGen/BPF/CORE/offset-reloc-typedef-union.ll
+++ b/llvm/test/CodeGen/BPF/CORE/offset-reloc-typedef-union.ll
@@ -9,7 +9,7 @@
; typedef union __s _s;
; typedef _s s;
; #define _(x) (__builtin_preserve_access_index(x))
-; int get_value(const void *addr);
+; int get_value(const ptr addr);
; int test(s *arg) {
; return get_value(_(&arg->b));
; }
@@ -20,12 +20,11 @@ target triple = "bpf"
%union.__s = type { i32 }
; Function Attrs: nounwind
-define dso_local i32 @test(%union.__s* %arg) local_unnamed_addr #0 !dbg !7 {
+define dso_local i32 @test(ptr %arg) local_unnamed_addr #0 !dbg !7 {
entry:
- call void @llvm.dbg.value(metadata %union.__s* %arg, metadata !21, metadata !DIExpression()), !dbg !22
- %0 = tail call %union.__s* @llvm.preserve.union.access.index.p0s_union.__ss.p0s_union.__ss(%union.__s* %arg, i32 1), !dbg !23, !llvm.preserve.access.index !14
- %1 = bitcast %union.__s* %0 to i8*, !dbg !23
- %call = tail call i32 @get_value(i8* %1) #4, !dbg !24
+ call void @llvm.dbg.value(metadata ptr %arg, metadata !21, metadata !DIExpression()), !dbg !22
+ %0 = tail call ptr @llvm.preserve.union.access.index.p0.__ss.p0.__ss(ptr %arg, i32 1), !dbg !23, !llvm.preserve.access.index !14
+ %call = tail call i32 @get_value(ptr %0) #4, !dbg !24
ret i32 %call, !dbg !25
}
@@ -48,10 +47,10 @@ entry:
; CHECK-NEXT: .long [[ACCESS_STR]]
; CHECK-NEXT: .long 0
-declare dso_local i32 @get_value(i8*) local_unnamed_addr #1
+declare dso_local i32 @get_value(ptr) local_unnamed_addr #1
; Function Attrs: nounwind readnone
-declare %union.__s* @llvm.preserve.union.access.index.p0s_union.__ss.p0s_union.__ss(%union.__s*, i32 immarg) #2
+declare ptr @llvm.preserve.union.access.index.p0.__ss.p0.__ss(ptr, i32 immarg) #2
; Function Attrs: nounwind readnone speculatable
declare void @llvm.dbg.value(metadata, metadata, metadata) #3
diff --git a/llvm/test/CodeGen/BPF/CORE/offset-reloc-typedef.ll b/llvm/test/CodeGen/BPF/CORE/offset-reloc-typedef.ll
index 7f7558dbdb651..e757327919e2a 100644
--- a/llvm/test/CodeGen/BPF/CORE/offset-reloc-typedef.ll
+++ b/llvm/test/CodeGen/BPF/CORE/offset-reloc-typedef.ll
@@ -11,7 +11,7 @@
; typedef arr_t __arr;
;
; #define _(x) (__builtin_preserve_access_index(x))
-; int get_value(const void *addr);
+; int get_value(const ptr addr);
; int test(__arr *arg) {
; return get_value(_(&arg[1]->d.b));
; }
@@ -24,16 +24,13 @@ target triple = "bpf"
%struct.s = type { i32, i32 }
; Function Attrs: nounwind
-define dso_local i32 @test([7 x %union.u]* %arg) local_unnamed_addr #0 !dbg !7 {
+define dso_local i32 @test(ptr %arg) local_unnamed_addr #0 !dbg !7 {
entry:
- call void @llvm.dbg.value(metadata [7 x %union.u]* %arg, metadata !28, metadata !DIExpression()), !dbg !29
- %0 = tail call [7 x %union.u]* @llvm.preserve.array.access.index.p0a7s_union.us.p0a7s_union.us([7 x %union.u]* elementtype([7 x %union.u]) %arg, i32 0, i32 1), !dbg !30, !llvm.preserve.access.index !14
- %arraydecay = getelementptr inbounds [7 x %union.u], [7 x %union.u]* %0, i64 0, i64 0, !dbg !30
- %1 = tail call %union.u* @llvm.preserve.union.access.index.p0s_union.us.p0s_union.us(%union.u* %arraydecay, i32 1), !dbg !30, !llvm.preserve.access.index !16
- %d = getelementptr inbounds %union.u, %union.u* %1, i64 0, i32 0, !dbg !30
- %2 = tail call i32* @llvm.preserve.struct.access.index.p0i32.p0s_struct.ss(%struct.s* elementtype(%struct.s) %d, i32 1, i32 1), !dbg !30, !llvm.preserve.access.index !20
- %3 = bitcast i32* %2 to i8*, !dbg !30
- %call = tail call i32 @get_value(i8* %3) #4, !dbg !31
+ call void @llvm.dbg.value(metadata ptr %arg, metadata !28, metadata !DIExpression()), !dbg !29
+ %0 = tail call ptr @llvm.preserve.array.access.index.p0.us.p0.us(ptr elementtype([7 x %union.u]) %arg, i32 0, i32 1), !dbg !30, !llvm.preserve.access.index !14
+ %1 = tail call ptr @llvm.preserve.union.access.index.p0.us.p0.us(ptr %0, i32 1), !dbg !30, !llvm.preserve.access.index !16
+ %2 = tail call ptr @llvm.preserve.struct.access.index.p0.p0.ss(ptr elementtype(%struct.s) %1, i32 1, i32 1), !dbg !30, !llvm.preserve.access.index !20
+ %call = tail call i32 @get_value(ptr %2) #4, !dbg !31
ret i32 %call, !dbg !32
}
@@ -56,16 +53,16 @@ entry:
; CHECK-NEXT: .long [[ACCESS_STR:[0-9]+]]
; CHECK-NEXT: .long 0
-declare dso_local i32 @get_value(i8*) local_unnamed_addr #1
+declare dso_local i32 @get_value(ptr) local_unnamed_addr #1
; Function Attrs: nounwind readnone
-declare [7 x %union.u]* @llvm.preserve.array.access.index.p0a7s_union.us.p0a7s_union.us([7 x %union.u]*, i32 immarg, i32 immarg) #2
+declare ptr @llvm.preserve.array.access.index.p0.us.p0.us(ptr, i32 immarg, i32 immarg) #2
; Function Attrs: nounwind readnone
-declare %union.u* @llvm.preserve.union.access.index.p0s_union.us.p0s_union.us(%union.u*, i32 immarg) #2
+declare ptr @llvm.preserve.union.access.index.p0.us.p0.us(ptr, i32 immarg) #2
; Function Attrs: nounwind readnone
-declare i32* @llvm.preserve.struct.access.index.p0i32.p0s_struct.ss(%struct.s*, i32 immarg, i32 immarg) #2
+declare ptr @llvm.preserve.struct.access.index.p0.p0.ss(ptr, i32 immarg, i32 immarg) #2
; Function Attrs: nounwind readnone speculatable
declare void @llvm.dbg.value(metadata, metadata, metadata) #3
diff --git a/llvm/test/CodeGen/BPF/CORE/offset-reloc-union.ll b/llvm/test/CodeGen/BPF/CORE/offset-reloc-union.ll
index cfc13d12545c7..824eba9af8f52 100644
--- a/llvm/test/CodeGen/BPF/CORE/offset-reloc-union.ll
+++ b/llvm/test/CodeGen/BPF/CORE/offset-reloc-union.ll
@@ -13,8 +13,8 @@
; } u;
; };
; #define _(x) (__builtin_preserve_access_index(x))
-; static int (*bpf_probe_read)(void *dst, int size, void *unsafe_ptr)
-; = (void *) 4;
+; static int (*bpf_probe_read)(ptr dst, int size, ptr unsafe_ptr)
+; = (ptr) 4;
;
; int bpf_prog(union sk_buff *ctx) {
; int dev_id;
@@ -31,21 +31,18 @@ target triple = "bpf"
%union.anon = type { i32 }
; Function Attrs: nounwind
-define dso_local i32 @bpf_prog(%union.sk_buff*) local_unnamed_addr #0 !dbg !15 {
+define dso_local i32 @bpf_prog(ptr) local_unnamed_addr #0 !dbg !15 {
%2 = alloca i32, align 4
- call void @llvm.dbg.value(metadata %union.sk_buff* %0, metadata !32, metadata !DIExpression()), !dbg !34
- %3 = bitcast i32* %2 to i8*, !dbg !35
- call void @llvm.lifetime.start.p0i8(i64 4, i8* nonnull %3) #4, !dbg !35
- %4 = tail call %union.sk_buff* @llvm.preserve.union.access.index.p0s_union.sk_buffs.p0s_union.sk_buffs(%union.sk_buff* %0, i32 1), !dbg !36, !llvm.preserve.access.index !19
- %5 = getelementptr inbounds %union.sk_buff, %union.sk_buff* %4, i64 0, i32 0, !dbg !36
- %6 = tail call %union.anon* @llvm.preserve.struct.access.index.p0s_union.anons.p0s_struct.anons(%struct.anon* elementtype(%struct.anon) %5, i32 1, i32 1), !dbg !36, !llvm.preserve.access.index !23
- %7 = tail call %union.anon* @llvm.preserve.union.access.index.p0s_union.anons.p0s_union.anons(%union.anon* %6, i32 0), !dbg !36, !llvm.preserve.access.index !27
- %8 = bitcast %union.anon* %7 to i8*, !dbg !36
- %9 = call i32 inttoptr (i64 4 to i32 (i8*, i32, i8*)*)(i8* nonnull %3, i32 4, i8* %8) #4, !dbg !37
- %10 = load i32, i32* %2, align 4, !dbg !38, !tbaa !39
- call void @llvm.dbg.value(metadata i32 %10, metadata !33, metadata !DIExpression()), !dbg !34
- call void @llvm.lifetime.end.p0i8(i64 4, i8* nonnull %3) #4, !dbg !43
- ret i32 %10, !dbg !44
+ call void @llvm.dbg.value(metadata ptr %0, metadata !32, metadata !DIExpression()), !dbg !34
+ call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #4, !dbg !35
+ %3 = tail call ptr @llvm.preserve.union.access.index.p0.sk_buffs.p0.sk_buffs(ptr %0, i32 1), !dbg !36, !llvm.preserve.access.index !19
+ %4 = tail call ptr @llvm.preserve.struct.access.index.p0.anons.p0.anons(ptr elementtype(%struct.anon) %3, i32 1, i32 1), !dbg !36, !llvm.preserve.access.index !23
+ %5 = tail call ptr @llvm.preserve.union.access.index.p0.anons.p0.anons(ptr %4, i32 0), !dbg !36, !llvm.preserve.access.index !27
+ %6 = call i32 inttoptr (i64 4 to ptr)(ptr nonnull %2, i32 4, ptr %5) #4, !dbg !37
+ %7 = load i32, ptr %2, align 4, !dbg !38, !tbaa !39
+ call void @llvm.dbg.value(metadata i32 %7, metadata !33, metadata !DIExpression()), !dbg !34
+ call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #4, !dbg !43
+ ret i32 %7, !dbg !44
}
; CHECK: .section .BTF,"", at progbits
@@ -148,19 +145,19 @@ define dso_local i32 @bpf_prog(%union.sk_buff*) local_unnamed_addr #0 !dbg !15 {
; CHECK-NEXT: .long 0
; Function Attrs: argmemonly nounwind
-declare void @llvm.lifetime.start.p0i8(i64 immarg, i8* nocapture) #1
+declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nounwind readnone
-declare %union.sk_buff* @llvm.preserve.union.access.index.p0s_union.sk_buffs.p0s_union.sk_buffs(%union.sk_buff*, i32 immarg) #2
+declare ptr @llvm.preserve.union.access.index.p0.sk_buffs.p0.sk_buffs(ptr, i32 immarg) #2
; Function Attrs: nounwind readnone
-declare %union.anon* @llvm.preserve.struct.access.index.p0s_union.anons.p0s_struct.anons(%struct.anon*, i32 immarg, i32 immarg) #2
+declare ptr @llvm.preserve.struct.access.index.p0.anons.p0.anons(ptr, i32 immarg, i32 immarg) #2
; Function Attrs: nounwind readnone
-declare %union.anon* @llvm.preserve.union.access.index.p0s_union.anons.p0s_union.anons(%union.anon*, i32 immarg) #2
+declare ptr @llvm.preserve.union.access.index.p0.anons.p0.anons(ptr, i32 immarg) #2
; Function Attrs: argmemonly nounwind
-declare void @llvm.lifetime.end.p0i8(i64 immarg, i8* nocapture) #1
+declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nounwind readnone speculatable
declare void @llvm.dbg.value(metadata, metadata, metadata) #3
diff --git a/llvm/test/CodeGen/BPF/CORE/store-addr.ll b/llvm/test/CodeGen/BPF/CORE/store-addr.ll
index e2b1e2a233dc3..33bbd0188165d 100644
--- a/llvm/test/CodeGen/BPF/CORE/store-addr.ll
+++ b/llvm/test/CodeGen/BPF/CORE/store-addr.ll
@@ -8,7 +8,7 @@
; struct t {
; int a;
; } __attribute__((preserve_access_index));
-; int foo(void *);
+; int foo(ptr);
; int test(struct t *arg) {
; long param[1];
; param[0] = (long)&arg->a;
@@ -22,19 +22,17 @@ target triple = "bpf"
%struct.t = type { i32 }
; Function Attrs: nounwind
-define dso_local i32 @test(%struct.t* %arg) local_unnamed_addr #0 !dbg !14 {
+define dso_local i32 @test(ptr %arg) local_unnamed_addr #0 !dbg !14 {
entry:
%param = alloca [1 x i64], align 8
- call void @llvm.dbg.value(metadata %struct.t* %arg, metadata !22, metadata !DIExpression()), !dbg !27
- %0 = bitcast [1 x i64]* %param to i8*, !dbg !28
- call void @llvm.lifetime.start.p0i8(i64 8, i8* nonnull %0) #5, !dbg !28
- call void @llvm.dbg.declare(metadata [1 x i64]* %param, metadata !23, metadata !DIExpression()), !dbg !29
- %1 = tail call i32* @llvm.preserve.struct.access.index.p0i32.p0s_struct.ts(%struct.t* elementtype(%struct.t) %arg, i32 0, i32 0), !dbg !30, !llvm.preserve.access.index !18
- %2 = ptrtoint i32* %1 to i64, !dbg !31
- %arrayidx = getelementptr inbounds [1 x i64], [1 x i64]* %param, i64 0, i64 0, !dbg !32
- store i64 %2, i64* %arrayidx, align 8, !dbg !33, !tbaa !34
- %call = call i32 @foo(i8* nonnull %0) #5, !dbg !38
- call void @llvm.lifetime.end.p0i8(i64 8, i8* nonnull %0) #5, !dbg !39
+ call void @llvm.dbg.value(metadata ptr %arg, metadata !22, metadata !DIExpression()), !dbg !27
+ call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %param) #5, !dbg !28
+ call void @llvm.dbg.declare(metadata ptr %param, metadata !23, metadata !DIExpression()), !dbg !29
+ %0 = tail call ptr @llvm.preserve.struct.access.index.p0.p0.ts(ptr elementtype(%struct.t) %arg, i32 0, i32 0), !dbg !30, !llvm.preserve.access.index !18
+ %1 = ptrtoint ptr %0 to i64, !dbg !31
+ store i64 %1, ptr %param, align 8, !dbg !33, !tbaa !34
+ %call = call i32 @foo(ptr nonnull %param) #5, !dbg !38
+ call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %param) #5, !dbg !39
ret i32 %call, !dbg !40
}
@@ -46,15 +44,15 @@ entry:
declare void @llvm.dbg.declare(metadata, metadata, metadata) #1
; Function Attrs: argmemonly nounwind
-declare void @llvm.lifetime.start.p0i8(i64, i8* nocapture) #2
+declare void @llvm.lifetime.start.p0(i64, ptr nocapture) #2
; Function Attrs: nounwind readnone
-declare i32* @llvm.preserve.struct.access.index.p0i32.p0s_struct.ts(%struct.t*, i32, i32) #3
+declare ptr @llvm.preserve.struct.access.index.p0.p0.ts(ptr, i32, i32) #3
-declare !dbg !5 dso_local i32 @foo(i8*) local_unnamed_addr #4
+declare !dbg !5 dso_local i32 @foo(ptr) local_unnamed_addr #4
; Function Attrs: argmemonly nounwind
-declare void @llvm.lifetime.end.p0i8(i64, i8* nocapture) #2
+declare void @llvm.lifetime.end.p0(i64, ptr nocapture) #2
; Function Attrs: nounwind readnone speculatable
declare void @llvm.dbg.value(metadata, metadata, metadata) #1
diff --git a/llvm/test/CodeGen/BPF/adjust-opt-icmp1.ll b/llvm/test/CodeGen/BPF/adjust-opt-icmp1.ll
index a2e1b03b711ab..be8675f084302 100644
--- a/llvm/test/CodeGen/BPF/adjust-opt-icmp1.ll
+++ b/llvm/test/CodeGen/BPF/adjust-opt-icmp1.ll
@@ -25,12 +25,11 @@ entry:
%retval = alloca i32, align 4
%ret = alloca i32, align 4
%cleanup.dest.slot = alloca i32, align 4
- %0 = bitcast i32* %ret to i8*
- call void @llvm.lifetime.start.p0i8(i64 4, i8* %0) #3
- %call = call i32 bitcast (i32 (...)* @foo to i32 ()*)()
- store i32 %call, i32* %ret, align 4, !tbaa !2
- %1 = load i32, i32* %ret, align 4, !tbaa !2
- %cmp = icmp sle i32 %1, 0
+ call void @llvm.lifetime.start.p0(i64 4, ptr %ret) #3
+ %call = call i32 @foo()
+ store i32 %call, ptr %ret, align 4, !tbaa !2
+ %0 = load i32, ptr %ret, align 4, !tbaa !2
+ %cmp = icmp sle i32 %0, 0
br i1 %cmp, label %if.then, label %lor.lhs.false
; CHECK: [[REG1:r[0-9]+]] <<= 32
@@ -46,38 +45,37 @@ entry:
; CHECK-DISABLE: if [[REG2]] > [[REG1]] goto
lor.lhs.false: ; preds = %entry
- %2 = load i32, i32* %ret, align 4, !tbaa !2
- %cmp1 = icmp sgt i32 %2, 7
+ %1 = load i32, ptr %ret, align 4, !tbaa !2
+ %cmp1 = icmp sgt i32 %1, 7
br i1 %cmp1, label %if.then, label %if.end
if.then: ; preds = %lor.lhs.false, %entry
- store i32 0, i32* %retval, align 4
- store i32 1, i32* %cleanup.dest.slot, align 4
+ store i32 0, ptr %retval, align 4
+ store i32 1, ptr %cleanup.dest.slot, align 4
br label %cleanup
if.end: ; preds = %lor.lhs.false
- %3 = load i32, i32* %ret, align 4, !tbaa !2
- %call2 = call i32 @bar(i32 %3)
- store i32 %call2, i32* %retval, align 4
- store i32 1, i32* %cleanup.dest.slot, align 4
+ %2 = load i32, ptr %ret, align 4, !tbaa !2
+ %call2 = call i32 @bar(i32 %2)
+ store i32 %call2, ptr %retval, align 4
+ store i32 1, ptr %cleanup.dest.slot, align 4
br label %cleanup
cleanup: ; preds = %if.end, %if.then
- %4 = bitcast i32* %ret to i8*
- call void @llvm.lifetime.end.p0i8(i64 4, i8* %4) #3
- %5 = load i32, i32* %retval, align 4
- ret i32 %5
+ call void @llvm.lifetime.end.p0(i64 4, ptr %ret) #3
+ %3 = load i32, ptr %retval, align 4
+ ret i32 %3
}
; Function Attrs: argmemonly nounwind willreturn
-declare void @llvm.lifetime.start.p0i8(i64 immarg, i8* nocapture) #1
+declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
declare dso_local i32 @foo(...) #2
declare dso_local i32 @bar(i32) #2
; Function Attrs: argmemonly nounwind willreturn
-declare void @llvm.lifetime.end.p0i8(i64 immarg, i8* nocapture) #1
+declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nounwind "disable-tail-calls"="false" "frame-pointer"="all" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
attributes #1 = { argmemonly nounwind willreturn }
diff --git a/llvm/test/CodeGen/BPF/adjust-opt-icmp2.ll b/llvm/test/CodeGen/BPF/adjust-opt-icmp2.ll
index 61071f50d8506..cfc9e886653a2 100644
--- a/llvm/test/CodeGen/BPF/adjust-opt-icmp2.ll
+++ b/llvm/test/CodeGen/BPF/adjust-opt-icmp2.ll
@@ -23,12 +23,11 @@ entry:
%retval = alloca i32, align 4
%ret = alloca i32, align 4
%cleanup.dest.slot = alloca i32, align 4
- %0 = bitcast i32* %ret to i8*
- call void @llvm.lifetime.start.p0i8(i64 4, i8* %0) #3
- %call = call i32 bitcast (i32 (...)* @foo to i32 ()*)()
- store i32 %call, i32* %ret, align 4, !tbaa !2
- %1 = load i32, i32* %ret, align 4, !tbaa !2
- %cmp = icmp sle i32 %1, 0
+ call void @llvm.lifetime.start.p0(i64 4, ptr %ret) #3
+ %call = call i32 @foo()
+ store i32 %call, ptr %ret, align 4, !tbaa !2
+ %0 = load i32, ptr %ret, align 4, !tbaa !2
+ %cmp = icmp sle i32 %0, 0
br i1 %cmp, label %if.then, label %if.end
; CHECK: [[REG1:r[0-9]+]] <<= 32
@@ -44,43 +43,42 @@ entry:
; CHECK-DISABLE: if [[REG2]] > [[REG1]] goto
if.then: ; preds = %entry
- store i32 0, i32* %retval, align 4
- store i32 1, i32* %cleanup.dest.slot, align 4
+ store i32 0, ptr %retval, align 4
+ store i32 1, ptr %cleanup.dest.slot, align 4
br label %cleanup
if.end: ; preds = %entry
- %2 = load i32, i32* %ret, align 4, !tbaa !2
- %cmp1 = icmp sgt i32 %2, 7
+ %1 = load i32, ptr %ret, align 4, !tbaa !2
+ %cmp1 = icmp sgt i32 %1, 7
br i1 %cmp1, label %if.then2, label %if.end3
if.then2: ; preds = %if.end
- store i32 0, i32* %retval, align 4
- store i32 1, i32* %cleanup.dest.slot, align 4
+ store i32 0, ptr %retval, align 4
+ store i32 1, ptr %cleanup.dest.slot, align 4
br label %cleanup
if.end3: ; preds = %if.end
- %3 = load i32, i32* %ret, align 4, !tbaa !2
- %call4 = call i32 @bar(i32 %3)
- store i32 %call4, i32* %retval, align 4
- store i32 1, i32* %cleanup.dest.slot, align 4
+ %2 = load i32, ptr %ret, align 4, !tbaa !2
+ %call4 = call i32 @bar(i32 %2)
+ store i32 %call4, ptr %retval, align 4
+ store i32 1, ptr %cleanup.dest.slot, align 4
br label %cleanup
cleanup: ; preds = %if.end3, %if.then2, %if.then
- %4 = bitcast i32* %ret to i8*
- call void @llvm.lifetime.end.p0i8(i64 4, i8* %4) #3
- %5 = load i32, i32* %retval, align 4
- ret i32 %5
+ call void @llvm.lifetime.end.p0(i64 4, ptr %ret) #3
+ %3 = load i32, ptr %retval, align 4
+ ret i32 %3
}
; Function Attrs: argmemonly nounwind willreturn
-declare void @llvm.lifetime.start.p0i8(i64 immarg, i8* nocapture) #1
+declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
declare dso_local i32 @foo(...) #2
declare dso_local i32 @bar(i32) #2
; Function Attrs: argmemonly nounwind willreturn
-declare void @llvm.lifetime.end.p0i8(i64 immarg, i8* nocapture) #1
+declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nounwind "disable-tail-calls"="false" "frame-pointer"="all" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
attributes #1 = { argmemonly nounwind willreturn }
diff --git a/llvm/test/CodeGen/BPF/adjust-opt-icmp3.ll b/llvm/test/CodeGen/BPF/adjust-opt-icmp3.ll
index 4df88c70bb35d..5b81a01e51835 100644
--- a/llvm/test/CodeGen/BPF/adjust-opt-icmp3.ll
+++ b/llvm/test/CodeGen/BPF/adjust-opt-icmp3.ll
@@ -20,22 +20,22 @@ define dso_local i32 @test1(i64 %a) #0 {
entry:
%retval = alloca i32, align 4
%a.addr = alloca i64, align 8
- store i64 %a, i64* %a.addr, align 8, !tbaa !3
- %0 = load i64, i64* %a.addr, align 8, !tbaa !3
+ store i64 %a, ptr %a.addr, align 8, !tbaa !3
+ %0 = load i64, ptr %a.addr, align 8, !tbaa !3
%conv = trunc i64 %0 to i32
%cmp = icmp ule i32 %conv, 3
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
- store i32 2, i32* %retval, align 4
+ store i32 2, ptr %retval, align 4
br label %return
if.end: ; preds = %entry
- store i32 3, i32* %retval, align 4
+ store i32 3, ptr %retval, align 4
br label %return
return: ; preds = %if.end, %if.then
- %1 = load i32, i32* %retval, align 4
+ %1 = load i32, ptr %retval, align 4
ret i32 %1
}
@@ -48,22 +48,22 @@ define dso_local i32 @test2(i64 %a) #0 {
entry:
%retval = alloca i32, align 4
%a.addr = alloca i64, align 8
- store i64 %a, i64* %a.addr, align 8, !tbaa !3
- %0 = load i64, i64* %a.addr, align 8, !tbaa !3
+ store i64 %a, ptr %a.addr, align 8, !tbaa !3
+ %0 = load i64, ptr %a.addr, align 8, !tbaa !3
%conv = trunc i64 %0 to i32
%cmp = icmp ult i32 %conv, 4
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
- store i32 2, i32* %retval, align 4
+ store i32 2, ptr %retval, align 4
br label %return
if.end: ; preds = %entry
- store i32 3, i32* %retval, align 4
+ store i32 3, ptr %retval, align 4
br label %return
return: ; preds = %if.end, %if.then
- %1 = load i32, i32* %retval, align 4
+ %1 = load i32, ptr %retval, align 4
ret i32 %1
}
diff --git a/llvm/test/CodeGen/BPF/adjust-opt-icmp4.ll b/llvm/test/CodeGen/BPF/adjust-opt-icmp4.ll
index efdab8c4c70fe..0c2b7cb9db9f3 100644
--- a/llvm/test/CodeGen/BPF/adjust-opt-icmp4.ll
+++ b/llvm/test/CodeGen/BPF/adjust-opt-icmp4.ll
@@ -20,22 +20,22 @@ define dso_local i32 @test1(i64 %a) #0 {
entry:
%retval = alloca i32, align 4
%a.addr = alloca i64, align 8
- store i64 %a, i64* %a.addr, align 8, !tbaa !3
- %0 = load i64, i64* %a.addr, align 8, !tbaa !3
+ store i64 %a, ptr %a.addr, align 8, !tbaa !3
+ %0 = load i64, ptr %a.addr, align 8, !tbaa !3
%conv = trunc i64 %0 to i32
%cmp = icmp ugt i32 %conv, 3
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
- store i32 2, i32* %retval, align 4
+ store i32 2, ptr %retval, align 4
br label %return
if.end: ; preds = %entry
- store i32 3, i32* %retval, align 4
+ store i32 3, ptr %retval, align 4
br label %return
return: ; preds = %if.end, %if.then
- %1 = load i32, i32* %retval, align 4
+ %1 = load i32, ptr %retval, align 4
ret i32 %1
}
@@ -48,22 +48,22 @@ define dso_local i32 @test2(i64 %a) #0 {
entry:
%retval = alloca i32, align 4
%a.addr = alloca i64, align 8
- store i64 %a, i64* %a.addr, align 8, !tbaa !3
- %0 = load i64, i64* %a.addr, align 8, !tbaa !3
+ store i64 %a, ptr %a.addr, align 8, !tbaa !3
+ %0 = load i64, ptr %a.addr, align 8, !tbaa !3
%conv = trunc i64 %0 to i32
%cmp = icmp uge i32 %conv, 4
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
- store i32 2, i32* %retval, align 4
+ store i32 2, ptr %retval, align 4
br label %return
if.end: ; preds = %entry
- store i32 3, i32* %retval, align 4
+ store i32 3, ptr %retval, align 4
br label %return
return: ; preds = %if.end, %if.then
- %1 = load i32, i32* %retval, align 4
+ %1 = load i32, ptr %retval, align 4
ret i32 %1
}
diff --git a/llvm/test/CodeGen/BPF/adjust-opt-icmp5.ll b/llvm/test/CodeGen/BPF/adjust-opt-icmp5.ll
index 5aa8c7eadbf3b..2f167a355d862 100644
--- a/llvm/test/CodeGen/BPF/adjust-opt-icmp5.ll
+++ b/llvm/test/CodeGen/BPF/adjust-opt-icmp5.ll
@@ -14,35 +14,35 @@
; clang -target bpf -O2 -S -emit-llvm -Xclang -disable-llvm-passes test.c
; Function Attrs: nounwind
-define dso_local i32 @test(i32* noundef %p) #0 {
+define dso_local i32 @test(ptr noundef %p) #0 {
entry:
%retval = alloca i32, align 4
- %p.addr = alloca i32*, align 8
- store i32* %p, i32** %p.addr, align 8, !tbaa !3
- %0 = load i32*, i32** %p.addr, align 8, !tbaa !3
- %1 = load i32, i32* %0, align 4, !tbaa !7
+ %p.addr = alloca ptr, align 8
+ store ptr %p, ptr %p.addr, align 8, !tbaa !3
+ %0 = load ptr, ptr %p.addr, align 8, !tbaa !3
+ %1 = load i32, ptr %0, align 4, !tbaa !7
%cmp = icmp sle i32 %1, 0
br i1 %cmp, label %if.then, label %lor.lhs.false
lor.lhs.false: ; preds = %entry
- %2 = load i32*, i32** %p.addr, align 8, !tbaa !3
- %3 = load i32, i32* %2, align 4, !tbaa !7
+ %2 = load ptr, ptr %p.addr, align 8, !tbaa !3
+ %3 = load i32, ptr %2, align 4, !tbaa !7
%cmp1 = icmp sge i32 %3, 7
br i1 %cmp1, label %if.then, label %if.end
if.then: ; preds = %lor.lhs.false, %entry
- store i32 0, i32* %retval, align 4
+ store i32 0, ptr %retval, align 4
br label %return
if.end: ; preds = %lor.lhs.false
- %4 = load i32*, i32** %p.addr, align 8, !tbaa !3
- %5 = load i32, i32* %4, align 4, !tbaa !7
+ %4 = load ptr, ptr %p.addr, align 8, !tbaa !3
+ %5 = load i32, ptr %4, align 4, !tbaa !7
%call = call i32 @bar(i32 noundef %5)
- store i32 %call, i32* %retval, align 4
+ store i32 %call, ptr %retval, align 4
br label %return
return: ; preds = %if.end, %if.then
- %6 = load i32, i32* %retval, align 4
+ %6 = load i32, ptr %retval, align 4
ret i32 %6
}
diff --git a/llvm/test/CodeGen/BPF/adjust-opt-icmp6.ll b/llvm/test/CodeGen/BPF/adjust-opt-icmp6.ll
index f6fbc8cfa8503..99815c01f1afa 100644
--- a/llvm/test/CodeGen/BPF/adjust-opt-icmp6.ll
+++ b/llvm/test/CodeGen/BPF/adjust-opt-icmp6.ll
@@ -14,35 +14,35 @@
; clang -target bpf -O2 -S -emit-llvm -Xclang -disable-llvm-passes test.c
; Function Attrs: nounwind
-define dso_local i32 @test(i32* noundef %p) #0 {
+define dso_local i32 @test(ptr noundef %p) #0 {
entry:
%retval = alloca i32, align 4
- %p.addr = alloca i32*, align 8
- store i32* %p, i32** %p.addr, align 8, !tbaa !3
- %0 = load i32*, i32** %p.addr, align 8, !tbaa !3
- %1 = load i32, i32* %0, align 4, !tbaa !7
+ %p.addr = alloca ptr, align 8
+ store ptr %p, ptr %p.addr, align 8, !tbaa !3
+ %0 = load ptr, ptr %p.addr, align 8, !tbaa !3
+ %1 = load i32, ptr %0, align 4, !tbaa !7
%cmp = icmp ule i32 %1, 1
br i1 %cmp, label %if.then, label %lor.lhs.false
lor.lhs.false: ; preds = %entry
- %2 = load i32*, i32** %p.addr, align 8, !tbaa !3
- %3 = load i32, i32* %2, align 4, !tbaa !7
+ %2 = load ptr, ptr %p.addr, align 8, !tbaa !3
+ %3 = load i32, ptr %2, align 4, !tbaa !7
%cmp1 = icmp uge i32 %3, 7
br i1 %cmp1, label %if.then, label %if.end
if.then: ; preds = %lor.lhs.false, %entry
- store i32 0, i32* %retval, align 4
+ store i32 0, ptr %retval, align 4
br label %return
if.end: ; preds = %lor.lhs.false
- %4 = load i32*, i32** %p.addr, align 8, !tbaa !3
- %5 = load i32, i32* %4, align 4, !tbaa !7
+ %4 = load ptr, ptr %p.addr, align 8, !tbaa !3
+ %5 = load i32, ptr %4, align 4, !tbaa !7
%call = call i32 @bar(i32 noundef %5)
- store i32 %call, i32* %retval, align 4
+ store i32 %call, ptr %retval, align 4
br label %return
return: ; preds = %if.end, %if.then
- %6 = load i32, i32* %retval, align 4
+ %6 = load i32, ptr %retval, align 4
ret i32 %6
}
diff --git a/llvm/test/CodeGen/BPF/adjust-opt-speculative1.ll b/llvm/test/CodeGen/BPF/adjust-opt-speculative1.ll
index afb820c2d6366..5a38f5ec19695 100644
--- a/llvm/test/CodeGen/BPF/adjust-opt-speculative1.ll
+++ b/llvm/test/CodeGen/BPF/adjust-opt-speculative1.ll
@@ -5,7 +5,7 @@
;
; Source:
; unsigned long foo();
-; void *test(void *p) {
+; ptr test(ptr p) {
; unsigned long ret = foo();
; if (ret <= 7)
; p += ret;
@@ -15,31 +15,29 @@
; clang -target bpf -O2 -S -emit-llvm -Xclang -disable-llvm-passes test.c
; Function Attrs: nounwind
-define dso_local i8* @test(i8* %p) #0 {
+define dso_local ptr @test(ptr %p) #0 {
entry:
- %p.addr = alloca i8*, align 8
+ %p.addr = alloca ptr, align 8
%ret = alloca i64, align 8
- store i8* %p, i8** %p.addr, align 8, !tbaa !2
- %0 = bitcast i64* %ret to i8*
- call void @llvm.lifetime.start.p0i8(i64 8, i8* %0) #3
- %call = call i64 bitcast (i64 (...)* @foo to i64 ()*)()
- store i64 %call, i64* %ret, align 8, !tbaa !6
- %1 = load i64, i64* %ret, align 8, !tbaa !6
- %cmp = icmp ule i64 %1, 7
+ store ptr %p, ptr %p.addr, align 8, !tbaa !2
+ call void @llvm.lifetime.start.p0(i64 8, ptr %ret) #3
+ %call = call i64 @foo()
+ store i64 %call, ptr %ret, align 8, !tbaa !6
+ %0 = load i64, ptr %ret, align 8, !tbaa !6
+ %cmp = icmp ule i64 %0, 7
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
- %2 = load i64, i64* %ret, align 8, !tbaa !6
- %3 = load i8*, i8** %p.addr, align 8, !tbaa !2
- %add.ptr = getelementptr i8, i8* %3, i64 %2
- store i8* %add.ptr, i8** %p.addr, align 8, !tbaa !2
+ %1 = load i64, ptr %ret, align 8, !tbaa !6
+ %2 = load ptr, ptr %p.addr, align 8, !tbaa !2
+ %add.ptr = getelementptr i8, ptr %2, i64 %1
+ store ptr %add.ptr, ptr %p.addr, align 8, !tbaa !2
br label %if.end
if.end: ; preds = %if.then, %entry
- %4 = load i8*, i8** %p.addr, align 8, !tbaa !2
- %5 = bitcast i64* %ret to i8*
- call void @llvm.lifetime.end.p0i8(i64 8, i8* %5) #3
- ret i8* %4
+ %3 = load ptr, ptr %p.addr, align 8, !tbaa !2
+ call void @llvm.lifetime.end.p0(i64 8, ptr %ret) #3
+ ret ptr %3
}
; CHECK-COMMON: [[REG6:r[0-9]+]] = r1
; CHECK-COMMON: call foo
@@ -59,12 +57,12 @@ if.end: ; preds = %if.then, %entry
; CHECK-COMMON: exit
; Function Attrs: argmemonly nounwind willreturn
-declare void @llvm.lifetime.start.p0i8(i64 immarg, i8* nocapture) #1
+declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
declare dso_local i64 @foo(...) #2
; Function Attrs: argmemonly nounwind willreturn
-declare void @llvm.lifetime.end.p0i8(i64 immarg, i8* nocapture) #1
+declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nounwind "disable-tail-calls"="false" "frame-pointer"="all" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
attributes #1 = { argmemonly nounwind willreturn }
diff --git a/llvm/test/CodeGen/BPF/adjust-opt-speculative2.ll b/llvm/test/CodeGen/BPF/adjust-opt-speculative2.ll
index b1a53d18271e0..2b841865d7243 100644
--- a/llvm/test/CodeGen/BPF/adjust-opt-speculative2.ll
+++ b/llvm/test/CodeGen/BPF/adjust-opt-speculative2.ll
@@ -5,7 +5,7 @@
;
; Source:
; unsigned foo();
-; void *test(void *p) {
+; ptr test(ptr p) {
; unsigned ret = foo();
; if (ret <= 7)
; p += ret;
@@ -15,32 +15,30 @@
; clang -target bpf -O2 -S -emit-llvm -Xclang -disable-llvm-passes test.c
; Function Attrs: nounwind
-define dso_local i8* @test(i8* %p) #0 {
+define dso_local ptr @test(ptr %p) #0 {
entry:
- %p.addr = alloca i8*, align 8
+ %p.addr = alloca ptr, align 8
%ret = alloca i32, align 4
- store i8* %p, i8** %p.addr, align 8, !tbaa !2
- %0 = bitcast i32* %ret to i8*
- call void @llvm.lifetime.start.p0i8(i64 4, i8* %0) #3
- %call = call i32 bitcast (i32 (...)* @foo to i32 ()*)()
- store i32 %call, i32* %ret, align 4, !tbaa !6
- %1 = load i32, i32* %ret, align 4, !tbaa !6
- %cmp = icmp ule i32 %1, 7
+ store ptr %p, ptr %p.addr, align 8, !tbaa !2
+ call void @llvm.lifetime.start.p0(i64 4, ptr %ret) #3
+ %call = call i32 @foo()
+ store i32 %call, ptr %ret, align 4, !tbaa !6
+ %0 = load i32, ptr %ret, align 4, !tbaa !6
+ %cmp = icmp ule i32 %0, 7
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
- %2 = load i32, i32* %ret, align 4, !tbaa !6
- %3 = load i8*, i8** %p.addr, align 8, !tbaa !2
- %idx.ext = zext i32 %2 to i64
- %add.ptr = getelementptr i8, i8* %3, i64 %idx.ext
- store i8* %add.ptr, i8** %p.addr, align 8, !tbaa !2
+ %1 = load i32, ptr %ret, align 4, !tbaa !6
+ %2 = load ptr, ptr %p.addr, align 8, !tbaa !2
+ %idx.ext = zext i32 %1 to i64
+ %add.ptr = getelementptr i8, ptr %2, i64 %idx.ext
+ store ptr %add.ptr, ptr %p.addr, align 8, !tbaa !2
br label %if.end
if.end: ; preds = %if.then, %entry
- %4 = load i8*, i8** %p.addr, align 8, !tbaa !2
- %5 = bitcast i32* %ret to i8*
- call void @llvm.lifetime.end.p0i8(i64 4, i8* %5) #3
- ret i8* %4
+ %3 = load ptr, ptr %p.addr, align 8, !tbaa !2
+ call void @llvm.lifetime.end.p0(i64 4, ptr %ret) #3
+ ret ptr %3
}
; CHECK-COMMON: [[REG6:r[0-9]+]] = r1
@@ -68,12 +66,12 @@ if.end: ; preds = %if.then, %entry
; CHECK-COMMON: exit
; Function Attrs: argmemonly nounwind willreturn
-declare void @llvm.lifetime.start.p0i8(i64 immarg, i8* nocapture) #1
+declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
declare dso_local i32 @foo(...) #2
; Function Attrs: argmemonly nounwind willreturn
-declare void @llvm.lifetime.end.p0i8(i64 immarg, i8* nocapture) #1
+declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nounwind "disable-tail-calls"="false" "frame-pointer"="all" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
attributes #1 = { argmemonly nounwind willreturn }
diff --git a/llvm/test/CodeGen/BPF/atomics.ll b/llvm/test/CodeGen/BPF/atomics.ll
index 01c8920c93ece..096d14c869477 100644
--- a/llvm/test/CodeGen/BPF/atomics.ll
+++ b/llvm/test/CodeGen/BPF/atomics.ll
@@ -6,9 +6,9 @@
; CHECK: encoding: [0xc3,0x21
; CHECK-V3: lock *(u32 *)(r1 + 0) += w2
; CHECK-V3: encoding: [0xc3,0x21,0x00,0x00,0x00,0x00,0x00,0x00]
-define void @test_load_add_32(i32* %p, i32 zeroext %v) {
+define void @test_load_add_32(ptr %p, i32 zeroext %v) {
entry:
- atomicrmw add i32* %p, i32 %v seq_cst
+ atomicrmw add ptr %p, i32 %v seq_cst
ret void
}
@@ -17,8 +17,8 @@ entry:
; CHECK: encoding: [0xdb,0x21
; CHECK-V3: lock *(u64 *)(r1 + 0) += r2
; CHECK-V3: encoding: [0xdb,0x21,0x00,0x00,0x00,0x00,0x00,0x00]
-define void @test_load_add_64(i64* %p, i64 zeroext %v) {
+define void @test_load_add_64(ptr %p, i64 zeroext %v) {
entry:
- atomicrmw add i64* %p, i64 %v seq_cst
+ atomicrmw add ptr %p, i64 %v seq_cst
ret void
}
diff --git a/llvm/test/CodeGen/BPF/atomics_2.ll b/llvm/test/CodeGen/BPF/atomics_2.ll
index 55e9a0c78a15f..37a9d8322938c 100644
--- a/llvm/test/CodeGen/BPF/atomics_2.ll
+++ b/llvm/test/CodeGen/BPF/atomics_2.ll
@@ -67,9 +67,9 @@
; CHECK: w0 = w2
; CHECK: w0 = atomic_fetch_add((u32 *)(r1 + 0), w0)
; CHECK: encoding: [0xc3,0x01,0x00,0x00,0x01,0x00,0x00,0x00]
-define dso_local i32 @test_load_add_32(i32* nocapture %p, i32 %v) local_unnamed_addr {
+define dso_local i32 @test_load_add_32(ptr nocapture %p, i32 %v) local_unnamed_addr {
entry:
- %0 = atomicrmw add i32* %p, i32 %v seq_cst
+ %0 = atomicrmw add ptr %p, i32 %v seq_cst
ret i32 %0
}
@@ -77,9 +77,9 @@ entry:
; CHECK: r0 = r2
; CHECK: r0 = atomic_fetch_add((u64 *)(r1 + 0), r0)
; CHECK: encoding: [0xdb,0x01,0x00,0x00,0x01,0x00,0x00,0x00]
-define dso_local i32 @test_load_add_64(i64* nocapture %p, i64 %v) local_unnamed_addr {
+define dso_local i32 @test_load_add_64(ptr nocapture %p, i64 %v) local_unnamed_addr {
entry:
- %0 = atomicrmw add i64* %p, i64 %v seq_cst
+ %0 = atomicrmw add ptr %p, i64 %v seq_cst
%conv = trunc i64 %0 to i32
ret i32 %conv
}
@@ -89,9 +89,9 @@ entry:
; CHECK: w0 = -w0
; CHECK: w0 = atomic_fetch_add((u32 *)(r1 + 0), w0)
; CHECK: encoding: [0xc3,0x01,0x00,0x00,0x01,0x00,0x00,0x00]
-define dso_local i32 @test_load_sub_32(i32* nocapture %p, i32 %v) local_unnamed_addr {
+define dso_local i32 @test_load_sub_32(ptr nocapture %p, i32 %v) local_unnamed_addr {
entry:
- %0 = atomicrmw sub i32* %p, i32 %v seq_cst
+ %0 = atomicrmw sub ptr %p, i32 %v seq_cst
ret i32 %0
}
@@ -100,9 +100,9 @@ entry:
; CHECK: r0 = -r0
; CHECK: r0 = atomic_fetch_add((u64 *)(r1 + 0), r0)
; CHECK: encoding: [0xdb,0x01,0x00,0x00,0x01,0x00,0x00,0x00]
-define dso_local i32 @test_load_sub_64(i64* nocapture %p, i64 %v) local_unnamed_addr {
+define dso_local i32 @test_load_sub_64(ptr nocapture %p, i64 %v) local_unnamed_addr {
entry:
- %0 = atomicrmw sub i64* %p, i64 %v seq_cst
+ %0 = atomicrmw sub ptr %p, i64 %v seq_cst
%conv = trunc i64 %0 to i32
ret i32 %conv
}
@@ -111,9 +111,9 @@ entry:
; CHECK: w0 = w2
; CHECK: w0 = xchg32_32(r1 + 0, w0)
; CHECK: encoding: [0xc3,0x01,0x00,0x00,0xe1,0x00,0x00,0x00]
-define dso_local i32 @test_xchg_32(i32* nocapture %p, i32 %v) local_unnamed_addr {
+define dso_local i32 @test_xchg_32(ptr nocapture %p, i32 %v) local_unnamed_addr {
entry:
- %0 = atomicrmw xchg i32* %p, i32 %v seq_cst
+ %0 = atomicrmw xchg ptr %p, i32 %v seq_cst
ret i32 %0
}
@@ -121,9 +121,9 @@ entry:
; CHECK: r0 = r2
; CHECK: r0 = xchg_64(r1 + 0, r0)
; CHECK: encoding: [0xdb,0x01,0x00,0x00,0xe1,0x00,0x00,0x00]
-define dso_local i32 @test_xchg_64(i64* nocapture %p, i64 %v) local_unnamed_addr {
+define dso_local i32 @test_xchg_64(ptr nocapture %p, i64 %v) local_unnamed_addr {
entry:
- %0 = atomicrmw xchg i64* %p, i64 %v seq_cst
+ %0 = atomicrmw xchg ptr %p, i64 %v seq_cst
%conv = trunc i64 %0 to i32
ret i32 %conv
}
@@ -132,9 +132,9 @@ entry:
; CHECK: w0 = w2
; CHECK: w0 = cmpxchg32_32(r1 + 0, w0, w3)
; CHECK: encoding: [0xc3,0x31,0x00,0x00,0xf1,0x00,0x00,0x00]
-define dso_local i32 @test_cas_32(i32* nocapture %p, i32 %old, i32 %new) local_unnamed_addr {
+define dso_local i32 @test_cas_32(ptr nocapture %p, i32 %old, i32 %new) local_unnamed_addr {
entry:
- %0 = cmpxchg i32* %p, i32 %old, i32 %new seq_cst seq_cst
+ %0 = cmpxchg ptr %p, i32 %old, i32 %new seq_cst seq_cst
%1 = extractvalue { i32, i1 } %0, 0
ret i32 %1
}
@@ -143,9 +143,9 @@ entry:
; CHECK: r0 = r2
; CHECK: r0 = cmpxchg_64(r1 + 0, r0, r3)
; CHECK: encoding: [0xdb,0x31,0x00,0x00,0xf1,0x00,0x00,0x00]
-define dso_local i64 @test_cas_64(i64* nocapture %p, i64 %old, i64 %new) local_unnamed_addr {
+define dso_local i64 @test_cas_64(ptr nocapture %p, i64 %old, i64 %new) local_unnamed_addr {
entry:
- %0 = cmpxchg i64* %p, i64 %old, i64 %new seq_cst seq_cst
+ %0 = cmpxchg ptr %p, i64 %old, i64 %new seq_cst seq_cst
%1 = extractvalue { i64, i1 } %0, 0
ret i64 %1
}
@@ -154,9 +154,9 @@ entry:
; CHECK: w0 = w2
; CHECK: w0 = atomic_fetch_and((u32 *)(r1 + 0), w0)
; CHECK: encoding: [0xc3,0x01,0x00,0x00,0x51,0x00,0x00,0x00]
-define dso_local i32 @test_load_and_32(i32* nocapture %p, i32 %v) local_unnamed_addr {
+define dso_local i32 @test_load_and_32(ptr nocapture %p, i32 %v) local_unnamed_addr {
entry:
- %0 = atomicrmw and i32* %p, i32 %v seq_cst
+ %0 = atomicrmw and ptr %p, i32 %v seq_cst
ret i32 %0
}
@@ -164,9 +164,9 @@ entry:
; CHECK: r0 = r2
; CHECK: r0 = atomic_fetch_and((u64 *)(r1 + 0), r0)
; CHECK: encoding: [0xdb,0x01,0x00,0x00,0x51,0x00,0x00,0x00]
-define dso_local i32 @test_load_and_64(i64* nocapture %p, i64 %v) local_unnamed_addr {
+define dso_local i32 @test_load_and_64(ptr nocapture %p, i64 %v) local_unnamed_addr {
entry:
- %0 = atomicrmw and i64* %p, i64 %v seq_cst
+ %0 = atomicrmw and ptr %p, i64 %v seq_cst
%conv = trunc i64 %0 to i32
ret i32 %conv
}
@@ -175,9 +175,9 @@ entry:
; CHECK: w0 = w2
; CHECK: w0 = atomic_fetch_or((u32 *)(r1 + 0), w0)
; CHECK: encoding: [0xc3,0x01,0x00,0x00,0x41,0x00,0x00,0x00]
-define dso_local i32 @test_load_or_32(i32* nocapture %p, i32 %v) local_unnamed_addr {
+define dso_local i32 @test_load_or_32(ptr nocapture %p, i32 %v) local_unnamed_addr {
entry:
- %0 = atomicrmw or i32* %p, i32 %v seq_cst
+ %0 = atomicrmw or ptr %p, i32 %v seq_cst
ret i32 %0
}
@@ -185,9 +185,9 @@ entry:
; CHECK: r0 = r2
; CHECK: r0 = atomic_fetch_or((u64 *)(r1 + 0), r0)
; CHECK: encoding: [0xdb,0x01,0x00,0x00,0x41,0x00,0x00,0x00]
-define dso_local i32 @test_load_or_64(i64* nocapture %p, i64 %v) local_unnamed_addr {
+define dso_local i32 @test_load_or_64(ptr nocapture %p, i64 %v) local_unnamed_addr {
entry:
- %0 = atomicrmw or i64* %p, i64 %v seq_cst
+ %0 = atomicrmw or ptr %p, i64 %v seq_cst
%conv = trunc i64 %0 to i32
ret i32 %conv
}
@@ -196,9 +196,9 @@ entry:
; CHECK: w0 = w2
; CHECK: w0 = atomic_fetch_xor((u32 *)(r1 + 0), w0)
; CHECK: encoding: [0xc3,0x01,0x00,0x00,0xa1,0x00,0x00,0x00]
-define dso_local i32 @test_load_xor_32(i32* nocapture %p, i32 %v) local_unnamed_addr {
+define dso_local i32 @test_load_xor_32(ptr nocapture %p, i32 %v) local_unnamed_addr {
entry:
- %0 = atomicrmw xor i32* %p, i32 %v seq_cst
+ %0 = atomicrmw xor ptr %p, i32 %v seq_cst
ret i32 %0
}
@@ -206,9 +206,9 @@ entry:
; CHECK: r0 = r2
; CHECK: r0 = atomic_fetch_xor((u64 *)(r1 + 0), r0)
; CHECK: encoding: [0xdb,0x01,0x00,0x00,0xa1,0x00,0x00,0x00]
-define dso_local i32 @test_load_xor_64(i64* nocapture %p, i64 %v) local_unnamed_addr {
+define dso_local i32 @test_load_xor_64(ptr nocapture %p, i64 %v) local_unnamed_addr {
entry:
- %0 = atomicrmw xor i64* %p, i64 %v seq_cst
+ %0 = atomicrmw xor ptr %p, i64 %v seq_cst
%conv = trunc i64 %0 to i32
ret i32 %conv
}
@@ -217,9 +217,9 @@ entry:
; CHECK: lock *(u32 *)(r1 + 0) ^= w2
; CHECK: encoding: [0xc3,0x21,0x00,0x00,0xa0,0x00,0x00,0x00]
; CHECK: w0 = 0
-define dso_local i32 @test_atomic_xor_32(i32* nocapture %p, i32 %v) local_unnamed_addr {
+define dso_local i32 @test_atomic_xor_32(ptr nocapture %p, i32 %v) local_unnamed_addr {
entry:
- %0 = atomicrmw xor i32* %p, i32 %v seq_cst
+ %0 = atomicrmw xor ptr %p, i32 %v seq_cst
ret i32 0
}
@@ -227,9 +227,9 @@ entry:
; CHECK: lock *(u64 *)(r1 + 0) ^= r2
; CHECK: encoding: [0xdb,0x21,0x00,0x00,0xa0,0x00,0x00,0x00]
; CHECK: w0 = 0
-define dso_local i32 @test_atomic_xor_64(i64* nocapture %p, i64 %v) local_unnamed_addr {
+define dso_local i32 @test_atomic_xor_64(ptr nocapture %p, i64 %v) local_unnamed_addr {
entry:
- %0 = atomicrmw xor i64* %p, i64 %v seq_cst
+ %0 = atomicrmw xor ptr %p, i64 %v seq_cst
ret i32 0
}
@@ -237,9 +237,9 @@ entry:
; CHECK: lock *(u64 *)(r1 + 0) &= r2
; CHECK: encoding: [0xdb,0x21,0x00,0x00,0x50,0x00,0x00,0x00]
; CHECK: w0 = 0
-define dso_local i32 @test_atomic_and_64(i64* nocapture %p, i64 %v) local_unnamed_addr {
+define dso_local i32 @test_atomic_and_64(ptr nocapture %p, i64 %v) local_unnamed_addr {
entry:
- %0 = atomicrmw and i64* %p, i64 %v seq_cst
+ %0 = atomicrmw and ptr %p, i64 %v seq_cst
ret i32 0
}
@@ -247,8 +247,8 @@ entry:
; CHECK: lock *(u64 *)(r1 + 0) |= r2
; CHECK: encoding: [0xdb,0x21,0x00,0x00,0x40,0x00,0x00,0x00]
; CHECK: w0 = 0
-define dso_local i32 @test_atomic_or_64(i64* nocapture %p, i64 %v) local_unnamed_addr {
+define dso_local i32 @test_atomic_or_64(ptr nocapture %p, i64 %v) local_unnamed_addr {
entry:
- %0 = atomicrmw or i64* %p, i64 %v seq_cst
+ %0 = atomicrmw or ptr %p, i64 %v seq_cst
ret i32 0
}
diff --git a/llvm/test/CodeGen/BPF/basictest.ll b/llvm/test/CodeGen/BPF/basictest.ll
index ac78c2af61c03..33f787aa6b05e 100644
--- a/llvm/test/CodeGen/BPF/basictest.ll
+++ b/llvm/test/CodeGen/BPF/basictest.ll
@@ -10,17 +10,17 @@ define i32 @test0(i32 %X) {
; CHECK-LABEL: store_imm:
; CHECK: *(u32 *)(r1 + 0) = r{{[03]}}
; CHECK: *(u32 *)(r2 + 4) = r{{[03]}}
-define i32 @store_imm(i32* %a, i32* %b) {
+define i32 @store_imm(ptr %a, ptr %b) {
entry:
- store i32 0, i32* %a, align 4
- %0 = getelementptr inbounds i32, i32* %b, i32 1
- store i32 0, i32* %0, align 4
+ store i32 0, ptr %a, align 4
+ %0 = getelementptr inbounds i32, ptr %b, i32 1
+ store i32 0, ptr %0, align 4
ret i32 0
}
@G = external global i8
define zeroext i8 @loadG() {
- %tmp = load i8, i8* @G
+ %tmp = load i8, ptr @G
ret i8 %tmp
; CHECK-LABEL: loadG:
; CHECK: r1 =
diff --git a/llvm/test/CodeGen/BPF/byval.ll b/llvm/test/CodeGen/BPF/byval.ll
index b8ae806c092ff..b7ff89fd3013a 100644
--- a/llvm/test/CodeGen/BPF/byval.ll
+++ b/llvm/test/CodeGen/BPF/byval.ll
@@ -8,20 +8,18 @@
define void @bar(i32 %a) #0 {
entry:
%.compoundliteral = alloca %struct.S, align 8
- %arrayinit.begin = getelementptr inbounds %struct.S, %struct.S* %.compoundliteral, i64 0, i32 0, i64 0
- store i32 1, i32* %arrayinit.begin, align 8
- %arrayinit.element = getelementptr inbounds %struct.S, %struct.S* %.compoundliteral, i64 0, i32 0, i64 1
- store i32 2, i32* %arrayinit.element, align 4
- %arrayinit.element2 = getelementptr inbounds %struct.S, %struct.S* %.compoundliteral, i64 0, i32 0, i64 2
- store i32 3, i32* %arrayinit.element2, align 8
- %arrayinit.start = getelementptr inbounds %struct.S, %struct.S* %.compoundliteral, i64 0, i32 0, i64 3
- %scevgep4 = bitcast i32* %arrayinit.start to i8*
- call void @llvm.memset.p0i8.i64(i8* align 4 %scevgep4, i8 0, i64 28, i1 false)
- call void @foo(i32 %a, %struct.S* byval(%struct.S) align 8 %.compoundliteral) #3
+ store i32 1, ptr %.compoundliteral, align 8
+ %arrayinit.element = getelementptr inbounds %struct.S, ptr %.compoundliteral, i64 0, i32 0, i64 1
+ store i32 2, ptr %arrayinit.element, align 4
+ %arrayinit.element2 = getelementptr inbounds %struct.S, ptr %.compoundliteral, i64 0, i32 0, i64 2
+ store i32 3, ptr %arrayinit.element2, align 8
+ %arrayinit.start = getelementptr inbounds %struct.S, ptr %.compoundliteral, i64 0, i32 0, i64 3
+ call void @llvm.memset.p0.i64(ptr align 4 %arrayinit.start, i8 0, i64 28, i1 false)
+ call void @foo(i32 %a, ptr byval(%struct.S) align 8 %.compoundliteral) #3
ret void
}
-declare void @foo(i32, %struct.S* byval(%struct.S) align 8) #1
+declare void @foo(i32, ptr byval(%struct.S) align 8) #1
; Function Attrs: nounwind
-declare void @llvm.memset.p0i8.i64(i8* nocapture, i8, i64, i1) #3
+declare void @llvm.memset.p0.i64(ptr nocapture, i8, i64, i1) #3
diff --git a/llvm/test/CodeGen/BPF/callx.ll b/llvm/test/CodeGen/BPF/callx.ll
index bb31e11898520..a015cf91a3788 100644
--- a/llvm/test/CodeGen/BPF/callx.ll
+++ b/llvm/test/CodeGen/BPF/callx.ll
@@ -3,7 +3,7 @@
; int test(int (*f)(void)) { return f(); }
; Function Attrs: nounwind
-define dso_local i32 @test(i32 ()* nocapture %f) local_unnamed_addr #0 {
+define dso_local i32 @test(ptr nocapture %f) local_unnamed_addr #0 {
entry:
%call = tail call i32 %f() #1
; CHECK: callx r{{[0-9]+}}
diff --git a/llvm/test/CodeGen/BPF/cc_args.ll b/llvm/test/CodeGen/BPF/cc_args.ll
index 020992a9fd51e..1034f8c8945d9 100644
--- a/llvm/test/CodeGen/BPF/cc_args.ll
+++ b/llvm/test/CodeGen/BPF/cc_args.ll
@@ -43,7 +43,7 @@ entry:
define void @f_i16(i16 %a) #0 {
; CHECK: f_i16:
; CHECK: *(u16 *)(r2 + 0) = r1 # encoding: [0x6b,0x12,0x00,0x00,0x00,0x00,0x00,0x00]
- store volatile i16 %a, i16* @g_i16, align 2
+ store volatile i16 %a, ptr @g_i16, align 2
ret void
}
@@ -51,7 +51,7 @@ define void @f_i32(i32 %a) #0 {
; CHECK: f_i32:
; CHECK: *(u16 *)(r2 + 0) = r1 # encoding: [0x6b,0x12,0x00,0x00,0x00,0x00,0x00,0x00]
; CHECK: *(u16 *)(r2 + 2) = r1 # encoding: [0x6b,0x12,0x02,0x00,0x00,0x00,0x00,0x00]
- store volatile i32 %a, i32* @g_i32, align 2
+ store volatile i32 %a, ptr @g_i32, align 2
ret void
}
@@ -59,37 +59,37 @@ define void @f_i64(i64 %a) #0 {
; CHECK: f_i64:
; CHECK: *(u32 *)(r2 + 0) = r1
; CHECK: *(u32 *)(r2 + 4) = r1 # encoding: [0x63,0x12,0x04,0x00,0x00,0x00,0x00,0x00]
- store volatile i64 %a, i64* @g_i64, align 2
+ store volatile i64 %a, ptr @g_i64, align 2
ret void
}
define void @f_i32_i32(i32 %a, i32 %b) #0 {
; CHECK: f_i32_i32:
; CHECK: *(u32 *)(r3 + 0) = r1
- store volatile i32 %a, i32* @g_i32, align 4
+ store volatile i32 %a, ptr @g_i32, align 4
; CHECK: *(u32 *)(r3 + 0) = r2
- store volatile i32 %b, i32* @g_i32, align 4
+ store volatile i32 %b, ptr @g_i32, align 4
ret void
}
define void @f_i16_i32_i16(i16 %a, i32 %b, i16 %c) #0 {
; CHECK: f_i16_i32_i16:
; CHECK: *(u16 *)(r4 + 0) = r1
- store volatile i16 %a, i16* @g_i16, align 2
+ store volatile i16 %a, ptr @g_i16, align 2
; CHECK: *(u32 *)(r1 + 0) = r2
- store volatile i32 %b, i32* @g_i32, align 4
+ store volatile i32 %b, ptr @g_i32, align 4
; CHECK: *(u16 *)(r4 + 0) = r3
- store volatile i16 %c, i16* @g_i16, align 2
+ store volatile i16 %c, ptr @g_i16, align 2
ret void
}
define void @f_i16_i64_i16(i16 %a, i64 %b, i16 %c) #0 {
; CHECK: f_i16_i64_i16:
; CHECK: *(u16 *)(r4 + 0) = r1
- store volatile i16 %a, i16* @g_i16, align 2
+ store volatile i16 %a, ptr @g_i16, align 2
; CHECK: *(u64 *)(r1 + 0) = r2 # encoding: [0x7b,0x21,0x00,0x00,0x00,0x00,0x00,0x00]
- store volatile i64 %b, i64* @g_i64, align 8
+ store volatile i64 %b, ptr @g_i64, align 8
; CHECK: *(u16 *)(r4 + 0) = r3
- store volatile i16 %c, i16* @g_i16, align 2
+ store volatile i16 %c, ptr @g_i16, align 2
ret void
}
diff --git a/llvm/test/CodeGen/BPF/cc_args_be.ll b/llvm/test/CodeGen/BPF/cc_args_be.ll
index 469556f6c78d1..bf3457e643b9c 100644
--- a/llvm/test/CodeGen/BPF/cc_args_be.ll
+++ b/llvm/test/CodeGen/BPF/cc_args_be.ll
@@ -44,7 +44,7 @@ entry:
define void @f_i16(i16 %a) #0 {
; CHECK: f_i16:
; CHECK: *(u16 *)(r2 + 0) = r1 # encoding: [0x6b,0x21,0x00,0x00,0x00,0x00,0x00,0x00]
- store volatile i16 %a, i16* @g_i16, align 2
+ store volatile i16 %a, ptr @g_i16, align 2
ret void
}
@@ -52,7 +52,7 @@ define void @f_i32(i32 %a) #0 {
; CHECK: f_i32:
; CHECK: *(u16 *)(r2 + 2) = r1 # encoding: [0x6b,0x21,0x00,0x02,0x00,0x00,0x00,0x00]
; CHECK: *(u16 *)(r2 + 0) = r1 # encoding: [0x6b,0x21,0x00,0x00,0x00,0x00,0x00,0x00]
- store volatile i32 %a, i32* @g_i32, align 2
+ store volatile i32 %a, ptr @g_i32, align 2
ret void
}
@@ -60,37 +60,37 @@ define void @f_i64(i64 %a) #0 {
; CHECK: f_i64:
; CHECK: *(u32 *)(r2 + 4) = r1 # encoding: [0x63,0x21,0x00,0x04,0x00,0x00,0x00,0x00]
; CHECK: *(u32 *)(r2 + 0) = r1
- store volatile i64 %a, i64* @g_i64, align 2
+ store volatile i64 %a, ptr @g_i64, align 2
ret void
}
define void @f_i32_i32(i32 %a, i32 %b) #0 {
; CHECK: f_i32_i32:
; CHECK: *(u32 *)(r3 + 0) = r1
- store volatile i32 %a, i32* @g_i32, align 4
+ store volatile i32 %a, ptr @g_i32, align 4
; CHECK: *(u32 *)(r3 + 0) = r2
- store volatile i32 %b, i32* @g_i32, align 4
+ store volatile i32 %b, ptr @g_i32, align 4
ret void
}
define void @f_i16_i32_i16(i16 %a, i32 %b, i16 %c) #0 {
; CHECK: f_i16_i32_i16:
; CHECK: *(u16 *)(r4 + 0) = r1
- store volatile i16 %a, i16* @g_i16, align 2
+ store volatile i16 %a, ptr @g_i16, align 2
; CHECK: *(u32 *)(r1 + 0) = r2
- store volatile i32 %b, i32* @g_i32, align 4
+ store volatile i32 %b, ptr @g_i32, align 4
; CHECK: *(u16 *)(r4 + 0) = r3
- store volatile i16 %c, i16* @g_i16, align 2
+ store volatile i16 %c, ptr @g_i16, align 2
ret void
}
define void @f_i16_i64_i16(i16 %a, i64 %b, i16 %c) #0 {
; CHECK: f_i16_i64_i16:
; CHECK: *(u16 *)(r4 + 0) = r1
- store volatile i16 %a, i16* @g_i16, align 2
+ store volatile i16 %a, ptr @g_i16, align 2
; CHECK: *(u64 *)(r1 + 0) = r2 # encoding: [0x7b,0x12,0x00,0x00,0x00,0x00,0x00,0x00]
- store volatile i64 %b, i64* @g_i64, align 8
+ store volatile i64 %b, ptr @g_i64, align 8
; CHECK: *(u16 *)(r4 + 0) = r3
- store volatile i16 %c, i16* @g_i16, align 2
+ store volatile i16 %c, ptr @g_i16, align 2
ret void
}
diff --git a/llvm/test/CodeGen/BPF/cc_ret.ll b/llvm/test/CodeGen/BPF/cc_ret.ll
index 73e3556c63ed1..a9f6410d6ca08 100644
--- a/llvm/test/CodeGen/BPF/cc_ret.ll
+++ b/llvm/test/CodeGen/BPF/cc_ret.ll
@@ -7,17 +7,17 @@ entry:
; CHECK: call f_i16
; CHECK: *(u16 *)(r1 + 0) = r0
%0 = call i16 @f_i16()
- store volatile i16 %0, i16* @g_i16
+ store volatile i16 %0, ptr @g_i16
; CHECK: call f_i32
; CHECK: *(u32 *)(r1 + 0) = r0
%1 = call i32 @f_i32()
- store volatile i32 %1, i32* @g_i32
+ store volatile i32 %1, ptr @g_i32
; CHECK: call f_i64
; CHECK: *(u64 *)(r1 + 0) = r0
%2 = call i64 @f_i64()
- store volatile i64 %2, i64* @g_i64
+ store volatile i64 %2, ptr @g_i64
ret void
}
diff --git a/llvm/test/CodeGen/BPF/dwarfdump.ll b/llvm/test/CodeGen/BPF/dwarfdump.ll
index c8215fdac3fdd..2b865bdc4f683 100644
--- a/llvm/test/CodeGen/BPF/dwarfdump.ll
+++ b/llvm/test/CodeGen/BPF/dwarfdump.ll
@@ -13,10 +13,10 @@ target triple = "bpf"
define i32 @testprog(i32, i32) local_unnamed_addr #0 !dbg !2 {
tail call void @llvm.dbg.value(metadata i32 %0, i64 0, metadata !11, metadata !16), !dbg !17
tail call void @llvm.dbg.value(metadata i32 %1, i64 0, metadata !12, metadata !16), !dbg !18
- %3 = load i32, i32* @testprog.myvar_c, align 4, !dbg !19, !tbaa !20
+ %3 = load i32, ptr @testprog.myvar_c, align 4, !dbg !19, !tbaa !20
%4 = add i32 %1, %0, !dbg !24
%5 = add i32 %4, %3, !dbg !25
- store i32 %5, i32* @testprog.myvar_c, align 4, !dbg !26, !tbaa !20
+ store i32 %5, ptr @testprog.myvar_c, align 4, !dbg !26, !tbaa !20
ret i32 %5, !dbg !27
}
diff --git a/llvm/test/CodeGen/BPF/fi_ri.ll b/llvm/test/CodeGen/BPF/fi_ri.ll
index b59f3f6f2838b..9de27b7c0fef8 100644
--- a/llvm/test/CodeGen/BPF/fi_ri.ll
+++ b/llvm/test/CodeGen/BPF/fi_ri.ll
@@ -5,21 +5,20 @@
; Function Attrs: nounwind uwtable
define i32 @test() #0 {
%key = alloca %struct.key_t, align 4
- %1 = bitcast %struct.key_t* %key to i8*
; CHECK: r1 = 0
; CHECK: *(u32 *)(r10 - 8) = r1
; CHECK: *(u64 *)(r10 - 16) = r1
; CHECK: *(u64 *)(r10 - 24) = r1
- call void @llvm.memset.p0i8.i64(i8* align 4 %1, i8 0, i64 20, i1 false)
+ call void @llvm.memset.p0.i64(ptr align 4 %key, i8 0, i64 20, i1 false)
; CHECK: r1 = r10
; CHECK: r1 += -20
- %2 = getelementptr inbounds %struct.key_t, %struct.key_t* %key, i64 0, i32 1, i64 0
+ %1 = getelementptr inbounds %struct.key_t, ptr %key, i64 0, i32 1, i64 0
; CHECK: call test1
- call void @test1(i8* %2) #3
+ call void @test1(ptr %1) #3
ret i32 0
}
; Function Attrs: nounwind argmemonly
-declare void @llvm.memset.p0i8.i64(i8* nocapture, i8, i64, i1) #1
+declare void @llvm.memset.p0.i64(ptr nocapture, i8, i64, i1) #1
-declare void @test1(i8*) #2
+declare void @test1(ptr) #2
diff --git a/llvm/test/CodeGen/BPF/i128.ll b/llvm/test/CodeGen/BPF/i128.ll
index c77838fa8bb47..6c581c574782d 100644
--- a/llvm/test/CodeGen/BPF/i128.ll
+++ b/llvm/test/CodeGen/BPF/i128.ll
@@ -7,7 +7,7 @@
; unsigned short lport;
; };
;
-; extern void test1(void *);
+; extern void test1(ptr);
; int test(int pid) {
; struct ipv6_key_t ipv6_key = {.pid = pid};
; test1(&ipv6_key);
@@ -22,13 +22,11 @@
define dso_local i32 @test(i32 %pid) local_unnamed_addr #0 {
entry:
%ipv6_key = alloca %struct.ipv6_key_t, align 16
- %0 = bitcast %struct.ipv6_key_t* %ipv6_key to i8*
- call void @llvm.lifetime.start.p0i8(i64 48, i8* nonnull %0) #4
- call void @llvm.memset.p0i8.i64(i8* nonnull align 16 dereferenceable(48) %0, i8 0, i64 48, i1 false)
- %pid1 = getelementptr inbounds %struct.ipv6_key_t, %struct.ipv6_key_t* %ipv6_key, i64 0, i32 0
- store i32 %pid, i32* %pid1, align 16, !tbaa !2
- call void @test1(i8* nonnull %0) #4
- call void @llvm.lifetime.end.p0i8(i64 48, i8* nonnull %0) #4
+ call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %ipv6_key) #4
+ call void @llvm.memset.p0.i64(ptr nonnull align 16 dereferenceable(48) %ipv6_key, i8 0, i64 48, i1 false)
+ store i32 %pid, ptr %ipv6_key, align 16, !tbaa !2
+ call void @test1(ptr nonnull %ipv6_key) #4
+ call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %ipv6_key) #4
ret i32 0
}
@@ -37,15 +35,15 @@ entry:
; CHECK: *(u32 *)(r10 - 48) = r{{[0-9]+}}
; Function Attrs: argmemonly nounwind willreturn
-declare void @llvm.lifetime.start.p0i8(i64 immarg, i8* nocapture) #1
+declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: argmemonly nounwind willreturn writeonly
-declare void @llvm.memset.p0i8.i64(i8* nocapture writeonly, i8, i64, i1 immarg) #2
+declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2
-declare dso_local void @test1(i8*) local_unnamed_addr #3
+declare dso_local void @test1(ptr) local_unnamed_addr #3
; Function Attrs: argmemonly nounwind willreturn
-declare void @llvm.lifetime.end.p0i8(i64 immarg, i8* nocapture) #1
+declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nounwind "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "frame-pointer"="all" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
attributes #1 = { argmemonly nounwind willreturn }
diff --git a/llvm/test/CodeGen/BPF/inline_asm.ll b/llvm/test/CodeGen/BPF/inline_asm.ll
index 8d14cd95d65b8..cdbeb4f003c94 100644
--- a/llvm/test/CodeGen/BPF/inline_asm.ll
+++ b/llvm/test/CodeGen/BPF/inline_asm.ll
@@ -4,7 +4,7 @@
; Source code:
; int g[2];
;
-; int test(void *ctx) {
+; int test(ptr ctx) {
; int a = 4, b;
; unsigned long long c = 333333333333ULL;
; asm volatile("r0 = *(u16 *)skb[%0]" : : "i"(2));
@@ -20,34 +20,33 @@
@g = common global [2 x i32] zeroinitializer, align 4
; Function Attrs: nounwind
-define i32 @test(i8* nocapture readnone %ctx) local_unnamed_addr #0 {
+define i32 @test(ptr nocapture readnone %ctx) local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
- %0 = bitcast i32* %a to i8*
- call void @llvm.lifetime.start.p0i8(i64 4, i8* nonnull %0) #2
- store i32 4, i32* %a, align 4
+ call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #2
+ store i32 4, ptr %a, align 4
tail call void asm sideeffect "r0 = *(u16 *)skb[$0]", "i"(i32 2) #2
; CHECK: r0 = *(u16 *)skb[2]
tail call void asm sideeffect "r0 = *(u16 *)skb[$0]", "r"(i32 4) #2
; CHECK: r0 = *(u16 *)skb[r1]
- %1 = tail call i32 asm sideeffect "$0 = $1", "=r,i"(i32 4) #2
+ %0 = tail call i32 asm sideeffect "$0 = $1", "=r,i"(i32 4) #2
; CHECK: r1 = 4
- %2 = tail call i32 asm sideeffect "$0 = $1 ll", "=r,i"(i64 333333333333) #2
+ %1 = tail call i32 asm sideeffect "$0 = $1 ll", "=r,i"(i64 333333333333) #2
; CHECK: r1 = 333333333333 ll
- %3 = call i32 asm sideeffect "$0 = *(u16 *) $1", "=r,*m"(i32* elementtype(i32) nonnull %a) #2
+ %2 = call i32 asm sideeffect "$0 = *(u16 *) $1", "=r,*m"(ptr elementtype(i32) nonnull %a) #2
; CHECK: r1 = *(u16 *)(r10 - 4)
- %4 = call i32 asm sideeffect "$0 = *(u32 *) $1", "=r,*m"(i32* elementtype(i32) getelementptr inbounds ([2 x i32], [2 x i32]* @g, i64 0, i64 1)) #2
+ %3 = call i32 asm sideeffect "$0 = *(u32 *) $1", "=r,*m"(ptr elementtype(i32) getelementptr inbounds ([2 x i32], ptr @g, i64 0, i64 1)) #2
; CHECK: r1 = g ll
; CHECK: r0 = *(u32 *)(r1 + 4)
- call void @llvm.lifetime.end.p0i8(i64 4, i8* nonnull %0) #2
- ret i32 %4
+ call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #2
+ ret i32 %3
}
; Function Attrs: argmemonly nounwind
-declare void @llvm.lifetime.start.p0i8(i64, i8* nocapture) #1
+declare void @llvm.lifetime.start.p0(i64, ptr nocapture) #1
; Function Attrs: argmemonly nounwind
-declare void @llvm.lifetime.end.p0i8(i64, i8* nocapture) #1
+declare void @llvm.lifetime.end.p0(i64, ptr nocapture) #1
attributes #0 = { nounwind }
attributes #1 = { argmemonly nounwind }
diff --git a/llvm/test/CodeGen/BPF/inlineasm-output-template.ll b/llvm/test/CodeGen/BPF/inlineasm-output-template.ll
index 8faf1bd1668c2..65115d444e48b 100644
--- a/llvm/test/CodeGen/BPF/inlineasm-output-template.ll
+++ b/llvm/test/CodeGen/BPF/inlineasm-output-template.ll
@@ -13,7 +13,7 @@ define dso_local i32 @test_inlineasm_c_output_template0() {
; CHECK: #TEST baz
@baz = internal global i32 0, align 4
define dso_local i32 @test_inlineasm_c_output_template1() {
- tail call void asm sideeffect "#TEST ${0:c}", "i"(i32* nonnull @baz)
+ tail call void asm sideeffect "#TEST ${0:c}", "i"(ptr nonnull @baz)
ret i32 42
}
diff --git a/llvm/test/CodeGen/BPF/intrinsics.ll b/llvm/test/CodeGen/BPF/intrinsics.ll
index 0712daa601b7e..0f59fd5604732 100644
--- a/llvm/test/CodeGen/BPF/intrinsics.ll
+++ b/llvm/test/CodeGen/BPF/intrinsics.ll
@@ -2,14 +2,14 @@
; RUN: llc < %s -march=bpfeb -show-mc-encoding | FileCheck --check-prefix=CHECK-EB %s
; Function Attrs: nounwind uwtable
-define i32 @ld_b(i64 %foo, i64* nocapture %bar, i8* %ctx, i8* %ctx2) #0 {
- %1 = tail call i64 @llvm.bpf.load.byte(i8* %ctx, i64 123) #2
+define i32 @ld_b(i64 %foo, ptr nocapture %bar, ptr %ctx, ptr %ctx2) #0 {
+ %1 = tail call i64 @llvm.bpf.load.byte(ptr %ctx, i64 123) #2
%2 = add i64 %1, %foo
- %3 = load volatile i64, i64* %bar, align 8
+ %3 = load volatile i64, ptr %bar, align 8
%4 = add i64 %2, %3
- %5 = tail call i64 @llvm.bpf.load.byte(i8* %ctx2, i64 %foo) #2
+ %5 = tail call i64 @llvm.bpf.load.byte(ptr %ctx2, i64 %foo) #2
%6 = add i64 %4, %5
- %7 = load volatile i64, i64* %bar, align 8
+ %7 = load volatile i64, ptr %bar, align 8
%8 = add i64 %6, %7
%9 = trunc i64 %8 to i32
ret i32 %9
@@ -20,13 +20,13 @@ define i32 @ld_b(i64 %foo, i64* nocapture %bar, i8* %ctx, i8* %ctx2) #0 {
; CHECK-EB: r0 = *(u8 *)skb[r
}
-declare i64 @llvm.bpf.load.byte(i8*, i64) #1
+declare i64 @llvm.bpf.load.byte(ptr, i64) #1
; Function Attrs: nounwind uwtable
-define i32 @ld_h(i8* %ctx, i8* %ctx2, i32 %foo) #0 {
- %1 = tail call i64 @llvm.bpf.load.half(i8* %ctx, i64 123) #2
+define i32 @ld_h(ptr %ctx, ptr %ctx2, i32 %foo) #0 {
+ %1 = tail call i64 @llvm.bpf.load.half(ptr %ctx, i64 123) #2
%2 = sext i32 %foo to i64
- %3 = tail call i64 @llvm.bpf.load.half(i8* %ctx2, i64 %2) #2
+ %3 = tail call i64 @llvm.bpf.load.half(ptr %ctx2, i64 %2) #2
%4 = add i64 %3, %1
%5 = trunc i64 %4 to i32
ret i32 %5
@@ -37,13 +37,13 @@ define i32 @ld_h(i8* %ctx, i8* %ctx2, i32 %foo) #0 {
; CHECK-EB: r0 = *(u16 *)skb[123]
}
-declare i64 @llvm.bpf.load.half(i8*, i64) #1
+declare i64 @llvm.bpf.load.half(ptr, i64) #1
; Function Attrs: nounwind uwtable
-define i32 @ld_w(i8* %ctx, i8* %ctx2, i32 %foo) #0 {
- %1 = tail call i64 @llvm.bpf.load.word(i8* %ctx, i64 123) #2
+define i32 @ld_w(ptr %ctx, ptr %ctx2, i32 %foo) #0 {
+ %1 = tail call i64 @llvm.bpf.load.word(ptr %ctx, i64 123) #2
%2 = sext i32 %foo to i64
- %3 = tail call i64 @llvm.bpf.load.word(i8* %ctx2, i64 %2) #2
+ %3 = tail call i64 @llvm.bpf.load.word(ptr %ctx2, i64 %2) #2
%4 = add i64 %3, %1
%5 = trunc i64 %4 to i32
ret i32 %5
@@ -54,12 +54,12 @@ define i32 @ld_w(i8* %ctx, i8* %ctx2, i32 %foo) #0 {
; CHECK-EB: r0 = *(u32 *)skb[123]
}
-declare i64 @llvm.bpf.load.word(i8*, i64) #1
+declare i64 @llvm.bpf.load.word(ptr, i64) #1
define i32 @ld_pseudo() #0 {
entry:
%call = tail call i64 @llvm.bpf.pseudo(i64 2, i64 3)
- tail call void inttoptr (i64 4 to void (i64, i32)*)(i64 %call, i32 4) #2
+ tail call void inttoptr (i64 4 to ptr)(i64 %call, i32 4) #2
ret i32 0
; CHECK-LABEL: ld_pseudo:
; CHECK-EL: ld_pseudo r1, 2, 3 # encoding: [0x18,0x21,0x00,0x00,0x03,0x00,0x00,0x00
diff --git a/llvm/test/CodeGen/BPF/is_trunc_free.ll b/llvm/test/CodeGen/BPF/is_trunc_free.ll
index cc6bef1a92a91..4d110a4ac1140 100644
--- a/llvm/test/CodeGen/BPF/is_trunc_free.ll
+++ b/llvm/test/CodeGen/BPF/is_trunc_free.ll
@@ -7,18 +7,18 @@
; extern int work(struct env_t *skb, unsigned offset);
; int test(struct env_t *skb)
; {
-; void *cursor, *data_end;
+; ptr cursor, *data_end;
; struct env_t *srh, *ip;
;
-; data_end = (void *)(long)skb->data_end;
-; cursor = (void *)(long)skb->data;
+; data_end = (ptr)(long)skb->data_end;
+; cursor = (ptr)(long)skb->data;
;
; ip = cursor; cursor += sizeof(*ip);
-; if ((void *)ip + sizeof(*ip) > data_end)
+; if ((ptr)ip + sizeof(*ip) > data_end)
; return 0;
;
; srh = cursor; cursor += sizeof(*srh);
-; if ((void *)srh + sizeof(*srh) > data_end)
+; if ((ptr)srh + sizeof(*srh) > data_end)
; return 0;
;
; return work(skb, (char *)srh - (char *)(long)skb->data);
@@ -29,28 +29,27 @@
%struct.env_t = type { i32, i32 }
; Function Attrs: nounwind
-define dso_local i32 @test(%struct.env_t* %skb) local_unnamed_addr #0 {
+define dso_local i32 @test(ptr %skb) local_unnamed_addr #0 {
entry:
- %data_end1 = getelementptr inbounds %struct.env_t, %struct.env_t* %skb, i64 0, i32 1
- %0 = load i32, i32* %data_end1, align 4, !tbaa !2
+ %data_end1 = getelementptr inbounds %struct.env_t, ptr %skb, i64 0, i32 1
+ %0 = load i32, ptr %data_end1, align 4, !tbaa !2
%conv = zext i32 %0 to i64
- %1 = inttoptr i64 %conv to i8*
- %data = getelementptr inbounds %struct.env_t, %struct.env_t* %skb, i64 0, i32 0
- %2 = load i32, i32* %data, align 4, !tbaa !7
+ %1 = inttoptr i64 %conv to ptr
+ %2 = load i32, ptr %skb, align 4, !tbaa !7
%conv2 = zext i32 %2 to i64
- %3 = inttoptr i64 %conv2 to i8*
- %add.ptr = getelementptr i8, i8* %3, i64 8
- %cmp = icmp ugt i8* %add.ptr, %1
- %add.ptr6 = getelementptr i8, i8* %3, i64 16
- %cmp7 = icmp ugt i8* %add.ptr6, %1
+ %3 = inttoptr i64 %conv2 to ptr
+ %add.ptr = getelementptr i8, ptr %3, i64 8
+ %cmp = icmp ugt ptr %add.ptr, %1
+ %add.ptr6 = getelementptr i8, ptr %3, i64 16
+ %cmp7 = icmp ugt ptr %add.ptr6, %1
%or.cond = or i1 %cmp, %cmp7
br i1 %or.cond, label %cleanup, label %if.end10
if.end10: ; preds = %entry
- %sub.ptr.lhs.cast = ptrtoint i8* %add.ptr to i64
+ %sub.ptr.lhs.cast = ptrtoint ptr %add.ptr to i64
%4 = trunc i64 %sub.ptr.lhs.cast to i32
%conv13 = sub i32 %4, %2
- %call = tail call i32 @work(%struct.env_t* nonnull %skb, i32 %conv13) #2
+ %call = tail call i32 @work(ptr nonnull %skb, i32 %conv13) #2
br label %cleanup
cleanup: ; preds = %entry, %if.end10
@@ -61,7 +60,7 @@ cleanup: ; preds = %entry, %if.end10
; CHECK: w{{[0-9]+}} = *(u32 *)(r{{[0-9]+}} + 0)
; CHECK-NOT: w{{[0-9]+}} = w{{[0-9]+}}
-declare dso_local i32 @work(%struct.env_t*, i32) local_unnamed_addr #1
+declare dso_local i32 @work(ptr, i32) local_unnamed_addr #1
attributes #0 = { nounwind "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "frame-pointer"="all" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
attributes #1 = { "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "frame-pointer"="all" "less-precise-fpmad"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
diff --git a/llvm/test/CodeGen/BPF/load.ll b/llvm/test/CodeGen/BPF/load.ll
index 881917a4c946e..e9bf3119aaa2a 100644
--- a/llvm/test/CodeGen/BPF/load.ll
+++ b/llvm/test/CodeGen/BPF/load.ll
@@ -1,7 +1,7 @@
; RUN: llc < %s -march=bpfel | FileCheck %s
-define i16 @am1(i16* %a) nounwind {
- %1 = load i16, i16* %a
+define i16 @am1(ptr %a) nounwind {
+ %1 = load i16, ptr %a
ret i16 %1
}
; CHECK-LABEL: am1:
@@ -10,23 +10,23 @@ define i16 @am1(i16* %a) nounwind {
@foo = external global i16
define i16 @am2() nounwind {
- %1 = load i16, i16* @foo
+ %1 = load i16, ptr @foo
ret i16 %1
}
; CHECK-LABEL: am2:
; CHECK: r0 = *(u16 *)(r1 + 0)
define i16 @am4() nounwind {
- %1 = load volatile i16, i16* inttoptr(i16 32 to i16*)
+ %1 = load volatile i16, ptr inttoptr(i16 32 to ptr)
ret i16 %1
}
; CHECK-LABEL: am4:
; CHECK: r1 = 32
; CHECK: r0 = *(u16 *)(r1 + 0)
-define i16 @am5(i16* %a) nounwind {
- %1 = getelementptr i16, i16* %a, i16 2
- %2 = load i16, i16* %1
+define i16 @am5(ptr %a) nounwind {
+ %1 = getelementptr i16, ptr %a, i16 2
+ %2 = load i16, ptr %1
ret i16 %2
}
; CHECK-LABEL: am5:
@@ -36,7 +36,7 @@ define i16 @am5(i16* %a) nounwind {
@baz = common global %S zeroinitializer, align 1
define i16 @am6() nounwind {
- %1 = load i16, i16* getelementptr (%S, %S* @baz, i32 0, i32 1)
+ %1 = load i16, ptr getelementptr (%S, ptr @baz, i32 0, i32 1)
ret i16 %1
}
; CHECK-LABEL: am6:
diff --git a/llvm/test/CodeGen/BPF/loop-exit-cond.ll b/llvm/test/CodeGen/BPF/loop-exit-cond.ll
index 9883367a5b449..dc77ea393c677 100644
--- a/llvm/test/CodeGen/BPF/loop-exit-cond.ll
+++ b/llvm/test/CodeGen/BPF/loop-exit-cond.ll
@@ -25,28 +25,27 @@ target triple = "bpf"
@.str = private unnamed_addr constant [3 x i8] c"%c\00", align 1
; Function Attrs: nounwind
-define dso_local i32 @test(i32 %len, i8* %data) #0 {
+define dso_local i32 @test(i32 %len, ptr %data) #0 {
entry:
%len.addr = alloca i32, align 4
- %data.addr = alloca i8*, align 8
+ %data.addr = alloca ptr, align 8
%i = alloca i32, align 4
%d = alloca [1 x i64], align 8
- store i32 %len, i32* %len.addr, align 4, !tbaa !3
- store i8* %data, i8** %data.addr, align 8, !tbaa !7
- %0 = load i32, i32* %len.addr, align 4, !tbaa !3
+ store i32 %len, ptr %len.addr, align 4, !tbaa !3
+ store ptr %data, ptr %data.addr, align 8, !tbaa !7
+ %0 = load i32, ptr %len.addr, align 4, !tbaa !3
%cmp = icmp slt i32 %0, 100
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
- %1 = bitcast i32* %i to i8*
- call void @llvm.lifetime.start.p0i8(i64 4, i8* %1) #3
- store i32 1, i32* %i, align 4, !tbaa !3
+ call void @llvm.lifetime.start.p0(i64 4, ptr %i) #3
+ store i32 1, ptr %i, align 4, !tbaa !3
br label %for.cond
for.cond: ; preds = %for.inc, %if.then
- %2 = load i32, i32* %i, align 4, !tbaa !3
- %3 = load i32, i32* %len.addr, align 4, !tbaa !3
- %cmp1 = icmp slt i32 %2, %3
+ %1 = load i32, ptr %i, align 4, !tbaa !3
+ %2 = load i32, ptr %len.addr, align 4, !tbaa !3
+ %cmp1 = icmp slt i32 %1, %2
br i1 %cmp1, label %for.body, label %for.cond.cleanup
; CHECK: w[[LEN:[0-9]+]] = w1
@@ -54,17 +53,14 @@ for.cond: ; preds = %for.inc, %if.then
; CHECK-NEXT: w[[IDX]] s< w[[LEN]] goto
for.cond.cleanup: ; preds = %for.cond
- %4 = bitcast i32* %i to i8*
- call void @llvm.lifetime.end.p0i8(i64 4, i8* %4) #3
+ call void @llvm.lifetime.end.p0(i64 4, ptr %i) #3
br label %for.end
for.body: ; preds = %for.cond
- %5 = bitcast [1 x i64]* %d to i8*
- call void @llvm.lifetime.start.p0i8(i64 8, i8* %5) #3
- %6 = load i8*, i8** %data.addr, align 8, !tbaa !7
- %arrayidx = getelementptr inbounds i8, i8* %6, i64 0
- %7 = load i8, i8* %arrayidx, align 1, !tbaa !9
- %conv = sext i8 %7 to i32
+ call void @llvm.lifetime.start.p0(i64 8, ptr %d) #3
+ %3 = load ptr, ptr %data.addr, align 8, !tbaa !7
+ %4 = load i8, ptr %3, align 1, !tbaa !9
+ %conv = sext i8 %4 to i32
%tobool = icmp ne i32 %conv, 0
br i1 %tobool, label %cond.true, label %cond.false
@@ -77,19 +73,16 @@ cond.false: ; preds = %for.body
cond.end: ; preds = %cond.false, %cond.true
%cond = phi i32 [ %conv, %cond.true ], [ 48, %cond.false ]
%conv2 = sext i32 %cond to i64
- %arrayidx3 = getelementptr inbounds [1 x i64], [1 x i64]* %d, i64 0, i64 0
- store i64 %conv2, i64* %arrayidx3, align 8, !tbaa !10
- %8 = load i32, i32* %i, align 4, !tbaa !3
- %arraydecay = getelementptr inbounds [1 x i64], [1 x i64]* %d, i64 0, i64 0
- call void @foo(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %8, i64* %arraydecay)
- %9 = bitcast [1 x i64]* %d to i8*
- call void @llvm.lifetime.end.p0i8(i64 8, i8* %9) #3
+ store i64 %conv2, ptr %d, align 8, !tbaa !10
+ %5 = load i32, ptr %i, align 4, !tbaa !3
+ call void @foo(ptr @.str, i32 %5, ptr %d)
+ call void @llvm.lifetime.end.p0(i64 8, ptr %d) #3
br label %for.inc
for.inc: ; preds = %cond.end
- %10 = load i32, i32* %i, align 4, !tbaa !3
- %inc = add nsw i32 %10, 1
- store i32 %inc, i32* %i, align 4, !tbaa !3
+ %6 = load i32, ptr %i, align 4, !tbaa !3
+ %inc = add nsw i32 %6, 1
+ store i32 %inc, ptr %i, align 4, !tbaa !3
br label %for.cond, !llvm.loop !12
for.end: ; preds = %for.cond.cleanup
@@ -100,12 +93,12 @@ if.end: ; preds = %for.end, %entry
}
; Function Attrs: argmemonly nofree nosync nounwind willreturn
-declare void @llvm.lifetime.start.p0i8(i64 immarg, i8* nocapture) #1
+declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
-declare dso_local void @foo(i8*, i32, i64*) #2
+declare dso_local void @foo(ptr, i32, ptr) #2
; Function Attrs: argmemonly nofree nosync nounwind willreturn
-declare void @llvm.lifetime.end.p0i8(i64 immarg, i8* nocapture) #1
+declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nounwind "frame-pointer"="all" "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" }
attributes #1 = { argmemonly nofree nosync nounwind willreturn }
diff --git a/llvm/test/CodeGen/BPF/loops.ll b/llvm/test/CodeGen/BPF/loops.ll
index 39278fe595c22..a899e4dfeaf2b 100644
--- a/llvm/test/CodeGen/BPF/loops.ll
+++ b/llvm/test/CodeGen/BPF/loops.ll
@@ -1,6 +1,6 @@
; RUN: llc < %s -march=bpfel | FileCheck %s
-define zeroext i16 @add(i16* nocapture %a, i16 zeroext %n) nounwind readonly {
+define zeroext i16 @add(ptr nocapture %a, i16 zeroext %n) nounwind readonly {
entry:
%cmp8 = icmp eq i16 %n, 0 ; <i1> [#uses=1]
br i1 %cmp8, label %for.end, label %for.body
@@ -8,10 +8,10 @@ entry:
for.body: ; preds = %for.body, %entry
%i.010 = phi i16 [ 0, %entry ], [ %inc, %for.body ] ; <i16> [#uses=2]
%sum.09 = phi i16 [ 0, %entry ], [ %add, %for.body ] ; <i16> [#uses=1]
- %arrayidx = getelementptr i16, i16* %a, i16 %i.010 ; <i16*> [#uses=1]
+ %arrayidx = getelementptr i16, ptr %a, i16 %i.010 ; <ptr> [#uses=1]
; CHECK-LABEL: add:
; CHECK: r{{[0-9]+}} += r{{[0-9]+}}
- %tmp4 = load i16, i16* %arrayidx ; <i16> [#uses=1]
+ %tmp4 = load i16, ptr %arrayidx ; <i16> [#uses=1]
%add = add i16 %tmp4, %sum.09 ; <i16> [#uses=2]
%inc = add i16 %i.010, 1 ; <i16> [#uses=2]
%exitcond = icmp eq i16 %inc, %n ; <i1> [#uses=1]
@@ -22,7 +22,7 @@ for.end: ; preds = %for.body, %entry
ret i16 %sum.0.lcssa
}
-define zeroext i16 @sub(i16* nocapture %a, i16 zeroext %n) nounwind readonly {
+define zeroext i16 @sub(ptr nocapture %a, i16 zeroext %n) nounwind readonly {
entry:
%cmp8 = icmp eq i16 %n, 0 ; <i1> [#uses=1]
br i1 %cmp8, label %for.end, label %for.body
@@ -30,10 +30,10 @@ entry:
for.body: ; preds = %for.body, %entry
%i.010 = phi i16 [ 0, %entry ], [ %inc, %for.body ] ; <i16> [#uses=2]
%sum.09 = phi i16 [ 0, %entry ], [ %add, %for.body ] ; <i16> [#uses=1]
- %arrayidx = getelementptr i16, i16* %a, i16 %i.010 ; <i16*> [#uses=1]
+ %arrayidx = getelementptr i16, ptr %a, i16 %i.010 ; <ptr> [#uses=1]
; CHECK-LABEL: sub:
; CHECK: r{{[0-9]+}} -= r{{[0-9]+}}
- %tmp4 = load i16, i16* %arrayidx ; <i16> [#uses=1]
+ %tmp4 = load i16, ptr %arrayidx ; <i16> [#uses=1]
%add = sub i16 %tmp4, %sum.09 ; <i16> [#uses=2]
%inc = add i16 %i.010, 1 ; <i16> [#uses=2]
%exitcond = icmp eq i16 %inc, %n ; <i1> [#uses=1]
@@ -44,7 +44,7 @@ for.end: ; preds = %for.body, %entry
ret i16 %sum.0.lcssa
}
-define zeroext i16 @or(i16* nocapture %a, i16 zeroext %n) nounwind readonly {
+define zeroext i16 @or(ptr nocapture %a, i16 zeroext %n) nounwind readonly {
entry:
%cmp8 = icmp eq i16 %n, 0 ; <i1> [#uses=1]
br i1 %cmp8, label %for.end, label %for.body
@@ -52,10 +52,10 @@ entry:
for.body: ; preds = %for.body, %entry
%i.010 = phi i16 [ 0, %entry ], [ %inc, %for.body ] ; <i16> [#uses=2]
%sum.09 = phi i16 [ 0, %entry ], [ %add, %for.body ] ; <i16> [#uses=1]
- %arrayidx = getelementptr i16, i16* %a, i16 %i.010 ; <i16*> [#uses=1]
+ %arrayidx = getelementptr i16, ptr %a, i16 %i.010 ; <ptr> [#uses=1]
; CHECK-LABEL: or:
; CHECK: r{{[0-9]+}} |= r{{[0-9]+}}
- %tmp4 = load i16, i16* %arrayidx ; <i16> [#uses=1]
+ %tmp4 = load i16, ptr %arrayidx ; <i16> [#uses=1]
%add = or i16 %tmp4, %sum.09 ; <i16> [#uses=2]
%inc = add i16 %i.010, 1 ; <i16> [#uses=2]
%exitcond = icmp eq i16 %inc, %n ; <i1> [#uses=1]
@@ -66,7 +66,7 @@ for.end: ; preds = %for.body, %entry
ret i16 %sum.0.lcssa
}
-define zeroext i16 @xor(i16* nocapture %a, i16 zeroext %n) nounwind readonly {
+define zeroext i16 @xor(ptr nocapture %a, i16 zeroext %n) nounwind readonly {
entry:
%cmp8 = icmp eq i16 %n, 0 ; <i1> [#uses=1]
br i1 %cmp8, label %for.end, label %for.body
@@ -74,10 +74,10 @@ entry:
for.body: ; preds = %for.body, %entry
%i.010 = phi i16 [ 0, %entry ], [ %inc, %for.body ] ; <i16> [#uses=2]
%sum.09 = phi i16 [ 0, %entry ], [ %add, %for.body ] ; <i16> [#uses=1]
- %arrayidx = getelementptr i16, i16* %a, i16 %i.010 ; <i16*> [#uses=1]
+ %arrayidx = getelementptr i16, ptr %a, i16 %i.010 ; <ptr> [#uses=1]
; CHECK-LABEL: xor:
; CHECK: r{{[0-9]+}} ^= r{{[0-9]+}}
- %tmp4 = load i16, i16* %arrayidx ; <i16> [#uses=1]
+ %tmp4 = load i16, ptr %arrayidx ; <i16> [#uses=1]
%add = xor i16 %tmp4, %sum.09 ; <i16> [#uses=2]
%inc = add i16 %i.010, 1 ; <i16> [#uses=2]
%exitcond = icmp eq i16 %inc, %n ; <i1> [#uses=1]
@@ -88,7 +88,7 @@ for.end: ; preds = %for.body, %entry
ret i16 %sum.0.lcssa
}
-define zeroext i16 @and(i16* nocapture %a, i16 zeroext %n) nounwind readonly {
+define zeroext i16 @and(ptr nocapture %a, i16 zeroext %n) nounwind readonly {
entry:
%cmp8 = icmp eq i16 %n, 0 ; <i1> [#uses=1]
br i1 %cmp8, label %for.end, label %for.body
@@ -96,10 +96,10 @@ entry:
for.body: ; preds = %for.body, %entry
%i.010 = phi i16 [ 0, %entry ], [ %inc, %for.body ] ; <i16> [#uses=2]
%sum.09 = phi i16 [ 0, %entry ], [ %add, %for.body ] ; <i16> [#uses=1]
- %arrayidx = getelementptr i16, i16* %a, i16 %i.010 ; <i16*> [#uses=1]
+ %arrayidx = getelementptr i16, ptr %a, i16 %i.010 ; <ptr> [#uses=1]
; CHECK-LABEL: and:
; CHECK: r{{[0-9]+}} &= r{{[0-9]+}}
- %tmp4 = load i16, i16* %arrayidx ; <i16> [#uses=1]
+ %tmp4 = load i16, ptr %arrayidx ; <i16> [#uses=1]
%add = and i16 %tmp4, %sum.09 ; <i16> [#uses=2]
%inc = add i16 %i.010, 1 ; <i16> [#uses=2]
%exitcond = icmp eq i16 %inc, %n ; <i1> [#uses=1]
diff --git a/llvm/test/CodeGen/BPF/mem_offset.ll b/llvm/test/CodeGen/BPF/mem_offset.ll
index 2b86e44ae592b..abb4a5e9b4236 100644
--- a/llvm/test/CodeGen/BPF/mem_offset.ll
+++ b/llvm/test/CodeGen/BPF/mem_offset.ll
@@ -1,17 +1,16 @@
; RUN: llc -march=bpfel -show-mc-encoding < %s | FileCheck %s
; Function Attrs: nounwind
-define i32 @bpf_prog1(i8* nocapture readnone) local_unnamed_addr #0 {
+define i32 @bpf_prog1(ptr nocapture readnone) local_unnamed_addr #0 {
; CHECK: r1 += -1879113726 # encoding: [0x07,0x01,0x00,0x00,0x02,0x00,0xff,0x8f]
; CHECK: r0 = *(u64 *)(r1 + 0) # encoding: [0x79,0x10,0x00,0x00,0x00,0x00,0x00,0x00]
%2 = alloca i64, align 8
- %3 = bitcast i64* %2 to i8*
- store volatile i64 590618314553, i64* %2, align 8
- %4 = load volatile i64, i64* %2, align 8
- %5 = add i64 %4, -1879113726
- %6 = inttoptr i64 %5 to i64*
- %7 = load i64, i64* %6, align 8
- %8 = trunc i64 %7 to i32
- ret i32 %8
+ store volatile i64 590618314553, ptr %2, align 8
+ %3 = load volatile i64, ptr %2, align 8
+ %4 = add i64 %3, -1879113726
+ %5 = inttoptr i64 %4 to ptr
+ %6 = load i64, ptr %5, align 8
+ %7 = trunc i64 %6 to i32
+ ret i32 %7
}
diff --git a/llvm/test/CodeGen/BPF/mem_offset_be.ll b/llvm/test/CodeGen/BPF/mem_offset_be.ll
index 7d7243a6667cb..832a48455b784 100644
--- a/llvm/test/CodeGen/BPF/mem_offset_be.ll
+++ b/llvm/test/CodeGen/BPF/mem_offset_be.ll
@@ -1,18 +1,17 @@
; RUN: llc -march=bpfeb -show-mc-encoding < %s | FileCheck %s
; Function Attrs: nounwind
-define i32 @bpf_prog1(i8* nocapture readnone) local_unnamed_addr #0 {
+define i32 @bpf_prog1(ptr nocapture readnone) local_unnamed_addr #0 {
; CHECK: r1 = 590618314553 ll # encoding: [0x18,0x10,0x00,0x00,0x83,0x98,0x47,0x39,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x89]
; CHECK: r1 += -1879113726 # encoding: [0x07,0x10,0x00,0x00,0x8f,0xff,0x00,0x02]
; CHECK: r0 = *(u64 *)(r1 + 0) # encoding: [0x79,0x01,0x00,0x00,0x00,0x00,0x00,0x00]
%2 = alloca i64, align 8
- %3 = bitcast i64* %2 to i8*
- store volatile i64 590618314553, i64* %2, align 8
- %4 = load volatile i64, i64* %2, align 8
- %5 = add i64 %4, -1879113726
- %6 = inttoptr i64 %5 to i64*
- %7 = load i64, i64* %6, align 8
- %8 = trunc i64 %7 to i32
- ret i32 %8
+ store volatile i64 590618314553, ptr %2, align 8
+ %3 = load volatile i64, ptr %2, align 8
+ %4 = add i64 %3, -1879113726
+ %5 = inttoptr i64 %4 to ptr
+ %6 = load i64, ptr %5, align 8
+ %7 = trunc i64 %6 to i32
+ ret i32 %7
}
diff --git a/llvm/test/CodeGen/BPF/memcmp.ll b/llvm/test/CodeGen/BPF/memcmp.ll
index b7102113f9285..7ed8dc1e736f4 100644
--- a/llvm/test/CodeGen/BPF/memcmp.ll
+++ b/llvm/test/CodeGen/BPF/memcmp.ll
@@ -8,7 +8,7 @@
; } __attribute__((aligned(4)));
;
; /* try to compute a local build_id */
-; void bar1(void *);
+; void bar1(ptr);
;
; /* the global build_id to compare */
; struct build_id id2;
@@ -32,13 +32,12 @@
define dso_local i32 @foo() local_unnamed_addr #0 {
entry:
%id11 = alloca [20 x i8], align 4
- %id11.sub = getelementptr inbounds [20 x i8], [20 x i8]* %id11, i64 0, i64 0
- call void @llvm.lifetime.start.p0i8(i64 20, i8* nonnull %id11.sub) #4
- call void @bar1(i8* noundef nonnull %id11.sub) #4
- %call = call i32 @memcmp(i8* noundef nonnull dereferenceable(20) %id11.sub, i8* noundef nonnull dereferenceable(20) getelementptr inbounds (%struct.build_id, %struct.build_id* @id2, i64 0, i32 0, i64 0), i64 noundef 20) #4
+ call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %id11) #4
+ call void @bar1(ptr noundef nonnull %id11) #4
+ %call = call i32 @memcmp(ptr noundef nonnull dereferenceable(20) %id11, ptr noundef nonnull dereferenceable(20) @id2, i64 noundef 20) #4
%cmp = icmp eq i32 %call, 0
%conv = zext i1 %cmp to i32
- call void @llvm.lifetime.end.p0i8(i64 20, i8* nonnull %id11.sub) #4
+ call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %id11) #4
ret i32 %conv
}
@@ -54,15 +53,15 @@ entry:
; CHECK-DAG: *(u32 *)(r10 - 4)
; Function Attrs: argmemonly mustprogress nofree nosync nounwind willreturn
-declare void @llvm.lifetime.start.p0i8(i64 immarg, i8* nocapture) #1
+declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
-declare dso_local void @bar1(i8* noundef) local_unnamed_addr #2
+declare dso_local void @bar1(ptr noundef) local_unnamed_addr #2
; Function Attrs: argmemonly mustprogress nofree nounwind readonly willreturn
-declare dso_local i32 @memcmp(i8* nocapture noundef, i8* nocapture noundef, i64 noundef) local_unnamed_addr #3
+declare dso_local i32 @memcmp(ptr nocapture noundef, ptr nocapture noundef, i64 noundef) local_unnamed_addr #3
; Function Attrs: argmemonly mustprogress nofree nosync nounwind willreturn
-declare void @llvm.lifetime.end.p0i8(i64 immarg, i8* nocapture) #1
+declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nounwind "frame-pointer"="all" "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" }
attributes #1 = { argmemonly mustprogress nofree nosync nounwind willreturn }
diff --git a/llvm/test/CodeGen/BPF/memcpy-expand-in-order.ll b/llvm/test/CodeGen/BPF/memcpy-expand-in-order.ll
index 988e45a949e43..c690c0e5ccaaa 100644
--- a/llvm/test/CodeGen/BPF/memcpy-expand-in-order.ll
+++ b/llvm/test/CodeGen/BPF/memcpy-expand-in-order.ll
@@ -3,7 +3,7 @@
;
; #define COPY_LEN 9
;
-; void cal_align1(void *a, void *b)
+; void cal_align1(ptr a, ptr b)
; {
; __builtin_memcpy(a, b, COPY_LEN);
; }
@@ -28,14 +28,14 @@
; }
; Function Attrs: nounwind
-define dso_local void @cal_align1(i8* nocapture %a, i8* nocapture readonly %b) local_unnamed_addr #0 {
+define dso_local void @cal_align1(ptr nocapture %a, ptr nocapture readonly %b) local_unnamed_addr #0 {
entry:
- tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %a, i8* align 1 %b, i64 9, i1 false)
+ tail call void @llvm.memcpy.p0.p0.i64(ptr align 1 %a, ptr align 1 %b, i64 9, i1 false)
ret void
}
; Function Attrs: argmemonly nounwind
-declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture writeonly, i8* nocapture readonly, i64, i1) #1
+declare void @llvm.memcpy.p0.p0.i64(ptr nocapture writeonly, ptr nocapture readonly, i64, i1) #1
; CHECK: [[SCRATCH_REG:r[0-9]]] = *(u8 *)([[SRC_REG:r[0-9]]] + 0)
; CHECK: *(u8 *)([[DST_REG:r[0-9]]] + 0) = [[SCRATCH_REG]]
@@ -57,11 +57,9 @@ declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture writeonly, i8* nocapture r
; CHECK: *(u8 *)([[DST_REG]] + 8) = [[SCRATCH_REG]]
; Function Attrs: nounwind
-define dso_local void @cal_align2(i16* nocapture %a, i16* nocapture readonly %b) local_unnamed_addr #0 {
+define dso_local void @cal_align2(ptr nocapture %a, ptr nocapture readonly %b) local_unnamed_addr #0 {
entry:
- %0 = bitcast i16* %a to i8*
- %1 = bitcast i16* %b to i8*
- tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 2 %0, i8* align 2 %1, i64 9, i1 false)
+ tail call void @llvm.memcpy.p0.p0.i64(ptr align 2 %a, ptr align 2 %b, i64 9, i1 false)
ret void
}
; CHECK: [[SCRATCH_REG:r[0-9]]] = *(u16 *)([[SRC_REG:r[0-9]]] + 0)
@@ -76,11 +74,9 @@ entry:
; CHECK: *(u8 *)([[DST_REG]] + 8) = [[SCRATCH_REG]]
; Function Attrs: nounwind
-define dso_local void @cal_align4(i32* nocapture %a, i32* nocapture readonly %b) local_unnamed_addr #0 {
+define dso_local void @cal_align4(ptr nocapture %a, ptr nocapture readonly %b) local_unnamed_addr #0 {
entry:
- %0 = bitcast i32* %a to i8*
- %1 = bitcast i32* %b to i8*
- tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 4 %0, i8* align 4 %1, i64 19, i1 false)
+ tail call void @llvm.memcpy.p0.p0.i64(ptr align 4 %a, ptr align 4 %b, i64 19, i1 false)
ret void
}
; CHECK: [[SCRATCH_REG:r[0-9]]] = *(u32 *)([[SRC_REG:r[0-9]]] + 0)
@@ -97,11 +93,9 @@ entry:
; CHECK: *(u8 *)([[DST_REG]] + 18) = [[SCRATCH_REG]]
; Function Attrs: nounwind
-define dso_local void @cal_align8(i64* nocapture %a, i64* nocapture readonly %b) local_unnamed_addr #0 {
+define dso_local void @cal_align8(ptr nocapture %a, ptr nocapture readonly %b) local_unnamed_addr #0 {
entry:
- %0 = bitcast i64* %a to i8*
- %1 = bitcast i64* %b to i8*
- tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 8 %0, i8* align 8 %1, i64 27, i1 false)
+ tail call void @llvm.memcpy.p0.p0.i64(ptr align 8 %a, ptr align 8 %b, i64 27, i1 false)
ret void
}
; CHECK: [[SCRATCH_REG:r[0-9]]] = *(u64 *)([[SRC_REG:r[0-9]]] + 0)
diff --git a/llvm/test/CodeGen/BPF/objdump_atomics.ll b/llvm/test/CodeGen/BPF/objdump_atomics.ll
index dbad30a6271aa..57dad3ad13791 100644
--- a/llvm/test/CodeGen/BPF/objdump_atomics.ll
+++ b/llvm/test/CodeGen/BPF/objdump_atomics.ll
@@ -3,17 +3,17 @@
; CHECK-LABEL: test_load_add_32
; CHECK: c3 21
; CHECK: lock *(u32 *)(r1 + 0) += r2
-define void @test_load_add_32(i32* %p, i32 zeroext %v) {
+define void @test_load_add_32(ptr %p, i32 zeroext %v) {
entry:
- atomicrmw add i32* %p, i32 %v seq_cst
+ atomicrmw add ptr %p, i32 %v seq_cst
ret void
}
; CHECK-LABEL: test_load_add_64
; CHECK: db 21
; CHECK: lock *(u64 *)(r1 + 0) += r2
-define void @test_load_add_64(i64* %p, i64 zeroext %v) {
+define void @test_load_add_64(ptr %p, i64 zeroext %v) {
entry:
- atomicrmw add i64* %p, i64 %v seq_cst
+ atomicrmw add ptr %p, i64 %v seq_cst
ret void
}
diff --git a/llvm/test/CodeGen/BPF/objdump_cond_op.ll b/llvm/test/CodeGen/BPF/objdump_cond_op.ll
index 4422e19aa0db1..d6d7ebc64b830 100644
--- a/llvm/test/CodeGen/BPF/objdump_cond_op.ll
+++ b/llvm/test/CodeGen/BPF/objdump_cond_op.ll
@@ -21,7 +21,7 @@ define i32 @test(i32, i32) local_unnamed_addr #0 {
br i1 %3, label %4, label %8
; <label>:4: ; preds = %2
- %5 = load i32, i32* @gbl, align 4
+ %5 = load i32, ptr @gbl, align 4
%6 = shl i32 %5, 1
%7 = mul i32 %6, %5
br label %13
@@ -31,7 +31,7 @@ define i32 @test(i32, i32) local_unnamed_addr #0 {
; <label>:8: ; preds = %2
%9 = icmp eq i32 %0, %1
- %10 = load i32, i32* @gbl, align 4
+ %10 = load i32, ptr @gbl, align 4
br i1 %9, label %15, label %11
; CHECK: r1 = 0 ll
@@ -54,7 +54,7 @@ define i32 @test(i32, i32) local_unnamed_addr #0 {
; <label>:13: ; preds = %4, %11
%14 = phi i32 [ %12, %11 ], [ %7, %4 ]
- store i32 %14, i32* @gbl, align 4
+ store i32 %14, ptr @gbl, align 4
br label %15
; CHECK-LABEL: <LBB0_4>:
; CHECK: r1 = 0 ll
diff --git a/llvm/test/CodeGen/BPF/objdump_imm_hex.ll b/llvm/test/CodeGen/BPF/objdump_imm_hex.ll
index 65c28641734bf..1b0e9456faab1 100644
--- a/llvm/test/CodeGen/BPF/objdump_imm_hex.ll
+++ b/llvm/test/CodeGen/BPF/objdump_imm_hex.ll
@@ -31,7 +31,7 @@ define i32 @test(i64, i64) local_unnamed_addr #0 {
; CHECK-HEX: 5d 31 07 00 00 00 00 00 if r1 != r3 goto +0x7
; <label>:4: ; preds = %2
- %5 = load i32, i32* @gbl, align 4
+ %5 = load i32, ptr @gbl, align 4
%6 = shl i32 %5, 1
; CHECK-DEC: 67 01 00 00 01 00 00 00 r1 <<= 1
; CHECK-HEX: 67 01 00 00 01 00 00 00 r1 <<= 0x1
@@ -45,14 +45,14 @@ define i32 @test(i64, i64) local_unnamed_addr #0 {
br i1 %9, label %10, label %16
; <label>:10: ; preds = %8
- %11 = load i32, i32* @gbl, align 4
+ %11 = load i32, ptr @gbl, align 4
%12 = shl nsw i32 %11, 2
br label %13
; <label>:13: ; preds = %4, %10
%14 = phi i32 [ %12, %10 ], [ %7, %4 ]
%15 = phi i32 [ 2, %10 ], [ 1, %4 ]
- store i32 %14, i32* @gbl, align 4
+ store i32 %14, ptr @gbl, align 4
; CHECK-DEC: 63 12 00 00 00 00 00 00 *(u32 *)(r2 + 0) = r1
; CHECK-HEX: 63 12 00 00 00 00 00 00 *(u32 *)(r2 + 0x0) = r1
br label %16
diff --git a/llvm/test/CodeGen/BPF/objdump_intrinsics.ll b/llvm/test/CodeGen/BPF/objdump_intrinsics.ll
index 0bf9458b6fcb0..952171ede5928 100644
--- a/llvm/test/CodeGen/BPF/objdump_intrinsics.ll
+++ b/llvm/test/CodeGen/BPF/objdump_intrinsics.ll
@@ -2,14 +2,14 @@
; RUN: llc -march=bpfeb -filetype=obj -o - %s | llvm-objdump --no-print-imm-hex -d - | FileCheck --check-prefix=CHECK-EB %s
; Function Attrs: nounwind uwtable
-define i32 @ld_b(i64 %foo, i64* nocapture %bar, i8* %ctx, i8* %ctx2) #0 {
- %1 = tail call i64 @llvm.bpf.load.byte(i8* %ctx, i64 123) #2
+define i32 @ld_b(i64 %foo, ptr nocapture %bar, ptr %ctx, ptr %ctx2) #0 {
+ %1 = tail call i64 @llvm.bpf.load.byte(ptr %ctx, i64 123) #2
%2 = add i64 %1, %foo
- %3 = load volatile i64, i64* %bar, align 8
+ %3 = load volatile i64, ptr %bar, align 8
%4 = add i64 %2, %3
- %5 = tail call i64 @llvm.bpf.load.byte(i8* %ctx2, i64 %foo) #2
+ %5 = tail call i64 @llvm.bpf.load.byte(ptr %ctx2, i64 %foo) #2
%6 = add i64 %4, %5
- %7 = load volatile i64, i64* %bar, align 8
+ %7 = load volatile i64, ptr %bar, align 8
%8 = add i64 %6, %7
%9 = trunc i64 %8 to i32
ret i32 %9
@@ -20,13 +20,13 @@ define i32 @ld_b(i64 %foo, i64* nocapture %bar, i8* %ctx, i8* %ctx2) #0 {
; CHECK-EB: r0 = *(u8 *)skb[r
}
-declare i64 @llvm.bpf.load.byte(i8*, i64) #1
+declare i64 @llvm.bpf.load.byte(ptr, i64) #1
; Function Attrs: nounwind uwtable
-define i32 @ld_h(i8* %ctx, i8* %ctx2, i32 %foo) #0 {
- %1 = tail call i64 @llvm.bpf.load.half(i8* %ctx, i64 123) #2
+define i32 @ld_h(ptr %ctx, ptr %ctx2, i32 %foo) #0 {
+ %1 = tail call i64 @llvm.bpf.load.half(ptr %ctx, i64 123) #2
%2 = sext i32 %foo to i64
- %3 = tail call i64 @llvm.bpf.load.half(i8* %ctx2, i64 %2) #2
+ %3 = tail call i64 @llvm.bpf.load.half(ptr %ctx2, i64 %2) #2
%4 = add i64 %3, %1
%5 = trunc i64 %4 to i32
ret i32 %5
@@ -37,13 +37,13 @@ define i32 @ld_h(i8* %ctx, i8* %ctx2, i32 %foo) #0 {
; CHECK-EB: r0 = *(u16 *)skb[123]
}
-declare i64 @llvm.bpf.load.half(i8*, i64) #1
+declare i64 @llvm.bpf.load.half(ptr, i64) #1
; Function Attrs: nounwind uwtable
-define i32 @ld_w(i8* %ctx, i8* %ctx2, i32 %foo) #0 {
- %1 = tail call i64 @llvm.bpf.load.word(i8* %ctx, i64 123) #2
+define i32 @ld_w(ptr %ctx, ptr %ctx2, i32 %foo) #0 {
+ %1 = tail call i64 @llvm.bpf.load.word(ptr %ctx, i64 123) #2
%2 = sext i32 %foo to i64
- %3 = tail call i64 @llvm.bpf.load.word(i8* %ctx2, i64 %2) #2
+ %3 = tail call i64 @llvm.bpf.load.word(ptr %ctx2, i64 %2) #2
%4 = add i64 %3, %1
%5 = trunc i64 %4 to i32
ret i32 %5
@@ -54,12 +54,12 @@ define i32 @ld_w(i8* %ctx, i8* %ctx2, i32 %foo) #0 {
; CHECK-EB: r0 = *(u32 *)skb[123]
}
-declare i64 @llvm.bpf.load.word(i8*, i64) #1
+declare i64 @llvm.bpf.load.word(ptr, i64) #1
define i32 @ld_pseudo() #0 {
entry:
%call = tail call i64 @llvm.bpf.pseudo(i64 2, i64 3)
- tail call void inttoptr (i64 4 to void (i64, i32)*)(i64 %call, i32 4) #2
+ tail call void inttoptr (i64 4 to ptr)(i64 %call, i32 4) #2
ret i32 0
; CHECK-LABEL: ld_pseudo:
; CHECK-EL: ld_pseudo r1, 2, 3
diff --git a/llvm/test/CodeGen/BPF/objdump_static_var.ll b/llvm/test/CodeGen/BPF/objdump_static_var.ll
index eedee858fc325..8763dfeca827a 100644
--- a/llvm/test/CodeGen/BPF/objdump_static_var.ll
+++ b/llvm/test/CodeGen/BPF/objdump_static_var.ll
@@ -10,10 +10,10 @@
; Function Attrs: norecurse nounwind
define dso_local i32 @test() local_unnamed_addr #0 {
- %1 = load volatile i64, i64* @a, align 8, !tbaa !2
+ %1 = load volatile i64, ptr @a, align 8, !tbaa !2
; CHECK: r1 = 0 ll
; CHECK: r1 = *(u64 *)(r1 + 0)
- %2 = load volatile i32, i32* @b, align 4, !tbaa !6
+ %2 = load volatile i32, ptr @b, align 4, !tbaa !6
; CHECK: r2 = 8 ll
; CHECK: r0 = *(u32 *)(r2 + 0)
%3 = trunc i64 %1 to i32
diff --git a/llvm/test/CodeGen/BPF/objdump_trivial.ll b/llvm/test/CodeGen/BPF/objdump_trivial.ll
index a0ceea258ef43..b7c8b7a8c63d7 100644
--- a/llvm/test/CodeGen/BPF/objdump_trivial.ll
+++ b/llvm/test/CodeGen/BPF/objdump_trivial.ll
@@ -10,9 +10,9 @@ define void @foo(i32 %a) {
%b = icmp sgt i32 %a, -1
br i1 %b, label %x, label %y
x:
-call void inttoptr (i64 1 to void ()*)()
+call void inttoptr (i64 1 to ptr)()
ret void
y:
-call void inttoptr (i64 2 to void ()*)()
+call void inttoptr (i64 2 to ptr)()
ret void
}
diff --git a/llvm/test/CodeGen/BPF/optnone-1.ll b/llvm/test/CodeGen/BPF/optnone-1.ll
index b38e2630ff28c..4f06f9d205a93 100644
--- a/llvm/test/CodeGen/BPF/optnone-1.ll
+++ b/llvm/test/CodeGen/BPF/optnone-1.ll
@@ -9,12 +9,12 @@ define dso_local i32 @test(i32 %a, i32 %b) #0 !dbg !7 {
entry:
%a.addr = alloca i32, align 4
%b.addr = alloca i32, align 4
- store i32 %a, i32* %a.addr, align 4
- call void @llvm.dbg.declare(metadata i32* %a.addr, metadata !11, metadata !DIExpression()), !dbg !12
- store i32 %b, i32* %b.addr, align 4
- call void @llvm.dbg.declare(metadata i32* %b.addr, metadata !13, metadata !DIExpression()), !dbg !14
- %0 = load i32, i32* %a.addr, align 4, !dbg !15
- %1 = load i32, i32* %b.addr, align 4, !dbg !16
+ store i32 %a, ptr %a.addr, align 4
+ call void @llvm.dbg.declare(metadata ptr %a.addr, metadata !11, metadata !DIExpression()), !dbg !12
+ store i32 %b, ptr %b.addr, align 4
+ call void @llvm.dbg.declare(metadata ptr %b.addr, metadata !13, metadata !DIExpression()), !dbg !14
+ %0 = load i32, ptr %a.addr, align 4, !dbg !15
+ %1 = load i32, ptr %b.addr, align 4, !dbg !16
%add = add nsw i32 %0, %1, !dbg !17
ret i32 %add, !dbg !18
}
diff --git a/llvm/test/CodeGen/BPF/reloc-3.ll b/llvm/test/CodeGen/BPF/reloc-3.ll
index 0acf2d938562b..58076d7cacdde 100644
--- a/llvm/test/CodeGen/BPF/reloc-3.ll
+++ b/llvm/test/CodeGen/BPF/reloc-3.ll
@@ -5,13 +5,13 @@
; source code:
; int g() { return 0; }
-; struct t { void *p; } gbl = { g };
+; struct t { ptr p; } gbl = { g };
; compilation flag:
; clang -target bpf -O2 -emit-llvm -S test.c
-%struct.t = type { i8* }
+%struct.t = type { ptr }
- at gbl = dso_local local_unnamed_addr global %struct.t { i8* bitcast (i32 ()* @g to i8*) }, align 8
+ at gbl = dso_local local_unnamed_addr global %struct.t { ptr @g }, align 8
; CHECK: '.rel.data'
; CHECK: 0000000000000000 0000000200000002 R_BPF_64_ABS64 0000000000000000 g
diff --git a/llvm/test/CodeGen/BPF/reloc-btf-2.ll b/llvm/test/CodeGen/BPF/reloc-btf-2.ll
index 7a287ae2ce587..3f1c4da463519 100644
--- a/llvm/test/CodeGen/BPF/reloc-btf-2.ll
+++ b/llvm/test/CodeGen/BPF/reloc-btf-2.ll
@@ -15,8 +15,8 @@
; Function Attrs: norecurse nounwind
define dso_local i32 @test() local_unnamed_addr #0 !dbg !14 {
- %1 = load i32, i32* @g, align 4, !dbg !17, !tbaa !18
- %2 = load volatile i32, i32* @s, align 4, !dbg !22, !tbaa !18
+ %1 = load i32, ptr @g, align 4, !dbg !17, !tbaa !18
+ %2 = load volatile i32, ptr @s, align 4, !dbg !22, !tbaa !18
%3 = add nsw i32 %2, %1, !dbg !23
ret i32 %3, !dbg !24
}
diff --git a/llvm/test/CodeGen/BPF/remove_truncate_1.ll b/llvm/test/CodeGen/BPF/remove_truncate_1.ll
index 65433853b9d50..6b35d3f08c443 100644
--- a/llvm/test/CodeGen/BPF/remove_truncate_1.ll
+++ b/llvm/test/CodeGen/BPF/remove_truncate_1.ll
@@ -34,36 +34,34 @@
@gbl = common local_unnamed_addr global i32 0, align 4
; Function Attrs: norecurse nounwind
-define i32 @xdp_dummy(%struct.xdp_md* nocapture readonly %xdp) local_unnamed_addr #0 {
+define i32 @xdp_dummy(ptr nocapture readonly %xdp) local_unnamed_addr #0 {
entry:
- %0 = load i32, i32* @gbl, align 4
+ %0 = load i32, ptr @gbl, align 4
%tobool = icmp eq i32 %0, 0
br i1 %tobool, label %if.else, label %if.then
if.then: ; preds = %entry
- %data = getelementptr inbounds %struct.xdp_md, %struct.xdp_md* %xdp, i64 0, i32 0
- %1 = load i32, i32* %data, align 4
+ %1 = load i32, ptr %xdp, align 4
%conv = zext i32 %1 to i64
- %2 = inttoptr i64 %conv to i8*
- %3 = load i8, i8* %2, align 1
+ %2 = inttoptr i64 %conv to ptr
+ %3 = load i8, ptr %2, align 1
%cmp = icmp eq i8 %3, 1
br i1 %cmp, label %cleanup20, label %if.end12
; CHECK: r1 = *(u32 *)(r1 + 0)
; CHECK: r2 = *(u8 *)(r1 + 0)
if.else: ; preds = %entry
- %data_end = getelementptr inbounds %struct.xdp_md, %struct.xdp_md* %xdp, i64 0, i32 1
- %4 = load i32, i32* %data_end, align 4
+ %data_end = getelementptr inbounds %struct.xdp_md, ptr %xdp, i64 0, i32 1
+ %4 = load i32, ptr %data_end, align 4
%conv6 = zext i32 %4 to i64
; CHECK: r2 = *(u32 *)(r1 + 4)
- %5 = inttoptr i64 %conv6 to i8*
- %6 = load volatile i8, i8* %5, align 1
+ %5 = inttoptr i64 %conv6 to ptr
+ %6 = load volatile i8, ptr %5, align 1
%cmp8 = icmp eq i8 %6, 1
br i1 %cmp8, label %cleanup20, label %if.else.if.end12_crit_edge
if.else.if.end12_crit_edge: ; preds = %if.else
- %data13.phi.trans.insert = getelementptr inbounds %struct.xdp_md, %struct.xdp_md* %xdp, i64 0, i32 0
- %.pre = load i32, i32* %data13.phi.trans.insert, align 4
+ %.pre = load i32, ptr %xdp, align 4
br label %if.end12
; CHECK: r1 = *(u32 *)(r1 + 0)
@@ -72,8 +70,8 @@ if.end12: ; preds = %if.else.if.end12_cr
%conv14 = zext i32 %7 to i64
; CHECK-NOT: r1 <<= 32
; CHECK-NOT: r1 >>= 32
- %8 = inttoptr i64 %conv14 to i8*
- %9 = load volatile i8, i8* %8, align 1
+ %8 = inttoptr i64 %conv14 to ptr
+ %9 = load volatile i8, ptr %8, align 1
; CHECK: r1 = *(u8 *)(r1 + 0)
%cmp16 = icmp eq i8 %9, 0
%.28 = zext i1 %cmp16 to i32
diff --git a/llvm/test/CodeGen/BPF/remove_truncate_2.ll b/llvm/test/CodeGen/BPF/remove_truncate_2.ll
index 979d820dd857b..7a043d2342c95 100644
--- a/llvm/test/CodeGen/BPF/remove_truncate_2.ll
+++ b/llvm/test/CodeGen/BPF/remove_truncate_2.ll
@@ -25,16 +25,15 @@
@gbl = common local_unnamed_addr global i32 0, align 4
; Function Attrs: norecurse nounwind readonly
-define i32 @xdp_dummy(%struct.xdp_md* nocapture readonly %xdp) local_unnamed_addr #0 {
+define i32 @xdp_dummy(ptr nocapture readonly %xdp) local_unnamed_addr #0 {
entry:
- %data = getelementptr inbounds %struct.xdp_md, %struct.xdp_md* %xdp, i64 0, i32 0
- %0 = load i32, i32* %data, align 4
+ %0 = load i32, ptr %xdp, align 4
%conv = zext i32 %0 to i64
- %1 = inttoptr i64 %conv to i8*
- %2 = load i8, i8* %1, align 1
+ %1 = inttoptr i64 %conv to ptr
+ %2 = load i8, ptr %1, align 1
; CHECK: r1 = *(u32 *)(r1 + 0)
; CHECK: r1 = *(u8 *)(r1 + 0)
- %3 = load i32, i32* @gbl, align 4
+ %3 = load i32, ptr @gbl, align 4
switch i32 %3, label %if.end [
i32 0, label %if.else
i32 1, label %cleanup
diff --git a/llvm/test/CodeGen/BPF/remove_truncate_4.ll b/llvm/test/CodeGen/BPF/remove_truncate_4.ll
index 4d77244604955..c38b741698669 100644
--- a/llvm/test/CodeGen/BPF/remove_truncate_4.ll
+++ b/llvm/test/CodeGen/BPF/remove_truncate_4.ll
@@ -3,9 +3,9 @@
; Source code:
;struct __sk_buff;
;unsigned long long
-;load_byte(void *skb, unsigned long long off) asm("llvm.bpf.load.byte");
+;load_byte(ptr skb, unsigned long long off) asm("llvm.bpf.load.byte");
;unsigned long long
-;load_half(void *skb, unsigned long long off) asm("llvm.bpf.load.half");
+;load_half(ptr skb, unsigned long long off) asm("llvm.bpf.load.half");
;typedef unsigned char uint8_t;
;typedef unsigned short uint16_t;
;
@@ -30,10 +30,9 @@
%struct.__sk_buff = type opaque
; Function Attrs: nounwind readonly
-define i32 @func_b(%struct.__sk_buff* %skb) local_unnamed_addr #0 {
+define i32 @func_b(ptr %skb) local_unnamed_addr #0 {
entry:
- %0 = bitcast %struct.__sk_buff* %skb to i8*
- %call = tail call i64 @llvm.bpf.load.byte(i8* %0, i64 0)
+ %call = tail call i64 @llvm.bpf.load.byte(ptr %skb, i64 0)
%conv = trunc i64 %call to i32
%conv1 = and i32 %conv, 255
; CHECK-NOT: r0 &= 255
@@ -41,13 +40,12 @@ entry:
}
; Function Attrs: nounwind readonly
-declare i64 @llvm.bpf.load.byte(i8*, i64) #1
+declare i64 @llvm.bpf.load.byte(ptr, i64) #1
; Function Attrs: nounwind readonly
-define i32 @func_h(%struct.__sk_buff* %skb) local_unnamed_addr #0 {
+define i32 @func_h(ptr %skb) local_unnamed_addr #0 {
entry:
- %0 = bitcast %struct.__sk_buff* %skb to i8*
- %call = tail call i64 @llvm.bpf.load.half(i8* %0, i64 0)
+ %call = tail call i64 @llvm.bpf.load.half(ptr %skb, i64 0)
%conv = trunc i64 %call to i32
%conv1 = and i32 %conv, 65535
; CHECK-NOT: r0 &= 65535
@@ -55,4 +53,4 @@ entry:
}
; Function Attrs: nounwind readonly
-declare i64 @llvm.bpf.load.half(i8*, i64) #1
+declare i64 @llvm.bpf.load.half(ptr, i64) #1
diff --git a/llvm/test/CodeGen/BPF/remove_truncate_5.ll b/llvm/test/CodeGen/BPF/remove_truncate_5.ll
index 1e29a298eabb9..070d464c0c398 100644
--- a/llvm/test/CodeGen/BPF/remove_truncate_5.ll
+++ b/llvm/test/CodeGen/BPF/remove_truncate_5.ll
@@ -7,7 +7,7 @@
; int c;
; char d;
; };
-; void foo(void *);
+; void foo(ptr);
; void test() {
; struct test_t t = {.a = 5};
; foo(&t);
@@ -21,31 +21,30 @@
define dso_local void @test() local_unnamed_addr #0 {
; CHECK-LABEL: test:
%1 = alloca %struct.test_t, align 4
- %2 = bitcast %struct.test_t* %1 to i8*
- call void @llvm.lifetime.start.p0i8(i64 16, i8* nonnull %2) #3
- call void @llvm.memcpy.p0i8.p0i8.i64(i8* nonnull align 4 %2, i8* align 4 bitcast (%struct.test_t* @test.t to i8*), i64 16, i1 false)
+ call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %1) #3
+ call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 4 %1, ptr align 4 @test.t, i64 16, i1 false)
; CHECK: r1 = 0
; CHECK: *(u64 *)(r10 - 8) = r1
; CHECK: r1 = 5
; CHECK: *(u64 *)(r10 - 16) = r1
; CHECK: r1 = r10
; CHECK: r1 += -16
- call void @foo(i8* nonnull %2) #3
+ call void @foo(ptr nonnull %1) #3
; CHECK: call foo
- call void @llvm.lifetime.end.p0i8(i64 16, i8* nonnull %2) #3
+ call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %1) #3
ret void
}
; Function Attrs: argmemonly nounwind
-declare void @llvm.lifetime.start.p0i8(i64, i8* nocapture) #1
+declare void @llvm.lifetime.start.p0(i64, ptr nocapture) #1
; Function Attrs: argmemonly nounwind
-declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture writeonly, i8* nocapture readonly, i64, i1) #1
+declare void @llvm.memcpy.p0.p0.i64(ptr nocapture writeonly, ptr nocapture readonly, i64, i1) #1
-declare dso_local void @foo(i8*) local_unnamed_addr
+declare dso_local void @foo(ptr) local_unnamed_addr
; Function Attrs: argmemonly nounwind
-declare void @llvm.lifetime.end.p0i8(i64, i8* nocapture) #1
+declare void @llvm.lifetime.end.p0(i64, ptr nocapture) #1
attributes #0 = { nounwind }
attributes #1 = { argmemonly nounwind }
diff --git a/llvm/test/CodeGen/BPF/remove_truncate_6.ll b/llvm/test/CodeGen/BPF/remove_truncate_6.ll
index 6577afb13baee..54e10313cef6f 100644
--- a/llvm/test/CodeGen/BPF/remove_truncate_6.ll
+++ b/llvm/test/CodeGen/BPF/remove_truncate_6.ll
@@ -24,13 +24,13 @@
; }
; Function Attrs: nofree norecurse nounwind optsize
-define dso_local void @cal1(i16* nocapture readonly %a, i64* nocapture %b, i32 %k) local_unnamed_addr #0 {
+define dso_local void @cal1(ptr nocapture readonly %a, ptr nocapture %b, i32 %k) local_unnamed_addr #0 {
entry:
%cmp8 = icmp eq i32 %k, 0
br i1 %cmp8, label %for.cond.cleanup, label %for.body.preheader
for.body.preheader: ; preds = %entry
- %0 = load i16, i16* %a, align 2
+ %0 = load i16, ptr %a, align 2
%wide.trip.count = zext i32 %k to i64
br label %for.body
@@ -41,10 +41,10 @@ for.body: ; preds = %for.body, %for.body
%indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.body ]
%e.09 = phi i16 [ %0, %for.body.preheader ], [ %neg, %for.body ]
%conv = zext i16 %e.09 to i64
- %arrayidx = getelementptr inbounds i64, i64* %b, i64 %indvars.iv
+ %arrayidx = getelementptr inbounds i64, ptr %b, i64 %indvars.iv
; CHECK: r{{[0-9]+}} &= 65535
; CHECK-32: r{{[0-9]+}} &= 65535
- store i64 %conv, i64* %arrayidx, align 8
+ store i64 %conv, ptr %arrayidx, align 8
%neg = xor i16 %e.09, -1
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond = icmp eq i64 %indvars.iv.next, %wide.trip.count
@@ -52,13 +52,13 @@ for.body: ; preds = %for.body, %for.body
}
; Function Attrs: nofree norecurse nounwind optsize
-define dso_local void @cal2(i16* nocapture readonly %a, i32* nocapture %b, i32 %k) local_unnamed_addr #0 {
+define dso_local void @cal2(ptr nocapture readonly %a, ptr nocapture %b, i32 %k) local_unnamed_addr #0 {
entry:
%cmp8 = icmp eq i32 %k, 0
br i1 %cmp8, label %for.cond.cleanup, label %for.body.preheader
for.body.preheader: ; preds = %entry
- %0 = load i16, i16* %a, align 2
+ %0 = load i16, ptr %a, align 2
%wide.trip.count = zext i32 %k to i64
br label %for.body
@@ -69,10 +69,10 @@ for.body: ; preds = %for.body, %for.body
%indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.body ]
%e.09 = phi i16 [ %0, %for.body.preheader ], [ %neg, %for.body ]
%conv = zext i16 %e.09 to i32
- %arrayidx = getelementptr inbounds i32, i32* %b, i64 %indvars.iv
+ %arrayidx = getelementptr inbounds i32, ptr %b, i64 %indvars.iv
; CHECK: r{{[0-9]+}} &= 65535
; CHECK-32: w{{[0-9]+}} &= 65535
- store i32 %conv, i32* %arrayidx, align 4
+ store i32 %conv, ptr %arrayidx, align 4
%neg = xor i16 %e.09, -1
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond = icmp eq i64 %indvars.iv.next, %wide.trip.count
diff --git a/llvm/test/CodeGen/BPF/remove_truncate_7.ll b/llvm/test/CodeGen/BPF/remove_truncate_7.ll
index f5e79411aaaba..0d76a8d2e2d19 100644
--- a/llvm/test/CodeGen/BPF/remove_truncate_7.ll
+++ b/llvm/test/CodeGen/BPF/remove_truncate_7.ll
@@ -6,15 +6,15 @@
; unsigned data_end;
; };
;
-; void * test(int flag, struct __sk_buff *skb)
+; ptr test(int flag, struct __sk_buff *skb)
; {
-; void *p;
+; ptr p;
;
; if (flag) {
-; p = (void *)(long)skb->data;
+; p = (ptr)(long)skb->data;
; __asm__ __volatile__("": : :"memory");
; } else {
-; p = (void *)(long)skb->data_end;
+; p = (ptr)(long)skb->data_end;
; __asm__ __volatile__("": : :"memory");
; }
;
@@ -25,28 +25,27 @@
%struct.__sk_buff = type { i32, i32 }
-define dso_local i8* @test(i32 %flag, %struct.__sk_buff* nocapture readonly %skb) local_unnamed_addr {
+define dso_local ptr @test(i32 %flag, ptr nocapture readonly %skb) local_unnamed_addr {
entry:
%tobool = icmp eq i32 %flag, 0
br i1 %tobool, label %if.else, label %if.then
if.then:
- %data = getelementptr inbounds %struct.__sk_buff, %struct.__sk_buff* %skb, i64 0, i32 0
- %0 = load i32, i32* %data, align 4
+ %0 = load i32, ptr %skb, align 4
tail call void asm sideeffect "", "~{memory}"()
br label %if.end
if.else:
- %data_end = getelementptr inbounds %struct.__sk_buff, %struct.__sk_buff* %skb, i64 0, i32 1
- %1 = load i32, i32* %data_end, align 4
+ %data_end = getelementptr inbounds %struct.__sk_buff, ptr %skb, i64 0, i32 1
+ %1 = load i32, ptr %data_end, align 4
tail call void asm sideeffect "", "~{memory}"()
br label %if.end
if.end:
%p.0.in.in = phi i32 [ %0, %if.then ], [ %1, %if.else ]
%p.0.in = zext i32 %p.0.in.in to i64
- %p.0 = inttoptr i64 %p.0.in to i8*
- ret i8* %p.0
+ %p.0 = inttoptr i64 %p.0.in to ptr
+ ret ptr %p.0
}
; CHECK: w0 = *(u32 *)(r2 + 0)
diff --git a/llvm/test/CodeGen/BPF/remove_truncate_8.ll b/llvm/test/CodeGen/BPF/remove_truncate_8.ll
index fb1eabb0f0fd8..e1acd22d6693d 100644
--- a/llvm/test/CodeGen/BPF/remove_truncate_8.ll
+++ b/llvm/test/CodeGen/BPF/remove_truncate_8.ll
@@ -18,12 +18,11 @@
%struct.loc_prog = type { i32, i32 }
; Function Attrs: nofree norecurse nounwind willreturn
-define dso_local i32 @exec_prog(%struct.loc_prog* nocapture %prog) local_unnamed_addr {
+define dso_local i32 @exec_prog(ptr nocapture %prog) local_unnamed_addr {
entry:
- %ip = getelementptr inbounds %struct.loc_prog, %struct.loc_prog* %prog, i64 0, i32 0
- %0 = load i32, i32* %ip, align 4
- %len = getelementptr inbounds %struct.loc_prog, %struct.loc_prog* %prog, i64 0, i32 1
- %1 = load i32, i32* %len, align 4
+ %0 = load i32, ptr %prog, align 4
+ %len = getelementptr inbounds %struct.loc_prog, ptr %prog, i64 0, i32 1
+ %1 = load i32, ptr %len, align 4
%cmp = icmp ult i32 %0, %1
%cmp2 = icmp slt i32 %0, 3
%or.cond = and i1 %cmp2, %cmp
@@ -33,7 +32,7 @@ entry:
if.then3: ; preds = %entry
%add = add nsw i32 %0, 2
- store i32 %add, i32* %ip, align 4
+ store i32 %add, ptr %prog, align 4
br label %if.end5
if.end5: ; preds = %if.then3, %entry
diff --git a/llvm/test/CodeGen/BPF/rodata_1.ll b/llvm/test/CodeGen/BPF/rodata_1.ll
index 687a1531d596b..9eb1590bc96af 100644
--- a/llvm/test/CodeGen/BPF/rodata_1.ll
+++ b/llvm/test/CodeGen/BPF/rodata_1.ll
@@ -33,8 +33,8 @@ define i32 @test() local_unnamed_addr #0 {
; CHECK-LABEL: test:
entry:
- tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* getelementptr inbounds (%struct.test_t1, %struct.test_t1* @g1, i64 0, i32 0), i8* getelementptr inbounds (%struct.test_t1, %struct.test_t1* @test.t1, i64 0, i32 0), i64 3, i1 false)
- tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 4 bitcast (%struct.test_t2* @g2 to i8*), i8* align 4 bitcast (%struct.test_t2* @test.t2 to i8*), i64 20, i1 false)
+ tail call void @llvm.memcpy.p0.p0.i64(ptr @g1, ptr @test.t1, i64 3, i1 false)
+ tail call void @llvm.memcpy.p0.p0.i64(ptr align 4 @g2, ptr align 4 @test.t2, i64 20, i1 false)
; CHECK: r1 = g1
; CHECK: r2 = 0
; CHECK: *(u8 *)(r1 + 1) = r2
@@ -46,7 +46,7 @@ entry:
}
; CHECK: .section .rodata,"a", at progbits
-declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture writeonly, i8* nocapture readonly, i64, i1) #1
+declare void @llvm.memcpy.p0.p0.i64(ptr nocapture writeonly, ptr nocapture readonly, i64, i1) #1
attributes #0 = { nounwind }
attributes #1 = { argmemonly nounwind }
diff --git a/llvm/test/CodeGen/BPF/rodata_2.ll b/llvm/test/CodeGen/BPF/rodata_2.ll
index 4cbaf76f7248e..badb1aae5ed9f 100644
--- a/llvm/test/CodeGen/BPF/rodata_2.ll
+++ b/llvm/test/CodeGen/BPF/rodata_2.ll
@@ -31,7 +31,7 @@ define i32 @test() local_unnamed_addr #0 {
; CHECK-LABEL: test:
entry:
- tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 4 getelementptr inbounds (%struct.test_t2, %struct.test_t2* @g, i64 0, i32 0), i8* align 4 getelementptr inbounds (%struct.test_t2, %struct.test_t2* @test.t2, i64 0, i32 0), i64 32, i1 false)
+ tail call void @llvm.memcpy.p0.p0.i64(ptr align 4 @g, ptr align 4 @test.t2, i64 32, i1 false)
; CHECK: r1 = g ll
; CHECK: r2 = 3
; CHECK: *(u32 *)(r1 + 24) = r2
@@ -48,7 +48,7 @@ entry:
}
; CHECK: .section .rodata.cst32,"aM", at progbits,32
-declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture writeonly, i8* nocapture readonly, i64, i1) #1
+declare void @llvm.memcpy.p0.p0.i64(ptr nocapture writeonly, ptr nocapture readonly, i64, i1) #1
attributes #0 = { nounwind }
attributes #1 = { argmemonly nounwind }
diff --git a/llvm/test/CodeGen/BPF/rodata_3.ll b/llvm/test/CodeGen/BPF/rodata_3.ll
index df8296c8a2f2a..259e47504d920 100644
--- a/llvm/test/CodeGen/BPF/rodata_3.ll
+++ b/llvm/test/CodeGen/BPF/rodata_3.ll
@@ -25,7 +25,7 @@
; Function Attrs: nounwind
define i32 @test() local_unnamed_addr #0 {
entry:
- tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 4 getelementptr inbounds (%struct.test_t1, %struct.test_t1* @g, i64 0, i32 0), i8* align 4 getelementptr inbounds (%struct.test_t1, %struct.test_t1* @test.t1, i64 0, i32 0), i64 16, i1 false)
+ tail call void @llvm.memcpy.p0.p0.i64(ptr align 4 @g, ptr align 4 @test.t1, i64 16, i1 false)
; CHECK-EL: r2 = 1
; CHECK-EL: *(u32 *)(r1 + 0) = r2
; CHECK-EB: r2 = 16777216
@@ -35,7 +35,7 @@ entry:
; CHECK-EL: .section .rodata.cst16,"aM", at progbits,16
; CHECK-EB: .section .rodata.cst16,"aM", at progbits,16
-declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture writeonly, i8* nocapture readonly, i64, i1) #1
+declare void @llvm.memcpy.p0.p0.i64(ptr nocapture writeonly, ptr nocapture readonly, i64, i1) #1
attributes #0 = { nounwind }
attributes #1 = { argmemonly nounwind }
diff --git a/llvm/test/CodeGen/BPF/rodata_4.ll b/llvm/test/CodeGen/BPF/rodata_4.ll
index 23e9e36aa83ad..8153492a45337 100644
--- a/llvm/test/CodeGen/BPF/rodata_4.ll
+++ b/llvm/test/CodeGen/BPF/rodata_4.ll
@@ -27,7 +27,7 @@
define i32 @test() local_unnamed_addr #0 {
; CHECK-LABEL: test:
entry:
- tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 2 bitcast (%struct.test_t1* @g to i8*), i8* align 2 bitcast (%struct.test_t1* getelementptr inbounds ([4 x %struct.test_t1], [4 x %struct.test_t1]* @test.t1, i64 0, i64 1) to i8*), i64 6, i1 false)
+ tail call void @llvm.memcpy.p0.p0.i64(ptr align 2 @g, ptr align 2 getelementptr inbounds ([4 x %struct.test_t1], ptr @test.t1, i64 0, i64 1), i64 6, i1 false)
; CHECK: r2 = 600
; CHECK: *(u16 *)(r1 + 2) = r2
; CHECK: r2 = 60
@@ -37,7 +37,7 @@ entry:
; CHECK: .section .rodata,"a", at progbits
; Function Attrs: argmemonly nounwind
-declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture writeonly, i8* nocapture readonly, i64, i1) #1
+declare void @llvm.memcpy.p0.p0.i64(ptr nocapture writeonly, ptr nocapture readonly, i64, i1) #1
attributes #0 = { nounwind }
attributes #1 = { argmemonly nounwind }
diff --git a/llvm/test/CodeGen/BPF/rodata_5.ll b/llvm/test/CodeGen/BPF/rodata_5.ll
index 144a703ad0b21..223ec936e6465 100644
--- a/llvm/test/CodeGen/BPF/rodata_5.ll
+++ b/llvm/test/CodeGen/BPF/rodata_5.ll
@@ -7,7 +7,7 @@
; unsigned char b;
; unsigned char c;
; };
-; extern void foo(void *);
+; extern void foo(ptr);
; int test() {
; struct t v = {
; .b = 2,
@@ -26,11 +26,10 @@
define dso_local i32 @test() local_unnamed_addr {
entry:
%v1 = alloca [3 x i8], align 1
- %v1.sub = getelementptr inbounds [3 x i8], [3 x i8]* %v1, i64 0, i64 0
- call void @llvm.lifetime.start.p0i8(i64 3, i8* nonnull %v1.sub)
- call void @llvm.memcpy.p0i8.p0i8.i64(i8* nonnull align 1 dereferenceable(3) %v1.sub, i8* nonnull align 1 dereferenceable(3) getelementptr inbounds (%struct.t, %struct.t* @__const.test.v, i64 0, i32 0), i64 3, i1 false)
- call void @foo(i8* nonnull %v1.sub)
- call void @llvm.lifetime.end.p0i8(i64 3, i8* nonnull %v1.sub)
+ call void @llvm.lifetime.start.p0(i64 3, ptr nonnull %v1)
+ call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 1 dereferenceable(3) %v1, ptr nonnull align 1 dereferenceable(3) @__const.test.v, i64 3, i1 false)
+ call void @foo(ptr nonnull %v1)
+ call void @llvm.lifetime.end.p0(i64 3, ptr nonnull %v1)
ret i32 0
}
; CHECK-NOT: w{{[0-9]+}} = *(u16 *)
@@ -39,12 +38,12 @@ entry:
; CHECK: *(u8 *)(r10 - 2) = w{{[0-9]+}}
; Function Attrs: argmemonly nounwind willreturn
-declare void @llvm.lifetime.start.p0i8(i64 immarg, i8* nocapture)
+declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture)
; Function Attrs: argmemonly nounwind willreturn
-declare void @llvm.memcpy.p0i8.p0i8.i64(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i64, i1 immarg)
+declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg)
-declare dso_local void @foo(i8*) local_unnamed_addr
+declare dso_local void @foo(ptr) local_unnamed_addr
; Function Attrs: argmemonly nounwind willreturn
-declare void @llvm.lifetime.end.p0i8(i64 immarg, i8* nocapture)
+declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture)
diff --git a/llvm/test/CodeGen/BPF/rodata_6.ll b/llvm/test/CodeGen/BPF/rodata_6.ll
index 1af3d8dc230fe..fe9136d15bce1 100644
--- a/llvm/test/CodeGen/BPF/rodata_6.ll
+++ b/llvm/test/CodeGen/BPF/rodata_6.ll
@@ -16,7 +16,7 @@
; Function Attrs: norecurse nounwind readonly
define dso_local i32 @foo() local_unnamed_addr {
entry:
- %0 = load i32, i32* getelementptr inbounds (%struct.t1, %struct.t1* @data, i64 0, i32 0), align 4
+ %0 = load i32, ptr @data, align 4
%add = add nsw i32 %0, 20
; CHECK: [[REG1:r[0-9]+]] = data ll
; CHECK: r0 = *(u32 *)([[REG1]] + 0)
diff --git a/llvm/test/CodeGen/BPF/rodata_7.ll b/llvm/test/CodeGen/BPF/rodata_7.ll
index 69969a1403026..b68cbd36822ee 100644
--- a/llvm/test/CodeGen/BPF/rodata_7.ll
+++ b/llvm/test/CodeGen/BPF/rodata_7.ll
@@ -16,7 +16,7 @@
; Function Attrs: nofree norecurse nounwind
define dso_local i32 @foo() local_unnamed_addr {
entry:
- %0 = load volatile i32, i32* getelementptr inbounds (%struct.t1, %struct.t1* @data, i64 0, i32 0), align 4
+ %0 = load volatile i32, ptr @data, align 4
%add = add nsw i32 %0, 20
; CHECK: [[REG1:r[0-9]+]] = data ll
; CHECK: r0 = *(u32 *)([[REG1]] + 0)
diff --git a/llvm/test/CodeGen/BPF/sanity.ll b/llvm/test/CodeGen/BPF/sanity.ll
index 3974b426fb51d..117d1bb7d9522 100644
--- a/llvm/test/CodeGen/BPF/sanity.ll
+++ b/llvm/test/CodeGen/BPF/sanity.ll
@@ -152,14 +152,13 @@ define void @foo_printf() #1 {
; CHECK-NEXT: call printf
; CHECK-NEXT: exit
%fmt = alloca [9 x i8], align 1
- %1 = getelementptr inbounds [9 x i8], [9 x i8]* %fmt, i64 0, i64 0
- call void @llvm.memcpy.p0i8.p0i8.i64(i8* %1, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @foo_printf.fmt, i64 0, i64 0), i64 9, i1 false)
- %2 = call i32 (i8*, ...) @printf(i8* %1) #3
+ call void @llvm.memcpy.p0.p0.i64(ptr %fmt, ptr @foo_printf.fmt, i64 9, i1 false)
+ %1 = call i32 (ptr, ...) @printf(ptr %fmt) #3
ret void
}
; Function Attrs: nounwind
-declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture, i64, i1) #3
+declare void @llvm.memcpy.p0.p0.i64(ptr nocapture, ptr nocapture, i64, i1) #3
; Function Attrs: nounwind
-declare i32 @printf(i8* nocapture, ...) #4
+declare i32 @printf(ptr nocapture, ...) #4
diff --git a/llvm/test/CodeGen/BPF/select_ri.ll b/llvm/test/CodeGen/BPF/select_ri.ll
index 61e852d74b083..2c910eff06756 100644
--- a/llvm/test/CodeGen/BPF/select_ri.ll
+++ b/llvm/test/CodeGen/BPF/select_ri.ll
@@ -14,9 +14,9 @@
; Function Attrs: norecurse nounwind readonly
define i32 @test() local_unnamed_addr #0 {
entry:
- %0 = load i32, i32* @b, align 4
+ %0 = load i32, ptr @b, align 4
%tobool = icmp eq i32 %0, 0
- %1 = load i32, i32* @c, align 4
+ %1 = load i32, ptr @c, align 4
%. = select i1 %tobool, i32 0, i32 %1
; CHECK: r1 = b
; CHECK: r1 = *(u32 *)(r1 + 0)
@@ -30,11 +30,11 @@ attributes #0 = { norecurse nounwind readonly }
; Source file:
; unsigned long long
-; load_word(void *buf, unsigned long long off)
+; load_word(ptr buf, unsigned long long off)
; asm("llvm.bpf.load.word");
;
; int
-; foo(void *buf)
+; foo(ptr buf)
; {
; unsigned long long sum = 0;
;
@@ -48,9 +48,9 @@ attributes #0 = { norecurse nounwind readonly }
;}
; Function Attrs: nounwind readonly
-define i32 @foo(i8*) local_unnamed_addr #0 {
- %2 = tail call i64 @llvm.bpf.load.word(i8* %0, i64 100)
- %3 = tail call i64 @llvm.bpf.load.word(i8* %0, i64 104)
+define i32 @foo(ptr) local_unnamed_addr #0 {
+ %2 = tail call i64 @llvm.bpf.load.word(ptr %0, i64 100)
+ %3 = tail call i64 @llvm.bpf.load.word(ptr %0, i64 104)
%4 = add i64 %3, %2
%5 = icmp ne i64 %4, 8589934591
; CHECK: r{{[0-9]+}} = 8589934591 ll
@@ -59,7 +59,7 @@ define i32 @foo(i8*) local_unnamed_addr #0 {
}
; Function Attrs: nounwind readonly
-declare i64 @llvm.bpf.load.word(i8*, i64) #1
+declare i64 @llvm.bpf.load.word(ptr, i64) #1
; Source file:
; int m, n;
@@ -76,10 +76,10 @@ declare i64 @llvm.bpf.load.word(i8*, i64) #1
; Function Attrs: norecurse nounwind readonly
define i32 @test2() local_unnamed_addr #0 {
entry:
- %0 = load i32, i32* @m, align 4
+ %0 = load i32, ptr @m, align 4
%cmp = icmp slt i32 %0, 6
; CHECK: if r{{[0-9]+}} s{{<|>}} 6 goto
- %1 = load i32, i32* @n, align 4
+ %1 = load i32, ptr @n, align 4
%spec.select = select i1 %cmp, i32 %1, i32 %0
ret i32 %spec.select
}
diff --git a/llvm/test/CodeGen/BPF/selectiondag-bug.ll b/llvm/test/CodeGen/BPF/selectiondag-bug.ll
index 786f1ed4acd1e..2351994e45895 100644
--- a/llvm/test/CodeGen/BPF/selectiondag-bug.ll
+++ b/llvm/test/CodeGen/BPF/selectiondag-bug.ll
@@ -6,7 +6,7 @@
%printf_t = type { i64, i64 }
-define i64 @"kprobe:blk_update_request"(i8* %0) local_unnamed_addr section "s_kprobe:blk_update_request_1" {
+define i64 @"kprobe:blk_update_request"(ptr %0) local_unnamed_addr section "s_kprobe:blk_update_request_1" {
entry:
%"struct kernfs_node.parent" = alloca i64, align 8
%printf_args = alloca %printf_t, align 8
@@ -15,45 +15,42 @@ entry:
%"struct blkcg_gq.blkcg" = alloca i64, align 8
%"struct bio.bi_blkg" = alloca i64, align 8
%"struct request.bio" = alloca i64, align 8
- %1 = getelementptr i8, i8* %0, i64 112
- %2 = bitcast i8* %1 to i64*
- %arg0 = load volatile i64, i64* %2, align 8
- %3 = add i64 %arg0, 56
- %4 = bitcast i64* %"struct request.bio" to i8*
- call void @llvm.lifetime.start.p0i8(i64 -1, i8* nonnull %4)
- %probe_read = call i64 inttoptr (i64 4 to i64 (i64*, i32, i64)*)(i64* nonnull %"struct request.bio", i32 8, i64 %3)
- %5 = load i64, i64* %"struct request.bio", align 8
- call void @llvm.lifetime.end.p0i8(i64 -1, i8* nonnull %4)
- %6 = add i64 %5, 72
- %7 = bitcast i64* %"struct bio.bi_blkg" to i8*
- call void @llvm.lifetime.start.p0i8(i64 -1, i8* nonnull %7)
- %probe_read1 = call i64 inttoptr (i64 5 to i64 (i64*, i32, i64)*)(i64* nonnull %"struct bio.bi_blkg", i32 8, i64 %6)
- %8 = load i64, i64* %"struct bio.bi_blkg", align 8
- call void @llvm.lifetime.end.p0i8(i64 -1, i8* nonnull %7)
- %9 = add i64 %8, 40
- %10 = bitcast i64* %"struct blkcg_gq.blkcg" to i8*
- call void @llvm.lifetime.start.p0i8(i64 -1, i8* nonnull %10)
- %probe_read2 = call i64 inttoptr (i64 6 to i64 (i64*, i32, i64)*)(i64* nonnull %"struct blkcg_gq.blkcg", i32 8, i64 %9)
- %11 = load i64, i64* %"struct blkcg_gq.blkcg", align 8
- call void @llvm.lifetime.end.p0i8(i64 -1, i8* nonnull %10)
- %12 = bitcast i64* %"struct cgroup_subsys_state.cgroup" to i8*
- call void @llvm.lifetime.start.p0i8(i64 -1, i8* nonnull %12)
- %probe_read3 = call i64 inttoptr (i64 7 to i64 (i64*, i32, i64)*)(i64* nonnull %"struct cgroup_subsys_state.cgroup", i32 8, i64 %11)
- %13 = load i64, i64* %"struct cgroup_subsys_state.cgroup", align 8
- call void @llvm.lifetime.end.p0i8(i64 -1, i8* nonnull %12)
- %14 = add i64 %13, 288
- %15 = bitcast i64* %"struct cgroup.kn" to i8*
- call void @llvm.lifetime.start.p0i8(i64 -1, i8* nonnull %15)
- %probe_read4 = call i64 inttoptr (i64 8 to i64 (i64*, i32, i64)*)(i64* nonnull %"struct cgroup.kn", i32 8, i64 %14)
- %16 = load i64, i64* %"struct cgroup.kn", align 8
- call void @llvm.lifetime.end.p0i8(i64 -1, i8* nonnull %15)
- %17 = bitcast %printf_t* %printf_args to i8*
- call void @llvm.lifetime.start.p0i8(i64 -1, i8* nonnull %17)
- %18 = add i64 %16, 8
- %19 = bitcast i64* %"struct kernfs_node.parent" to i8*
- %20 = getelementptr inbounds %printf_t, %printf_t* %printf_args, i64 0, i32 0
- store i64 0, i64* %20, align 8
- call void @llvm.lifetime.start.p0i8(i64 -1, i8* nonnull %19)
+ %1 = getelementptr i8, ptr %0, i64 112
+ %arg0 = load volatile i64, ptr %1, align 8
+ %2 = add i64 %arg0, 56
+ %3 = bitcast ptr %"struct request.bio" to ptr
+ call void @llvm.lifetime.start.p0(i64 -1, ptr nonnull %3)
+ %probe_read = call i64 inttoptr (i64 4 to ptr)(ptr nonnull %"struct request.bio", i32 8, i64 %2)
+ %4 = load i64, ptr %"struct request.bio", align 8
+ call void @llvm.lifetime.end.p0(i64 -1, ptr nonnull %3)
+ %5 = add i64 %4, 72
+ %6 = bitcast ptr %"struct bio.bi_blkg" to ptr
+ call void @llvm.lifetime.start.p0(i64 -1, ptr nonnull %6)
+ %probe_read1 = call i64 inttoptr (i64 5 to ptr)(ptr nonnull %"struct bio.bi_blkg", i32 8, i64 %5)
+ %7 = load i64, ptr %"struct bio.bi_blkg", align 8
+ call void @llvm.lifetime.end.p0(i64 -1, ptr nonnull %6)
+ %8 = add i64 %7, 40
+ %9 = bitcast ptr %"struct blkcg_gq.blkcg" to ptr
+ call void @llvm.lifetime.start.p0(i64 -1, ptr nonnull %9)
+ %probe_read2 = call i64 inttoptr (i64 6 to ptr)(ptr nonnull %"struct blkcg_gq.blkcg", i32 8, i64 %8)
+ %10 = load i64, ptr %"struct blkcg_gq.blkcg", align 8
+ call void @llvm.lifetime.end.p0(i64 -1, ptr nonnull %9)
+ %11 = bitcast ptr %"struct cgroup_subsys_state.cgroup" to ptr
+ call void @llvm.lifetime.start.p0(i64 -1, ptr nonnull %11)
+ %probe_read3 = call i64 inttoptr (i64 7 to ptr)(ptr nonnull %"struct cgroup_subsys_state.cgroup", i32 8, i64 %10)
+ %12 = load i64, ptr %"struct cgroup_subsys_state.cgroup", align 8
+ call void @llvm.lifetime.end.p0(i64 -1, ptr nonnull %11)
+ %13 = add i64 %12, 288
+ %14 = bitcast ptr %"struct cgroup.kn" to ptr
+ call void @llvm.lifetime.start.p0(i64 -1, ptr nonnull %14)
+ %probe_read4 = call i64 inttoptr (i64 8 to ptr)(ptr nonnull %"struct cgroup.kn", i32 8, i64 %13)
+ %15 = load i64, ptr %"struct cgroup.kn", align 8
+ call void @llvm.lifetime.end.p0(i64 -1, ptr nonnull %14)
+ call void @llvm.lifetime.start.p0(i64 -1, ptr nonnull %printf_args)
+ %16 = add i64 %15, 8
+ %17 = bitcast ptr %"struct kernfs_node.parent" to ptr
+ store i64 0, ptr %printf_args, align 8
+ call void @llvm.lifetime.start.p0(i64 -1, ptr nonnull %17)
; CHECK: call 8
; CHECK-NOT: r{{[0-9]+}} = 0
@@ -61,22 +58,22 @@ entry:
; CHECK: [[REG1:r[0-9]+]] = 0
; CHECK: *(u64 *)(r10 - 24) = [[REG1]]
- %probe_read5 = call i64 inttoptr (i64 9 to i64 (i64*, i32, i64)*)(i64* nonnull %"struct kernfs_node.parent", i32 8, i64 %18)
- %21 = load i64, i64* %"struct kernfs_node.parent", align 8
- call void @llvm.lifetime.end.p0i8(i64 -1, i8* nonnull %19)
- %22 = getelementptr inbounds %printf_t, %printf_t* %printf_args, i64 0, i32 1
- store i64 %21, i64* %22, align 8
- %get_cpu_id = call i64 inttoptr (i64 18 to i64 ()*)()
- %perf_event_output = call i64 inttoptr (i64 10 to i64 (i8*, i64, i64, %printf_t*, i64)*)(i8* %0, i64 2, i64 %get_cpu_id, %printf_t* nonnull %printf_args, i64 16)
- call void @llvm.lifetime.end.p0i8(i64 -1, i8* nonnull %17)
+ %probe_read5 = call i64 inttoptr (i64 9 to ptr)(ptr nonnull %"struct kernfs_node.parent", i32 8, i64 %16)
+ %18 = load i64, ptr %"struct kernfs_node.parent", align 8
+ call void @llvm.lifetime.end.p0(i64 -1, ptr nonnull %17)
+ %19 = getelementptr inbounds %printf_t, ptr %printf_args, i64 0, i32 1
+ store i64 %18, ptr %19, align 8
+ %get_cpu_id = call i64 inttoptr (i64 18 to ptr)()
+ %perf_event_output = call i64 inttoptr (i64 10 to ptr)(ptr %0, i64 2, i64 %get_cpu_id, ptr nonnull %printf_args, i64 16)
+ call void @llvm.lifetime.end.p0(i64 -1, ptr nonnull %printf_args)
ret i64 0
}
; Function Attrs: argmemonly nounwind willreturn
-declare void @llvm.lifetime.start.p0i8(i64 immarg %0, i8* nocapture %1) #1
+declare void @llvm.lifetime.start.p0(i64 immarg %0, ptr nocapture %1) #1
; Function Attrs: argmemonly nounwind willreturn
-declare void @llvm.lifetime.end.p0i8(i64 immarg %0, i8* nocapture %1) #1
+declare void @llvm.lifetime.end.p0(i64 immarg %0, ptr nocapture %1) #1
attributes #0 = { nounwind }
attributes #1 = { argmemonly nounwind willreturn }
diff --git a/llvm/test/CodeGen/BPF/struct_ret1.ll b/llvm/test/CodeGen/BPF/struct_ret1.ll
index 29486b56a272d..9a43cc8fc0c90 100644
--- a/llvm/test/CodeGen/BPF/struct_ret1.ll
+++ b/llvm/test/CodeGen/BPF/struct_ret1.ll
@@ -9,8 +9,8 @@
; Function Attrs: nounwind readonly uwtable
define { i64, i32 } @bar(i32 %a, i32 %b, i32 %c, i32 %d, i32 %e) #0 {
entry:
- %retval.sroa.0.0.copyload = load i64, i64* bitcast (%struct.S* @s to i64*), align 4
- %retval.sroa.2.0.copyload = load i32, i32* getelementptr inbounds (%struct.S, %struct.S* @s, i64 0, i32 2), align 4
+ %retval.sroa.0.0.copyload = load i64, ptr @s, align 4
+ %retval.sroa.2.0.copyload = load i32, ptr getelementptr inbounds (%struct.S, ptr @s, i64 0, i32 2), align 4
%.fca.0.insert = insertvalue { i64, i32 } undef, i64 %retval.sroa.0.0.copyload, 0
%.fca.1.insert = insertvalue { i64, i32 } %.fca.0.insert, i32 %retval.sroa.2.0.copyload, 1
ret { i64, i32 } %.fca.1.insert
diff --git a/llvm/test/CodeGen/BPF/undef.ll b/llvm/test/CodeGen/BPF/undef.ll
index 099c2f8ac7649..54c115193192f 100644
--- a/llvm/test/CodeGen/BPF/undef.ll
+++ b/llvm/test/CodeGen/BPF/undef.ll
@@ -10,10 +10,10 @@
@test1 = global %struct.bpf_map_def { i32 2, i32 4, i32 8, i32 1024 }, section "maps", align 4
@test1_miss_4 = global %struct.bpf_map_def { i32 2, i32 1, i32 8, i32 1 }, section "maps", align 4
@_license = global [4 x i8] c"GPL\00", section "license", align 1
- at llvm.used = appending global [6 x i8*] [i8* getelementptr inbounds ([4 x i8], [4 x i8]* @_license, i32 0, i32 0), i8* bitcast (i32 (%struct.__sk_buff*)* @ebpf_filter to i8*), i8* bitcast (%struct.bpf_map_def* @routing to i8*), i8* bitcast (%struct.bpf_map_def* @routing_miss_0 to i8*), i8* bitcast (%struct.bpf_map_def* @test1 to i8*), i8* bitcast (%struct.bpf_map_def* @test1_miss_4 to i8*)], section "llvm.metadata"
+ at llvm.used = appending global [6 x ptr] [ptr @_license, ptr @ebpf_filter, ptr @routing, ptr @routing_miss_0, ptr @test1, ptr @test1_miss_4], section "llvm.metadata"
; Function Attrs: nounwind uwtable
-define i32 @ebpf_filter(%struct.__sk_buff* nocapture readnone %ebpf_packet) #0 section "socket1" {
+define i32 @ebpf_filter(ptr nocapture readnone %ebpf_packet) #0 section "socket1" {
; EL: r1 = 11033905661445 ll
; EB: r1 = 361984551142686720 ll
@@ -41,25 +41,24 @@ define i32 @ebpf_filter(%struct.__sk_buff* nocapture readnone %ebpf_packet) #0 s
; CHECK: call bpf_map_lookup_elem
; CHECK: exit
%key = alloca %struct.routing_key_2, align 1
- %1 = getelementptr inbounds %struct.routing_key_2, %struct.routing_key_2* %key, i64 0, i32 0, i64 0
- store i8 5, i8* %1, align 1
- %2 = getelementptr inbounds %struct.routing_key_2, %struct.routing_key_2* %key, i64 0, i32 0, i64 1
- store i8 6, i8* %2, align 1
- %3 = getelementptr inbounds %struct.routing_key_2, %struct.routing_key_2* %key, i64 0, i32 0, i64 2
- store i8 7, i8* %3, align 1
- %4 = getelementptr inbounds %struct.routing_key_2, %struct.routing_key_2* %key, i64 0, i32 0, i64 3
- store i8 8, i8* %4, align 1
- %5 = getelementptr inbounds %struct.routing_key_2, %struct.routing_key_2* %key, i64 0, i32 0, i64 4
- store i8 9, i8* %5, align 1
- %6 = getelementptr inbounds %struct.routing_key_2, %struct.routing_key_2* %key, i64 0, i32 0, i64 5
- store i8 10, i8* %6, align 1
- %7 = getelementptr inbounds %struct.routing_key_2, %struct.routing_key_2* %key, i64 1, i32 0, i64 0
- call void @llvm.memset.p0i8.i64(i8* %7, i8 0, i64 30, i1 false)
- %8 = call i32 (%struct.bpf_map_def*, %struct.routing_key_2*, ...) bitcast (i32 (...)* @bpf_map_lookup_elem to i32 (%struct.bpf_map_def*, %struct.routing_key_2*, ...)*)(%struct.bpf_map_def* nonnull @routing, %struct.routing_key_2* nonnull %key) #3
+ store i8 5, ptr %key, align 1
+ %1 = getelementptr inbounds %struct.routing_key_2, ptr %key, i64 0, i32 0, i64 1
+ store i8 6, ptr %1, align 1
+ %2 = getelementptr inbounds %struct.routing_key_2, ptr %key, i64 0, i32 0, i64 2
+ store i8 7, ptr %2, align 1
+ %3 = getelementptr inbounds %struct.routing_key_2, ptr %key, i64 0, i32 0, i64 3
+ store i8 8, ptr %3, align 1
+ %4 = getelementptr inbounds %struct.routing_key_2, ptr %key, i64 0, i32 0, i64 4
+ store i8 9, ptr %4, align 1
+ %5 = getelementptr inbounds %struct.routing_key_2, ptr %key, i64 0, i32 0, i64 5
+ store i8 10, ptr %5, align 1
+ %6 = getelementptr inbounds %struct.routing_key_2, ptr %key, i64 1, i32 0, i64 0
+ call void @llvm.memset.p0.i64(ptr %6, i8 0, i64 30, i1 false)
+ %7 = call i32 (ptr, ptr, ...) @bpf_map_lookup_elem(ptr nonnull @routing, ptr nonnull %key) #3
ret i32 undef
}
; Function Attrs: nounwind argmemonly
-declare void @llvm.memset.p0i8.i64(i8* nocapture, i8, i64, i1) #1
+declare void @llvm.memset.p0.i64(ptr nocapture, i8, i64, i1) #1
declare i32 @bpf_map_lookup_elem(...) #2
diff --git a/llvm/test/CodeGen/BPF/vla.ll b/llvm/test/CodeGen/BPF/vla.ll
index 6f8537fa91f2a..68124bf5e20f7 100644
--- a/llvm/test/CodeGen/BPF/vla.ll
+++ b/llvm/test/CodeGen/BPF/vla.ll
@@ -5,7 +5,7 @@
; struct t {
; char a[20];
; };
-; void foo(void *);
+; void foo(ptr);
;
; int test1() {
; const int a = 8;
@@ -32,84 +32,76 @@ define dso_local i32 @test1() {
; CHECK-LABEL: @test1(
; CHECK-NEXT: entry:
; CHECK-NEXT: [[A:%.*]] = alloca i32, align 4
-; CHECK-NEXT: [[SAVED_STACK:%.*]] = alloca i8*, align 8
-; CHECK-NEXT: [[TMP0:%.*]] = bitcast i32* [[A]] to i8*
-; CHECK-NEXT: call void @llvm.lifetime.start.p0i8(i64 4, i8* [[TMP0]])
-; CHECK-NEXT: store i32 8, i32* [[A]], align 4
+; CHECK-NEXT: [[SAVED_STACK:%.*]] = alloca ptr, align 8
+; CHECK-NEXT: call void @llvm.lifetime.start.p0(i64 4, ptr [[A]])
+; CHECK-NEXT: store i32 8, ptr [[A]], align 4
; CHECK-NEXT: [[VLA:%.*]] = alloca i8, i64 68, align 1
-; CHECK-NEXT: call void @foo(i8* [[VLA]])
-; CHECK-NEXT: [[TMP1:%.*]] = bitcast i32* [[A]] to i8*
-; CHECK-NEXT: call void @llvm.lifetime.end.p0i8(i64 4, i8* [[TMP1]])
+; CHECK-NEXT: call void @foo(ptr [[VLA]])
+; CHECK-NEXT: call void @llvm.lifetime.end.p0(i64 4, ptr [[A]])
; CHECK-NEXT: ret i32 0
;
entry:
%a = alloca i32, align 4
- %saved_stack = alloca i8*, align 8
- %0 = bitcast i32* %a to i8*
- call void @llvm.lifetime.start.p0i8(i64 4, i8* %0)
- store i32 8, i32* %a, align 4
- %1 = call i8* @llvm.stacksave()
- store i8* %1, i8** %saved_stack, align 8
+ %saved_stack = alloca ptr, align 8
+ call void @llvm.lifetime.start.p0(i64 4, ptr %a)
+ store i32 8, ptr %a, align 4
+ %0 = call ptr @llvm.stacksave()
+ store ptr %0, ptr %saved_stack, align 8
%vla = alloca i8, i64 68, align 1
- call void @foo(i8* %vla)
- %2 = load i8*, i8** %saved_stack, align 8
- call void @llvm.stackrestore(i8* %2)
- %3 = bitcast i32* %a to i8*
- call void @llvm.lifetime.end.p0i8(i64 4, i8* %3)
+ call void @foo(ptr %vla)
+ %1 = load ptr, ptr %saved_stack, align 8
+ call void @llvm.stackrestore(ptr %1)
+ call void @llvm.lifetime.end.p0(i64 4, ptr %a)
ret i32 0
}
-declare void @llvm.lifetime.start.p0i8(i64 immarg, i8* nocapture)
+declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture)
-declare i8* @llvm.stacksave()
+declare ptr @llvm.stacksave()
-declare dso_local void @foo(i8*)
+declare dso_local void @foo(ptr)
-declare void @llvm.stackrestore(i8*)
+declare void @llvm.stackrestore(ptr)
-declare void @llvm.lifetime.end.p0i8(i64 immarg, i8* nocapture)
+declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture)
define dso_local i32 @test2(i32 %b) {
; CHECK-LABEL: @test2(
; CHECK-NEXT: entry:
; CHECK-NEXT: [[B_ADDR:%.*]] = alloca i32, align 4
; CHECK-NEXT: [[A:%.*]] = alloca i32, align 4
-; CHECK-NEXT: [[SAVED_STACK:%.*]] = alloca i8*, align 8
+; CHECK-NEXT: [[SAVED_STACK:%.*]] = alloca ptr, align 8
; CHECK-NEXT: [[__VLA_EXPR0:%.*]] = alloca i64, align 8
-; CHECK-NEXT: store i32 [[B:%.*]], i32* [[B_ADDR]], align 4
-; CHECK-NEXT: [[TMP0:%.*]] = bitcast i32* [[A]] to i8*
-; CHECK-NEXT: call void @llvm.lifetime.start.p0i8(i64 4, i8* [[TMP0]])
-; CHECK-NEXT: store i32 8, i32* [[A]], align 4
-; CHECK-NEXT: [[TMP1:%.*]] = load i32, i32* [[B_ADDR]], align 4
+; CHECK-NEXT: store i32 [[B:%.*]], ptr [[B_ADDR]], align 4
+; CHECK-NEXT: call void @llvm.lifetime.start.p0(i64 4, ptr [[A]])
+; CHECK-NEXT: store i32 8, ptr [[A]], align 4
+; CHECK-NEXT: [[TMP1:%.*]] = load i32, ptr [[B_ADDR]], align 4
; CHECK-NEXT: [[ADD:%.*]] = add nsw i32 8, [[TMP1]]
; CHECK-NEXT: [[TMP2:%.*]] = zext i32 [[ADD]] to i64
; CHECK-NEXT: [[VLA:%.*]] = alloca i8, i64 [[TMP2]], align 1
-; CHECK-NEXT: store i64 [[TMP2]], i64* [[__VLA_EXPR0]], align 8
-; CHECK-NEXT: call void @foo(i8* [[VLA]])
-; CHECK-NEXT: [[TMP3:%.*]] = bitcast i32* [[A]] to i8*
-; CHECK-NEXT: call void @llvm.lifetime.end.p0i8(i64 4, i8* [[TMP3]])
+; CHECK-NEXT: store i64 [[TMP2]], ptr [[__VLA_EXPR0]], align 8
+; CHECK-NEXT: call void @foo(ptr [[VLA]])
+; CHECK-NEXT: call void @llvm.lifetime.end.p0(i64 4, ptr [[A]])
; CHECK-NEXT: ret i32 0
;
entry:
%b.addr = alloca i32, align 4
%a = alloca i32, align 4
- %saved_stack = alloca i8*, align 8
+ %saved_stack = alloca ptr, align 8
%__vla_expr0 = alloca i64, align 8
- store i32 %b, i32* %b.addr, align 4
- %0 = bitcast i32* %a to i8*
- call void @llvm.lifetime.start.p0i8(i64 4, i8* %0)
- store i32 8, i32* %a, align 4
- %1 = load i32, i32* %b.addr, align 4
- %add = add nsw i32 8, %1
- %2 = zext i32 %add to i64
- %3 = call i8* @llvm.stacksave()
- store i8* %3, i8** %saved_stack, align 8
- %vla = alloca i8, i64 %2, align 1
- store i64 %2, i64* %__vla_expr0, align 8
- call void @foo(i8* %vla)
- %4 = load i8*, i8** %saved_stack, align 8
- call void @llvm.stackrestore(i8* %4)
- %5 = bitcast i32* %a to i8*
- call void @llvm.lifetime.end.p0i8(i64 4, i8* %5)
+ store i32 %b, ptr %b.addr, align 4
+ call void @llvm.lifetime.start.p0(i64 4, ptr %a)
+ store i32 8, ptr %a, align 4
+ %0 = load i32, ptr %b.addr, align 4
+ %add = add nsw i32 8, %0
+ %1 = zext i32 %add to i64
+ %2 = call ptr @llvm.stacksave()
+ store ptr %2, ptr %saved_stack, align 8
+ %vla = alloca i8, i64 %1, align 1
+ store i64 %1, ptr %__vla_expr0, align 8
+ call void @foo(ptr %vla)
+ %3 = load ptr, ptr %saved_stack, align 8
+ call void @llvm.stackrestore(ptr %3)
+ call void @llvm.lifetime.end.p0(i64 4, ptr %a)
ret i32 0
}
diff --git a/llvm/test/CodeGen/BPF/warn-call.ll b/llvm/test/CodeGen/BPF/warn-call.ll
index b231be6bb7d07..fbfaead98f13d 100644
--- a/llvm/test/CodeGen/BPF/warn-call.ll
+++ b/llvm/test/CodeGen/BPF/warn-call.ll
@@ -2,26 +2,26 @@
; CHECK: error: warn_call.c
; CHECK: built-in function 'memcpy'
-define i8* @warn(i8* returned, i8*, i64) local_unnamed_addr #0 !dbg !6 {
- tail call void @llvm.dbg.value(metadata i8* %0, i64 0, metadata !14, metadata !17), !dbg !18
- tail call void @llvm.dbg.value(metadata i8* %1, i64 0, metadata !15, metadata !17), !dbg !19
+define ptr @warn(ptr returned, ptr, i64) local_unnamed_addr #0 !dbg !6 {
+ tail call void @llvm.dbg.value(metadata ptr %0, i64 0, metadata !14, metadata !17), !dbg !18
+ tail call void @llvm.dbg.value(metadata ptr %1, i64 0, metadata !15, metadata !17), !dbg !19
tail call void @llvm.dbg.value(metadata i64 %2, i64 0, metadata !16, metadata !17), !dbg !20
- tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %0, i8* %1, i64 %2, i1 false), !dbg !21
- %4 = tail call i8* @foo(i8* %0, i8* %1, i64 %2) #5, !dbg !22
- %5 = tail call fastcc i8* @bar(i8* %0), !dbg !23
- ret i8* %5, !dbg !24
+ tail call void @llvm.memcpy.p0.p0.i64(ptr %0, ptr %1, i64 %2, i1 false), !dbg !21
+ %4 = tail call ptr @foo(ptr %0, ptr %1, i64 %2) #5, !dbg !22
+ %5 = tail call fastcc ptr @bar(ptr %0), !dbg !23
+ ret ptr %5, !dbg !24
}
; Function Attrs: argmemonly nounwind
-declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture writeonly, i8* nocapture readonly, i64, i1) #1
+declare void @llvm.memcpy.p0.p0.i64(ptr nocapture writeonly, ptr nocapture readonly, i64, i1) #1
-declare i8* @foo(i8*, i8*, i64) local_unnamed_addr #2
+declare ptr @foo(ptr, ptr, i64) local_unnamed_addr #2
; Function Attrs: noinline nounwind readnone
-define internal fastcc i8* @bar(i8* readnone returned) unnamed_addr #3 !dbg !25 {
- tail call void @llvm.dbg.value(metadata i8* null, i64 0, metadata !28, metadata !17), !dbg !30
+define internal fastcc ptr @bar(ptr readnone returned) unnamed_addr #3 !dbg !25 {
+ tail call void @llvm.dbg.value(metadata ptr null, i64 0, metadata !28, metadata !17), !dbg !30
tail call void @llvm.dbg.value(metadata i64 0, i64 0, metadata !29, metadata !17), !dbg !31
- ret i8* %0, !dbg !32
+ ret ptr %0, !dbg !32
}
; Function Attrs: nounwind readnone
diff --git a/llvm/test/CodeGen/BPF/warn-stack.ll b/llvm/test/CodeGen/BPF/warn-stack.ll
index 0bf72780d883c..807e196b926d9 100644
--- a/llvm/test/CodeGen/BPF/warn-stack.ll
+++ b/llvm/test/CodeGen/BPF/warn-stack.ll
@@ -3,34 +3,32 @@
;; CHECK-NOT: nowarn
define void @nowarn() local_unnamed_addr #0 !dbg !6 {
%1 = alloca [504 x i8], align 1
- %2 = getelementptr inbounds [504 x i8], [504 x i8]* %1, i64 0, i64 0, !dbg !15
- call void @llvm.lifetime.start.p0i8(i64 504, i8* nonnull %2) #4, !dbg !15
- tail call void @llvm.dbg.declare(metadata [504 x i8]* %1, metadata !10, metadata !16), !dbg !17
- call void @doit(i8* nonnull %2) #4, !dbg !18
- call void @llvm.lifetime.end.p0i8(i64 504, i8* nonnull %2) #4, !dbg !19
+ call void @llvm.lifetime.start.p0(i64 504, ptr nonnull %1) #4, !dbg !15
+ tail call void @llvm.dbg.declare(metadata ptr %1, metadata !10, metadata !16), !dbg !17
+ call void @doit(ptr nonnull %1) #4, !dbg !18
+ call void @llvm.lifetime.end.p0(i64 504, ptr nonnull %1) #4, !dbg !19
ret void, !dbg !19
}
; Function Attrs: argmemonly nounwind
-declare void @llvm.lifetime.start.p0i8(i64, i8* nocapture) #1
+declare void @llvm.lifetime.start.p0(i64, ptr nocapture) #1
; Function Attrs: nounwind readnone
declare void @llvm.dbg.declare(metadata, metadata, metadata) #2
-declare void @doit(i8*) local_unnamed_addr #3
+declare void @doit(ptr) local_unnamed_addr #3
; Function Attrs: argmemonly nounwind
-declare void @llvm.lifetime.end.p0i8(i64, i8* nocapture) #1
+declare void @llvm.lifetime.end.p0(i64, ptr nocapture) #1
; CHECK: error: warn_stack.c
; CHECK: BPF stack limit
define void @warn() local_unnamed_addr #0 !dbg !20 {
%1 = alloca [512 x i8], align 1
- %2 = getelementptr inbounds [512 x i8], [512 x i8]* %1, i64 0, i64 0, !dbg !26
- call void @llvm.lifetime.start.p0i8(i64 512, i8* nonnull %2) #4, !dbg !26
- tail call void @llvm.dbg.declare(metadata [512 x i8]* %1, metadata !22, metadata !16), !dbg !27
- call void @doit(i8* nonnull %2) #4, !dbg !28
- call void @llvm.lifetime.end.p0i8(i64 512, i8* nonnull %2) #4, !dbg !29
+ call void @llvm.lifetime.start.p0(i64 512, ptr nonnull %1) #4, !dbg !26
+ tail call void @llvm.dbg.declare(metadata ptr %1, metadata !22, metadata !16), !dbg !27
+ call void @doit(ptr nonnull %1) #4, !dbg !28
+ call void @llvm.lifetime.end.p0(i64 512, ptr nonnull %1) #4, !dbg !29
ret void, !dbg !29
}
More information about the llvm-commits
mailing list