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 define i32 @callee_unknown_use2(i32 %arg) local_unnamed_addr #0 {
10 ; CHECK-LABEL:define{{.*}}@callee_unknown_use2.{{[0-9]}}
13 %tmp = alloca i32, align 4
14 %tmp1 = bitcast i32* %tmp to i8*
15 %tmp2 = load i32, i32* @g, align 4, !tbaa !2
16 %tmp3 = add nsw i32 %tmp2, 1
17 %tmp4 = icmp slt i32 %arg, 0
18 br i1 %tmp4, label %bb6, label %bb5
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
28 bb6: ; preds = %bb5, %bb
29 %tmp7 = phi i32 [ 1, %bb5 ], [ 0, %bb ]
30 %tmp10 = bitcast i8* %tmp1 to i32*
34 ; Function Attrs: argmemonly nounwind
35 declare void @llvm.lifetime.start.p0i8(i64, i8* nocapture) #1
37 declare void @bar(i32*) local_unnamed_addr #2
38 declare void @bar2(i32*, i32*) local_unnamed_addr #1
41 ; Function Attrs: argmemonly nounwind
42 declare void @llvm.lifetime.end.p0i8(i64, i8* nocapture) #1
44 ; Function Attrs: nounwind uwtable
45 define i32 @caller(i32 %arg) local_unnamed_addr #0 {
47 %tmp = tail call i32 @callee_unknown_use2(i32 %arg)
51 attributes #0 = { nounwind uwtable}
52 attributes #1 = { argmemonly nounwind }
53 attributes #2 = { nounwind }
55 !llvm.module.flags = !{!0}
58 !0 = !{i32 1, !"wchar_size", i32 4}
59 !1 = !{!"clang version 5.0.0 (trunk 303574)"}
61 !3 = !{!"int", !4, i64 0}
62 !4 = !{!"omnipotent char", !5, i64 0}
63 !5 = !{!"Simple C/C++ TBAA"}