1 ; RUN: opt < %s -partial-inliner -skip-partial-inlining-cost-analysis -S | FileCheck %s
2 ; RUN: opt < %s -passes=partial-inliner -skip-partial-inlining-cost-analysis -S | FileCheck %s
4 %"class.base" = type { %"struct.base"* }
5 %"struct.base" = type opaque
7 @g = external local_unnamed_addr global i32, align 4
9 ; 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
13 define i32 @callee_unknown_use1(i32 %arg) local_unnamed_addr #0 {
14 ; CHECK-LABEL:define{{.*}}@callee_unknown_use1.{{[0-9]}}
17 %tmp = alloca i8, align 4
18 %tmp2 = load i32, i32* @g, align 4, !tbaa !2
19 %tmp3 = add nsw i32 %tmp2, 1
20 %tmp4 = icmp slt i32 %arg, 0
21 br i1 %tmp4, label %bb6, label %bb5
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
31 bb6: ; preds = %bb5, %bb
32 %tmp7 = phi i32 [ 1, %bb5 ], [ 0, %bb ]
33 %tmp1 = bitcast i8* %tmp to i32*
38 ; Function Attrs: argmemonly nounwind
39 declare void @llvm.lifetime.start.p0i8(i64, i8* nocapture) #1
41 declare void @bar(i32*) local_unnamed_addr #2
42 declare void @bar2(i32*, i32*) local_unnamed_addr #1
45 ; Function Attrs: argmemonly nounwind
46 declare void @llvm.lifetime.end.p0i8(i64, i8* nocapture) #1
48 ; Function Attrs: nounwind uwtable
49 define i32 @caller(i32 %arg) local_unnamed_addr #0 {
51 %tmp = tail call i32 @callee_unknown_use1(i32 %arg)
55 attributes #0 = { nounwind uwtable}
56 attributes #1 = { argmemonly nounwind }
57 attributes #2 = { nounwind }
59 !llvm.module.flags = !{!0}
62 !0 = !{i32 1, !"wchar_size", i32 4}
63 !1 = !{!"clang version 5.0.0 (trunk 303574)"}
65 !3 = !{!"int", !4, i64 0}
66 !4 = !{!"omnipotent char", !5, i64 0}
67 !5 = !{!"Simple C/C++ TBAA"}