Skip to content

Commit ff9af4c

Browse files
committed
[CodeGen] Convert tests to opaque pointers (NFC)
1 parent 06f711a commit ff9af4c

File tree

457 files changed

+12407
-12419
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

457 files changed

+12407
-12419
lines changed

llvm/test/CodeGen/BPF/BTF/builtin-btf-type-id.ll

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ define dso_local void @prog1() #0 !dbg !28 {
2828
entry:
2929
%0 = load ptr, ptr @bpf_log, align 8, !dbg !31, !tbaa !32
3030
%1 = call i64 @llvm.bpf.btf.type.id(i32 0, i64 0), !dbg !36, !llvm.preserve.access.index !7
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
31+
%call = call i32 %0(i64 %1, ptr @tmp__abc, i32 104), !dbg !31
3232
ret void, !dbg !37
3333
}
3434

@@ -40,7 +40,7 @@ define dso_local void @prog2() #0 !dbg !38 {
4040
entry:
4141
%0 = load ptr, ptr @bpf_log, align 8, !dbg !39, !tbaa !32
4242
%1 = call i64 @llvm.bpf.btf.type.id(i32 1, i64 0), !dbg !40, !llvm.preserve.access.index !6
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 !39
43+
%call = call i32 %0(i64 %1, ptr @tmp__abc, i32 104), !dbg !39
4444
ret void, !dbg !41
4545
}
4646

@@ -49,7 +49,7 @@ define dso_local void @prog3() #0 !dbg !42 {
4949
entry:
5050
%0 = load ptr, ptr @bpf_log, align 8, !dbg !43, !tbaa !32
5151
%1 = call i64 @llvm.bpf.btf.type.id(i32 2, i64 1), !dbg !44, !llvm.preserve.access.index !11
52-
%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
52+
%call = call i32 %0(i64 %1, ptr @tmp__abc, i32 104), !dbg !43
5353
ret void, !dbg !45
5454
}
5555

llvm/test/CodeGen/BPF/BTF/static-var-zerolen-array.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
; Function Attrs: norecurse nounwind
1818
define dso_local i32 @test() local_unnamed_addr #0 !dbg !21 {
19-
%1 = load volatile i32, ptr getelementptr inbounds ({ i32, i32, [10 x i8] }, ptr @sv, i64 0, i32 0), align 4, !dbg !24, !tbaa !25
19+
%1 = load volatile i32, ptr @sv, align 4, !dbg !24, !tbaa !25
2020
ret i32 %1, !dbg !29
2121
}
2222

llvm/test/CodeGen/BPF/BTF/type-tag-fixup-fwd.ll

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,20 @@
1818
; Compilation flag:
1919
; clang -target bpf -O2 -g -S -emit-llvm test.c
2020

21-
%struct.map_value = type { %struct.foo* }
21+
%struct.map_value = type { ptr }
2222
%struct.foo = type opaque
2323

2424
; Function Attrs: nounwind
2525
define dso_local void @test() local_unnamed_addr #0 !dbg !7 {
2626
entry:
2727
%v = alloca %struct.map_value, align 8
28-
%0 = bitcast %struct.map_value* %v to i8*, !dbg !20
29-
call void @llvm.lifetime.start.p0i8(i64 8, i8* nonnull %0) #4, !dbg !20
30-
call void @llvm.dbg.declare(metadata %struct.map_value* %v, metadata !11, metadata !DIExpression()), !dbg !21
31-
%1 = bitcast %struct.map_value* %v to i64*, !dbg !21
32-
store i64 0, i64* %1, align 8, !dbg !21
33-
call void @func(%struct.map_value* noundef nonnull %v) #4, !dbg !22
34-
call void @llvm.lifetime.end.p0i8(i64 8, i8* nonnull %0) #4, !dbg !23
28+
%0 = bitcast ptr %v to ptr, !dbg !20
29+
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %0) #4, !dbg !20
30+
call void @llvm.dbg.declare(metadata ptr %v, metadata !11, metadata !DIExpression()), !dbg !21
31+
%1 = bitcast ptr %v to ptr, !dbg !21
32+
store i64 0, ptr %1, align 8, !dbg !21
33+
call void @func(ptr noundef nonnull %v) #4, !dbg !22
34+
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %0) #4, !dbg !23
3535
ret void, !dbg !23
3636
}
3737

@@ -80,15 +80,15 @@ entry:
8080
; CHECK: .ascii "func" # string offset=90
8181

8282
; Function Attrs: argmemonly mustprogress nofree nosync nounwind willreturn
83-
declare void @llvm.lifetime.start.p0i8(i64 immarg, i8* nocapture) #1
83+
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
8484

8585
; Function Attrs: mustprogress nofree nosync nounwind readnone speculatable willreturn
8686
declare void @llvm.dbg.declare(metadata, metadata, metadata) #2
8787

88-
declare !dbg !24 dso_local void @func(%struct.map_value* noundef) local_unnamed_addr #3
88+
declare !dbg !24 dso_local void @func(ptr noundef) local_unnamed_addr #3
8989

9090
; Function Attrs: argmemonly mustprogress nofree nosync nounwind willreturn
91-
declare void @llvm.lifetime.end.p0i8(i64 immarg, i8* nocapture) #1
91+
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
9292

9393
attributes #0 = { nounwind "frame-pointer"="all" "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" }
9494
attributes #1 = { argmemonly mustprogress nofree nosync nounwind willreturn }

llvm/test/CodeGen/BPF/BTF/type-tag-fixup-resolved.ll

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,20 +20,20 @@
2020
; Compilation flag:
2121
; clang -target bpf -O2 -g -S -emit-llvm test.c
2222

23-
%struct.map_value = type { %struct.foo* }
23+
%struct.map_value = type { ptr }
2424
%struct.foo = type { i32 }
2525

2626
; Function Attrs: nounwind
2727
define dso_local void @test() local_unnamed_addr #0 !dbg !7 {
2828
entry:
2929
%v = alloca %struct.map_value, align 8
30-
%0 = bitcast %struct.map_value* %v to i8*, !dbg !23
31-
call void @llvm.lifetime.start.p0i8(i64 8, i8* nonnull %0) #4, !dbg !23
32-
call void @llvm.dbg.declare(metadata %struct.map_value* %v, metadata !11, metadata !DIExpression()), !dbg !24
33-
%1 = bitcast %struct.map_value* %v to i64*, !dbg !24
34-
store i64 0, i64* %1, align 8, !dbg !24
35-
call void @func(%struct.map_value* noundef nonnull %v, %struct.foo* noundef null) #4, !dbg !25
36-
call void @llvm.lifetime.end.p0i8(i64 8, i8* nonnull %0) #4, !dbg !26
30+
%0 = bitcast ptr %v to ptr, !dbg !23
31+
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %0) #4, !dbg !23
32+
call void @llvm.dbg.declare(metadata ptr %v, metadata !11, metadata !DIExpression()), !dbg !24
33+
%1 = bitcast ptr %v to ptr, !dbg !24
34+
store i64 0, ptr %1, align 8, !dbg !24
35+
call void @func(ptr noundef nonnull %v, ptr noundef null) #4, !dbg !25
36+
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %0) #4, !dbg !26
3737
ret void, !dbg !26
3838
}
3939

@@ -96,15 +96,15 @@ entry:
9696
; CHECK: .ascii "tag1" # string offset=97
9797

9898
; Function Attrs: argmemonly mustprogress nofree nosync nounwind willreturn
99-
declare void @llvm.lifetime.start.p0i8(i64 immarg, i8* nocapture) #1
99+
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
100100

101101
; Function Attrs: mustprogress nofree nosync nounwind readnone speculatable willreturn
102102
declare void @llvm.dbg.declare(metadata, metadata, metadata) #2
103103

104-
declare !dbg !27 dso_local void @func(%struct.map_value* noundef, %struct.foo* noundef) local_unnamed_addr #3
104+
declare !dbg !27 dso_local void @func(ptr noundef, ptr noundef) local_unnamed_addr #3
105105

106106
; Function Attrs: argmemonly mustprogress nofree nosync nounwind willreturn
107-
declare void @llvm.lifetime.end.p0i8(i64 immarg, i8* nocapture) #1
107+
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
108108

109109
attributes #0 = { nounwind "frame-pointer"="all" "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" }
110110
attributes #1 = { argmemonly mustprogress nofree nosync nounwind willreturn }

llvm/test/CodeGen/BPF/CORE/offset-reloc-cast-array-1.ll

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,16 @@ target triple = "bpf"
2121
%struct.v1 = type { i32, i32 }
2222

2323
; Function Attrs: nounwind
24-
define dso_local i32 @test(%struct.v3* %arg) local_unnamed_addr #0 !dbg !22 {
24+
define dso_local i32 @test(ptr %arg) local_unnamed_addr #0 !dbg !22 {
2525
entry:
26-
call void @llvm.dbg.value(metadata %struct.v3* %arg, metadata !32, metadata !DIExpression()), !dbg !33
27-
%0 = tail call [100 x i32]* @llvm.preserve.struct.access.index.p0a100i32.p0s_struct.v3s(%struct.v3* elementtype(%struct.v3) %arg, i32 1, i32 1), !dbg !34, !llvm.preserve.access.index !26
28-
%1 = tail call i32* @llvm.preserve.array.access.index.p0i32.p0a100i32([100 x i32]* elementtype([100 x i32]) %0, i32 1, i32 0), !dbg !34, !llvm.preserve.access.index !15
29-
%2 = bitcast i32* %1 to [4 x %struct.v1]*, !dbg !34
30-
%3 = tail call [4 x %struct.v1]* @llvm.preserve.array.access.index.p0a4s_struct.v1s.p0a4s_struct.v1s([4 x %struct.v1]* elementtype([4 x %struct.v1]) %2, i32 0, i32 0), !dbg !34, !llvm.preserve.access.index !4
31-
%4 = tail call %struct.v1* @llvm.preserve.array.access.index.p0s_struct.v1s.p0a4s_struct.v1s([4 x %struct.v1]* elementtype([4 x %struct.v1]) %3, i32 1, i32 2), !dbg !34, !llvm.preserve.access.index !5
32-
%5 = tail call i32* @llvm.preserve.struct.access.index.p0i32.p0s_struct.v1s(%struct.v1* elementtype(%struct.v1) %4, i32 1, i32 1), !dbg !34, !llvm.preserve.access.index !8
33-
%call = tail call i32 @get_value(i32* %5) #4, !dbg !35
26+
call void @llvm.dbg.value(metadata ptr %arg, metadata !32, metadata !DIExpression()), !dbg !33
27+
%0 = tail call ptr @llvm.preserve.struct.access.index.p0.p0(ptr elementtype(%struct.v3) %arg, i32 1, i32 1), !dbg !34, !llvm.preserve.access.index !26
28+
%1 = tail call ptr @llvm.preserve.array.access.index.p0.p0(ptr elementtype([100 x i32]) %0, i32 1, i32 0), !dbg !34, !llvm.preserve.access.index !15
29+
%2 = bitcast ptr %1 to ptr, !dbg !34
30+
%3 = tail call ptr @llvm.preserve.array.access.index.p0.p0(ptr elementtype([4 x %struct.v1]) %2, i32 0, i32 0), !dbg !34, !llvm.preserve.access.index !4
31+
%4 = tail call ptr @llvm.preserve.array.access.index.p0.p0(ptr elementtype([4 x %struct.v1]) %3, i32 1, i32 2), !dbg !34, !llvm.preserve.access.index !5
32+
%5 = tail call ptr @llvm.preserve.struct.access.index.p0.p0(ptr elementtype(%struct.v1) %4, i32 1, i32 1), !dbg !34, !llvm.preserve.access.index !8
33+
%call = tail call i32 @get_value(ptr %5) #4, !dbg !35
3434
ret i32 %call, !dbg !36
3535
}
3636

@@ -60,22 +60,19 @@ entry:
6060
; CHECK-NEXT: .long 107
6161
; CHECK-NEXT: .long 0
6262

63-
declare dso_local i32 @get_value(i32*) local_unnamed_addr #1
63+
declare dso_local i32 @get_value(ptr) local_unnamed_addr #1
6464

6565
; Function Attrs: nounwind readnone
66-
declare [100 x i32]* @llvm.preserve.struct.access.index.p0a100i32.p0s_struct.v3s(%struct.v3*, i32, i32) #2
66+
declare ptr @llvm.preserve.struct.access.index.p0.p0(ptr, i32, i32) #2
6767

6868
; Function Attrs: nounwind readnone
69-
declare i32* @llvm.preserve.array.access.index.p0i32.p0a100i32([100 x i32]*, i32, i32) #2
69+
declare ptr @llvm.preserve.array.access.index.p0.p0(ptr, i32, i32) #2
7070

7171
; Function Attrs: nounwind readnone
72-
declare [4 x %struct.v1]* @llvm.preserve.array.access.index.p0a4s_struct.v1s.p0a4s_struct.v1s([4 x %struct.v1]*, i32, i32) #2
7372

7473
; Function Attrs: nounwind readnone
75-
declare %struct.v1* @llvm.preserve.array.access.index.p0s_struct.v1s.p0a4s_struct.v1s([4 x %struct.v1]*, i32, i32) #2
7674

7775
; Function Attrs: nounwind readnone
78-
declare i32* @llvm.preserve.struct.access.index.p0i32.p0s_struct.v1s(%struct.v1*, i32, i32) #2
7976

8077
; Function Attrs: nounwind readnone speculatable willreturn
8178
declare void @llvm.dbg.value(metadata, metadata, metadata) #3

llvm/test/CodeGen/BPF/CORE/offset-reloc-cast-array-2.ll

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,17 @@ target triple = "bpf"
2121
%struct.v1 = type { i32, i32 }
2222

2323
; Function Attrs: nounwind
24-
define dso_local i32 @test(%struct.v3* %arg) local_unnamed_addr #0 !dbg !24 {
24+
define dso_local i32 @test(ptr %arg) local_unnamed_addr #0 !dbg !24 {
2525
entry:
26-
call void @llvm.dbg.value(metadata %struct.v3* %arg, metadata !34, metadata !DIExpression()), !dbg !35
27-
%0 = tail call [100 x i32]* @llvm.preserve.struct.access.index.p0a100i32.p0s_struct.v3s(%struct.v3* elementtype(%struct.v3) %arg, i32 1, i32 1), !dbg !36, !llvm.preserve.access.index !28
28-
%1 = tail call i32* @llvm.preserve.array.access.index.p0i32.p0a100i32([100 x i32]* elementtype([100 x i32]) %0, i32 1, i32 0), !dbg !36, !llvm.preserve.access.index !15
29-
%2 = bitcast i32* %1 to [4 x [4 x %struct.v1]]*, !dbg !36
30-
%3 = tail call [4 x [4 x %struct.v1]]* @llvm.preserve.array.access.index.p0a4a4s_struct.v1s.p0a4a4s_struct.v1s([4 x [4 x %struct.v1]]* elementtype([4 x [4 x %struct.v1]]) %2, i32 0, i32 0), !dbg !36, !llvm.preserve.access.index !4
31-
%4 = tail call [4 x %struct.v1]* @llvm.preserve.array.access.index.p0a4s_struct.v1s.p0a4a4s_struct.v1s([4 x [4 x %struct.v1]]* elementtype([4 x [4 x %struct.v1]]) %3, i32 1, i32 2), !dbg !36, !llvm.preserve.access.index !5
32-
%5 = tail call %struct.v1* @llvm.preserve.array.access.index.p0s_struct.v1s.p0a4s_struct.v1s([4 x %struct.v1]* elementtype([4 x %struct.v1]) %4, i32 1, i32 3), !dbg !36, !llvm.preserve.access.index !18
33-
%6 = tail call i32* @llvm.preserve.struct.access.index.p0i32.p0s_struct.v1s(%struct.v1* elementtype(%struct.v1) %5, i32 1, i32 1), !dbg !36, !llvm.preserve.access.index !8
34-
%call = tail call i32 @get_value(i32* %6) #4, !dbg !37
26+
call void @llvm.dbg.value(metadata ptr %arg, metadata !34, metadata !DIExpression()), !dbg !35
27+
%0 = tail call ptr @llvm.preserve.struct.access.index.p0.p0(ptr elementtype(%struct.v3) %arg, i32 1, i32 1), !dbg !36, !llvm.preserve.access.index !28
28+
%1 = tail call ptr @llvm.preserve.array.access.index.p0.p0(ptr elementtype([100 x i32]) %0, i32 1, i32 0), !dbg !36, !llvm.preserve.access.index !15
29+
%2 = bitcast ptr %1 to ptr, !dbg !36
30+
%3 = tail call ptr @llvm.preserve.array.access.index.p0.p0(ptr elementtype([4 x [4 x %struct.v1]]) %2, i32 0, i32 0), !dbg !36, !llvm.preserve.access.index !4
31+
%4 = tail call ptr @llvm.preserve.array.access.index.p0.p0(ptr elementtype([4 x [4 x %struct.v1]]) %3, i32 1, i32 2), !dbg !36, !llvm.preserve.access.index !5
32+
%5 = tail call ptr @llvm.preserve.array.access.index.p0.p0(ptr elementtype([4 x %struct.v1]) %4, i32 1, i32 3), !dbg !36, !llvm.preserve.access.index !18
33+
%6 = tail call ptr @llvm.preserve.struct.access.index.p0.p0(ptr elementtype(%struct.v1) %5, i32 1, i32 1), !dbg !36, !llvm.preserve.access.index !8
34+
%call = tail call i32 @get_value(ptr %6) #4, !dbg !37
3535
ret i32 %call, !dbg !38
3636
}
3737

@@ -62,25 +62,21 @@ entry:
6262
; CHECK-NEXT: .long 107
6363
; CHECK-NEXT: .long 0
6464

65-
declare dso_local i32 @get_value(i32*) local_unnamed_addr #1
65+
declare dso_local i32 @get_value(ptr) local_unnamed_addr #1
6666

6767
; Function Attrs: nounwind readnone
68-
declare [100 x i32]* @llvm.preserve.struct.access.index.p0a100i32.p0s_struct.v3s(%struct.v3*, i32, i32) #2
68+
declare ptr @llvm.preserve.struct.access.index.p0.p0(ptr, i32, i32) #2
6969

7070
; Function Attrs: nounwind readnone
71-
declare i32* @llvm.preserve.array.access.index.p0i32.p0a100i32([100 x i32]*, i32, i32) #2
71+
declare ptr @llvm.preserve.array.access.index.p0.p0(ptr, i32, i32) #2
7272

7373
; Function Attrs: nounwind readnone
74-
declare [4 x [4 x %struct.v1]]* @llvm.preserve.array.access.index.p0a4a4s_struct.v1s.p0a4a4s_struct.v1s([4 x [4 x %struct.v1]]*, i32, i32) #2
7574

7675
; Function Attrs: nounwind readnone
77-
declare [4 x %struct.v1]* @llvm.preserve.array.access.index.p0a4s_struct.v1s.p0a4a4s_struct.v1s([4 x [4 x %struct.v1]]*, i32, i32) #2
7876

7977
; Function Attrs: nounwind readnone
80-
declare %struct.v1* @llvm.preserve.array.access.index.p0s_struct.v1s.p0a4s_struct.v1s([4 x %struct.v1]*, i32, i32) #2
8178

8279
; Function Attrs: nounwind readnone
83-
declare i32* @llvm.preserve.struct.access.index.p0i32.p0s_struct.v1s(%struct.v1*, i32, i32) #2
8480

8581
; Function Attrs: nounwind readnone speculatable willreturn
8682
declare void @llvm.dbg.value(metadata, metadata, metadata) #3

llvm/test/CodeGen/BPF/CORE/offset-reloc-cast-struct-3.ll

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@ target triple = "bpf"
2222
%struct.v1 = type { i32, i32 }
2323

2424
; Function Attrs: nounwind
25-
define dso_local i32 @test(%struct.v3* %arg) local_unnamed_addr #0 !dbg !19 {
25+
define dso_local i32 @test(ptr %arg) local_unnamed_addr #0 !dbg !19 {
2626
entry:
27-
call void @llvm.dbg.value(metadata %struct.v3* %arg, metadata !30, metadata !DIExpression()), !dbg !31
28-
%0 = tail call [40 x i32]* @llvm.preserve.struct.access.index.p0a40i32.p0s_struct.v3s(%struct.v3* elementtype(%struct.v3) %arg, i32 1, i32 1), !dbg !32, !llvm.preserve.access.index !24
29-
%1 = tail call i32* @llvm.preserve.array.access.index.p0i32.p0a40i32([40 x i32]* elementtype([40 x i32]) %0, i32 1, i32 4), !dbg !32, !llvm.preserve.access.index !11
30-
%2 = bitcast i32* %1 to %struct.v1*, !dbg !32
31-
%3 = tail call i32* @llvm.preserve.struct.access.index.p0i32.p0s_struct.v1s(%struct.v1* elementtype(%struct.v1) %2, i32 1, i32 1), !dbg !32, !llvm.preserve.access.index !6
32-
%call = tail call i32 @get_value(i32* %3) #4, !dbg !33
27+
call void @llvm.dbg.value(metadata ptr %arg, metadata !30, metadata !DIExpression()), !dbg !31
28+
%0 = tail call ptr @llvm.preserve.struct.access.index.p0.p0(ptr elementtype(%struct.v3) %arg, i32 1, i32 1), !dbg !32, !llvm.preserve.access.index !24
29+
%1 = tail call ptr @llvm.preserve.array.access.index.p0.p0(ptr elementtype([40 x i32]) %0, i32 1, i32 4), !dbg !32, !llvm.preserve.access.index !11
30+
%2 = bitcast ptr %1 to ptr, !dbg !32
31+
%3 = tail call ptr @llvm.preserve.struct.access.index.p0.p0(ptr elementtype(%struct.v1) %2, i32 1, i32 1), !dbg !32, !llvm.preserve.access.index !6
32+
%call = tail call i32 @get_value(ptr %3) #4, !dbg !33
3333
ret i32 %call, !dbg !34
3434
}
3535

@@ -60,16 +60,15 @@ entry:
6060
; CHECK-NEXT: .long 118
6161
; CHECK-NEXT: .long 0
6262

63-
declare dso_local i32 @get_value(i32*) local_unnamed_addr #1
63+
declare dso_local i32 @get_value(ptr) local_unnamed_addr #1
6464

6565
; Function Attrs: nounwind readnone
66-
declare [40 x i32]* @llvm.preserve.struct.access.index.p0a40i32.p0s_struct.v3s(%struct.v3*, i32, i32) #2
66+
declare ptr @llvm.preserve.struct.access.index.p0.p0(ptr, i32, i32) #2
6767

6868
; Function Attrs: nounwind readnone
69-
declare i32* @llvm.preserve.array.access.index.p0i32.p0a40i32([40 x i32]*, i32, i32) #2
69+
declare ptr @llvm.preserve.array.access.index.p0.p0(ptr, i32, i32) #2
7070

7171
; Function Attrs: nounwind readnone
72-
declare i32* @llvm.preserve.struct.access.index.p0i32.p0s_struct.v1s(%struct.v1*, i32, i32) #2
7372

7473
; Function Attrs: nounwind readnone speculatable willreturn
7574
declare void @llvm.dbg.value(metadata, metadata, metadata) #3

llvm/test/CodeGen/BPF/CORE/offset-reloc-cast-union-1.ll

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@ target triple = "bpf"
2424
%union.v1 = type { i32 }
2525

2626
; Function Attrs: nounwind
27-
define dso_local i32 @test(%union.v3* %arg) local_unnamed_addr #0 !dbg !15 {
27+
define dso_local i32 @test(ptr %arg) local_unnamed_addr #0 !dbg !15 {
2828
entry:
29-
call void @llvm.dbg.value(metadata %union.v3* %arg, metadata !33, metadata !DIExpression()), !dbg !34
30-
%0 = tail call %union.v3* @llvm.preserve.union.access.index.p0s_union.v3s.p0s_union.v3s(%union.v3* %arg, i32 1), !dbg !35, !llvm.preserve.access.index !20
31-
%1 = bitcast %union.v3* %0 to %union.v1*, !dbg !35
32-
%2 = tail call %union.v1* @llvm.preserve.union.access.index.p0s_union.v1s.p0s_union.v1s(%union.v1* %1, i32 1), !dbg !35, !llvm.preserve.access.index !6
33-
%b = getelementptr inbounds %union.v1, %union.v1* %2, i64 0, i32 0, !dbg !35
34-
%call = tail call i32 @get_value(i32* %b) #4, !dbg !36
29+
call void @llvm.dbg.value(metadata ptr %arg, metadata !33, metadata !DIExpression()), !dbg !34
30+
%0 = tail call ptr @llvm.preserve.union.access.index.p0.p0(ptr %arg, i32 1), !dbg !35, !llvm.preserve.access.index !20
31+
%1 = bitcast ptr %0 to ptr, !dbg !35
32+
%2 = tail call ptr @llvm.preserve.union.access.index.p0.p0(ptr %1, i32 1), !dbg !35, !llvm.preserve.access.index !6
33+
%b = getelementptr inbounds %union.v1, ptr %2, i64 0, i32 0, !dbg !35
34+
%call = tail call i32 @get_value(ptr %b) #4, !dbg !36
3535
ret i32 %call, !dbg !37
3636
}
3737

@@ -61,13 +61,12 @@ entry:
6161
; CHECK-NEXT: .long 45
6262
; CHECK-NEXT: .long 0
6363

64-
declare dso_local i32 @get_value(i32*) local_unnamed_addr #1
64+
declare dso_local i32 @get_value(ptr) local_unnamed_addr #1
6565

6666
; Function Attrs: nounwind readnone
67-
declare %union.v3* @llvm.preserve.union.access.index.p0s_union.v3s.p0s_union.v3s(%union.v3*, i32) #2
67+
declare ptr @llvm.preserve.union.access.index.p0.p0(ptr, i32) #2
6868

6969
; Function Attrs: nounwind readnone
70-
declare %union.v1* @llvm.preserve.union.access.index.p0s_union.v1s.p0s_union.v1s(%union.v1*, i32) #2
7170

7271
; Function Attrs: nounwind readnone speculatable willreturn
7372
declare void @llvm.dbg.value(metadata, metadata, metadata) #3

0 commit comments

Comments
 (0)