Skip to content

Commit 60cdd12

Browse files
committed
[CodeExtractor] Convert tests to opaque pointers (NFC)
Keeping bitcasts to preserve test behavior.
1 parent bbfa7ef commit 60cdd12

File tree

3 files changed

+37
-37
lines changed

3 files changed

+37
-37
lines changed

llvm/test/Transforms/CodeExtractor/PartialInlineAlloca4.ll

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,49 @@
11
; RUN: opt < %s -passes=partial-inliner -skip-partial-inlining-cost-analysis -S | FileCheck %s
22
; RUN: opt < %s -passes=partial-inliner -skip-partial-inlining-cost-analysis -S | FileCheck %s
33

4-
%"class.base" = type { %"struct.base"* }
4+
%"class.base" = type { ptr }
55
%"struct.base" = type opaque
66

77
@g = external local_unnamed_addr global i32, align 4
88

99
; CHECK-LABEL: define{{.*}}@caller(
10-
; CHECK: call void @llvm.lifetime.start.p0i8(i64 -1, i8* %tmp.i)
11-
; CHECK-NEXT: call void @callee_unknown_use1.{{.*}}(i8* %tmp.i
10+
; CHECK: call void @llvm.lifetime.start.p0(i64 -1, ptr %tmp.i)
11+
; CHECK-NEXT: call void @callee_unknown_use1.{{.*}}(ptr %tmp.i
1212

1313
define i32 @callee_unknown_use1(i32 %arg) local_unnamed_addr #0 {
1414
; CHECK-LABEL:define{{.*}}@callee_unknown_use1.{{[0-9]}}
1515
; CHECK-NOT: alloca
1616
bb:
1717
%tmp = alloca i8, align 4
18-
%tmp2 = load i32, i32* @g, align 4, !tbaa !2
18+
%tmp2 = load i32, ptr @g, align 4, !tbaa !2
1919
%tmp3 = add nsw i32 %tmp2, 1
2020
%tmp4 = icmp slt i32 %arg, 0
2121
br i1 %tmp4, label %bb6, label %bb5
2222

2323
bb5: ; preds = %bb
24-
call void @llvm.lifetime.start.p0i8(i64 4, i8* nonnull %tmp) #2
25-
store i32 %tmp3, i32* @g, align 4, !tbaa !2
26-
%tmp11 = bitcast i8* %tmp to i32*
27-
call void @bar(i32* nonnull %tmp11) #2
28-
call void @llvm.lifetime.end.p0i8(i64 4, i8* nonnull %tmp) #2
24+
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %tmp) #2
25+
store i32 %tmp3, ptr @g, align 4, !tbaa !2
26+
%tmp11 = bitcast ptr %tmp to ptr
27+
call void @bar(ptr nonnull %tmp11) #2
28+
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %tmp) #2
2929
br label %bb6
3030

3131
bb6: ; preds = %bb5, %bb
3232
%tmp7 = phi i32 [ 1, %bb5 ], [ 0, %bb ]
33-
%tmp1 = bitcast i8* %tmp to i32*
33+
%tmp1 = bitcast ptr %tmp to ptr
3434
ret i32 %tmp7
3535
}
3636

3737

3838
; Function Attrs: argmemonly nounwind
39-
declare void @llvm.lifetime.start.p0i8(i64, i8* nocapture) #1
39+
declare void @llvm.lifetime.start.p0(i64, ptr nocapture) #1
4040

41-
declare void @bar(i32*) local_unnamed_addr #2
42-
declare void @bar2(i32*, i32*) local_unnamed_addr #1
41+
declare void @bar(ptr) local_unnamed_addr #2
42+
declare void @bar2(ptr, ptr) local_unnamed_addr #1
4343

4444

4545
; Function Attrs: argmemonly nounwind
46-
declare void @llvm.lifetime.end.p0i8(i64, i8* nocapture) #1
46+
declare void @llvm.lifetime.end.p0(i64, ptr nocapture) #1
4747

4848
; Function Attrs: nounwind uwtable
4949
define i32 @caller(i32 %arg) local_unnamed_addr #0 {

llvm/test/Transforms/CodeExtractor/PartialInlineAlloca5.ll

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
; RUN: opt < %s -passes=partial-inliner -skip-partial-inlining-cost-analysis -S | FileCheck %s
22
; RUN: opt < %s -passes=partial-inliner -skip-partial-inlining-cost-analysis -S | FileCheck %s
33

4-
%"class.base" = type { %"struct.base"* }
4+
%"class.base" = type { ptr }
55
%"struct.base" = type opaque
66

77
@g = external local_unnamed_addr global i32, align 4
@@ -11,35 +11,35 @@ define i32 @callee_unknown_use2(i32 %arg) local_unnamed_addr #0 {
1111
; CHECK-NOT: alloca
1212
bb:
1313
%tmp = alloca i32, align 4
14-
%tmp1 = bitcast i32* %tmp to i8*
15-
%tmp2 = load i32, i32* @g, align 4, !tbaa !2
14+
%tmp1 = bitcast ptr %tmp to ptr
15+
%tmp2 = load i32, ptr @g, align 4, !tbaa !2
1616
%tmp3 = add nsw i32 %tmp2, 1
1717
%tmp4 = icmp slt i32 %arg, 0
1818
br i1 %tmp4, label %bb6, label %bb5
1919

2020
bb5: ; preds = %bb
21-
call void @llvm.lifetime.start.p0i8(i64 4, i8* nonnull %tmp1) #2
22-
store i32 %tmp3, i32* %tmp, align 4, !tbaa !2
23-
store i32 %tmp3, i32* @g, align 4, !tbaa !2
24-
call void @bar(i32* nonnull %tmp) #2
25-
call void @llvm.lifetime.end.p0i8(i64 4, i8* nonnull %tmp1) #2
21+
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %tmp1) #2
22+
store i32 %tmp3, ptr %tmp, align 4, !tbaa !2
23+
store i32 %tmp3, ptr @g, align 4, !tbaa !2
24+
call void @bar(ptr nonnull %tmp) #2
25+
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %tmp1) #2
2626
br label %bb6
2727

2828
bb6: ; preds = %bb5, %bb
2929
%tmp7 = phi i32 [ 1, %bb5 ], [ 0, %bb ]
30-
%tmp10 = bitcast i8* %tmp1 to i32*
30+
%tmp10 = bitcast ptr %tmp1 to ptr
3131
ret i32 %tmp7
3232
}
3333

3434
; Function Attrs: argmemonly nounwind
35-
declare void @llvm.lifetime.start.p0i8(i64, i8* nocapture) #1
35+
declare void @llvm.lifetime.start.p0(i64, ptr nocapture) #1
3636

37-
declare void @bar(i32*) local_unnamed_addr #2
38-
declare void @bar2(i32*, i32*) local_unnamed_addr #1
37+
declare void @bar(ptr) local_unnamed_addr #2
38+
declare void @bar2(ptr, ptr) local_unnamed_addr #1
3939

4040

4141
; Function Attrs: argmemonly nounwind
42-
declare void @llvm.lifetime.end.p0i8(i64, i8* nocapture) #1
42+
declare void @llvm.lifetime.end.p0(i64, ptr nocapture) #1
4343

4444
; Function Attrs: nounwind uwtable
4545
define i32 @caller(i32 %arg) local_unnamed_addr #0 {

llvm/test/Transforms/CodeExtractor/live_shrink_gep.ll

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,28 +9,28 @@
99
define void @_Z3foov() local_unnamed_addr {
1010
bb:
1111
%tmp = alloca %class.A, align 1
12-
%tmp1 = getelementptr inbounds %class.A, %class.A* %tmp, i64 0, i32 0
13-
call void @llvm.lifetime.start.p0i8(i64 1, i8* nonnull %tmp1)
14-
%tmp2 = load i32, i32* @cond, align 4, !tbaa !2
12+
%tmp1 = getelementptr inbounds %class.A, ptr %tmp, i64 0, i32 0
13+
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %tmp1)
14+
%tmp2 = load i32, ptr @cond, align 4, !tbaa !2
1515
%tmp3 = icmp eq i32 %tmp2, 0
1616
br i1 %tmp3, label %bb4, label %bb5
1717

1818
bb4: ; preds = %bb
19-
call void @_ZN1A7memfuncEv(%class.A* nonnull %tmp)
19+
call void @_ZN1A7memfuncEv(ptr nonnull %tmp)
2020
br label %bb5
2121

2222
bb5: ; preds = %bb4, %bb
23-
call void @llvm.lifetime.end.p0i8(i64 1, i8* nonnull %tmp1)
23+
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %tmp1)
2424
ret void
2525
}
2626

2727
; Function Attrs: argmemonly nounwind
28-
declare void @llvm.lifetime.start.p0i8(i64, i8* nocapture)
28+
declare void @llvm.lifetime.start.p0(i64, ptr nocapture)
2929

30-
declare void @_ZN1A7memfuncEv(%class.A*) local_unnamed_addr
30+
declare void @_ZN1A7memfuncEv(ptr) local_unnamed_addr
3131

3232
; Function Attrs: argmemonly nounwind
33-
declare void @llvm.lifetime.end.p0i8(i64, i8* nocapture)
33+
declare void @llvm.lifetime.end.p0(i64, ptr nocapture)
3434

3535
; Function Attrs: uwtable
3636
define void @_Z3goov() local_unnamed_addr {
@@ -51,8 +51,8 @@ bb:
5151
; CHECK: newFuncRoot:
5252
; CHECK-NEXT: %tmp = alloca %class.A
5353
; CHECK-NEXT: %tmp1 = getelementptr
54-
; CHECK-NEXT: call void @llvm.lifetime.start.p0i8
55-
; CHECK: call void @llvm.lifetime.end.p0i8
54+
; CHECK-NEXT: call void @llvm.lifetime.start.p0
55+
; CHECK: call void @llvm.lifetime.end.p0
5656
; CHECK-NEXT: br label %bb5.exitStub
5757

5858
!llvm.module.flags = !{!0}

0 commit comments

Comments
 (0)