10ca8ddd8SRoman Lebedev; RUN: opt -S -passes=partial-inliner -skip-partial-inlining-cost-analysis < %s | FileCheck %s 2cee313d2SEric Christopher; RUN: opt -S -passes=partial-inliner -skip-partial-inlining-cost-analysis < %s | FileCheck %s 3cee313d2SEric Christopher 4cee313d2SEric Christopher%class.A = type { i32 } 5cee313d2SEric Christopher@cond = local_unnamed_addr global i32 0, align 4 6cee313d2SEric Christopher 7cee313d2SEric Christopher; Function Attrs: uwtable 8cee313d2SEric Christopherdefine void @_Z3foov() local_unnamed_addr { 9cee313d2SEric Christopherbb: 10cee313d2SEric Christopher %tmp = alloca %class.A, align 4 11*bbbbbfbdSNikita Popov call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %tmp) 12*bbbbbfbdSNikita Popov %tmp2 = load i32, ptr @cond, align 4, !tbaa !2 13cee313d2SEric Christopher %tmp3 = icmp eq i32 %tmp2, 0 14cee313d2SEric Christopher br i1 %tmp3, label %bb4, label %bb5 15cee313d2SEric Christopher 16cee313d2SEric Christopherbb4: ; preds = %bb 17*bbbbbfbdSNikita Popov call void @_ZN1A7memfuncEv(ptr nonnull %tmp) 18cee313d2SEric Christopher br label %bb5 19cee313d2SEric Christopher 20cee313d2SEric Christopherbb5: ; preds = %bb4, %bb 21*bbbbbfbdSNikita Popov call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %tmp) 22cee313d2SEric Christopher ret void 23cee313d2SEric Christopher} 24cee313d2SEric Christopher 25cee313d2SEric Christopher; Function Attrs: argmemonly nounwind 26*bbbbbfbdSNikita Popovdeclare void @llvm.lifetime.start.p0(i64, ptr nocapture) 27cee313d2SEric Christopher 28*bbbbbfbdSNikita Popovdeclare void @_ZN1A7memfuncEv(ptr) local_unnamed_addr 29cee313d2SEric Christopher 30cee313d2SEric Christopher; Function Attrs: argmemonly nounwind 31*bbbbbfbdSNikita Popovdeclare void @llvm.lifetime.end.p0(i64, ptr nocapture) 32cee313d2SEric Christopher 33cee313d2SEric Christopher; Function Attrs: uwtable 34cee313d2SEric Christopherdefine void @_Z3goov() local_unnamed_addr { 35cee313d2SEric Christopher; CHECK-LABEL: @_Z3goov() 36cee313d2SEric Christopherbb: 37cee313d2SEric Christopher; CHECK: bb: 38cee313d2SEric Christopher; CHECK-NOT: alloca 39cee313d2SEric Christopher; CHECK-NOT: bitcast 40cee313d2SEric Christopher; CHECK-NOT: llvm.lifetime 41cee313d2SEric Christopher; CHECK: br i1 42cee313d2SEric Christopher; CHECK: codeRepl.i: 43cee313d2SEric Christopher; CHECK: call void @_Z3foov.1. 44cee313d2SEric Christopher 45cee313d2SEric Christopher tail call void @_Z3foov() 46cee313d2SEric Christopher ret void 47cee313d2SEric Christopher} 48cee313d2SEric Christopher 49cee313d2SEric Christopher; CHECK-LABEL: define internal void @_Z3foov.1. 50cee313d2SEric Christopher; CHECK: newFuncRoot: 51cee313d2SEric Christopher; CHECK-NEXT: %tmp = alloca %class.A 52*bbbbbfbdSNikita Popov; CHECK-NEXT: call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %tmp) 53*bbbbbfbdSNikita Popov; CHECK: call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %tmp) 54cee313d2SEric Christopher; CHECK-NEXT: br label %bb5.exitStub 55cee313d2SEric Christopher 56cee313d2SEric Christopher 57cee313d2SEric Christopher!llvm.module.flags = !{!0} 58cee313d2SEric Christopher!llvm.ident = !{!1} 59cee313d2SEric Christopher 60cee313d2SEric Christopher!0 = !{i32 1, !"wchar_size", i32 4} 61cee313d2SEric Christopher!1 = !{!"clang version 5.0.0 (trunk 304489)"} 62cee313d2SEric Christopher!2 = !{!3, !3, i64 0} 63cee313d2SEric Christopher!3 = !{!"int", !4, i64 0} 64cee313d2SEric Christopher!4 = !{!"omnipotent char", !5, i64 0} 65cee313d2SEric Christopher!5 = !{!"Simple C++ TBAA"} 66