1 ; RUN: opt -S -partial-inliner -max-num-inline-blocks=3 -skip-partial-inlining-cost-analysis < %s | FileCheck %s
2 ; RUN: opt -S -passes=partial-inliner -max-num-inline-blocks=2 -skip-partial-inlining-cost-analysis < %s | FileCheck %s
4 %class.A = type { i32 }
6 @cond = local_unnamed_addr global i32 0, align 4
8 ; Function Attrs: uwtable
9 define void @_Z3foov() local_unnamed_addr {
11 %tmp = alloca %class.A, align 4
12 %tmp1 = bitcast %class.A* %tmp to i8*
13 call void @llvm.lifetime.start.p0i8(i64 4, i8* nonnull %tmp1)
14 %tmp2 = load i32, i32* @cond, align 4, !tbaa !2
15 %tmp3 = icmp eq i32 %tmp2, 0
16 br i1 %tmp3, label %bb4, label %bb9
19 %foo = icmp eq i32 %tmp2, 0
20 br i1 %foo, label %bb5, label %bb9
23 call void @_ZN1A7memfuncEv(%class.A* nonnull %tmp)
24 %tmp5 = getelementptr inbounds %class.A, %class.A* %tmp, i64 0, i32 0
25 %tmp6 = load i32, i32* %tmp5, align 4, !tbaa !6
26 %tmp7 = icmp sgt i32 %tmp6, 0
27 br i1 %tmp7, label %bb9, label %bb8
30 call void @_ZN1A7memfuncEv(%class.A* nonnull %tmp)
33 bb9: ; preds = %bb8, %bb4, %bb
34 call void @llvm.lifetime.end.p0i8(i64 4, i8* nonnull %tmp1)
38 ; Function Attrs: argmemonly nounwind
39 declare void @llvm.lifetime.start.p0i8(i64, i8* nocapture)
41 declare void @_ZN1A7memfuncEv(%class.A*) local_unnamed_addr
43 ; Function Attrs: argmemonly nounwind
44 declare void @llvm.lifetime.end.p0i8(i64, i8* nocapture)
46 ; Function Attrs: uwtable
47 define void @_Z3goov() local_unnamed_addr {
49 tail call void @_Z3foov()
53 ; CHECK-LABEL: define internal void @_Z3foov.1.
55 ; CHECK: call void @llvm.lifetime.end.p0i8(i64 4, i8* nonnull %tmp1)
56 ; CHECK: br label %.exitStub
60 !llvm.module.flags = !{!0}
63 !0 = !{i32 1, !"wchar_size", i32 4}
64 !1 = !{!"clang version 5.0.0 (trunk 304489)"}
66 !3 = !{!"int", !4, i64 0}
67 !4 = !{!"omnipotent char", !5, i64 0}
68 !5 = !{!"Simple C++ TBAA"}
70 !7 = !{!"_ZTS1A", !3, i64 0}