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 3 4%"class.base" = type { %"struct.base"* } 5%"struct.base" = type opaque 6 7@g = external local_unnamed_addr global i32, align 4 8 9define i32 @callee_unknown_use2(i32 %arg) local_unnamed_addr #0 { 10; CHECK-LABEL:define{{.*}}@callee_unknown_use2.{{[0-9]}} 11; CHECK-NOT: alloca 12; CHECK: call void @llvm.lifetime 13bb: 14 %tmp = alloca i32, align 4 15 %tmp1 = bitcast i32* %tmp to i8* 16 %tmp2 = load i32, i32* @g, align 4, !tbaa !2 17 %tmp3 = add nsw i32 %tmp2, 1 18 %tmp4 = icmp slt i32 %arg, 0 19 br i1 %tmp4, label %bb6, label %bb5 20 21bb5: ; preds = %bb 22 call void @llvm.lifetime.start.p0i8(i64 4, i8* nonnull %tmp1) #2 23 store i32 %tmp3, i32* %tmp, align 4, !tbaa !2 24 store i32 %tmp3, i32* @g, align 4, !tbaa !2 25 call void @bar(i32* nonnull %tmp) #2 26 call void @llvm.lifetime.end.p0i8(i64 4, i8* nonnull %tmp1) #2 27 br label %bb6 28 29bb6: ; preds = %bb5, %bb 30 %tmp7 = phi i32 [ 1, %bb5 ], [ 0, %bb ] 31 %tmp10 = bitcast i8* %tmp1 to i32* 32 ret i32 %tmp7 33} 34 35; Function Attrs: argmemonly nounwind 36declare void @llvm.lifetime.start.p0i8(i64, i8* nocapture) #1 37 38declare void @bar(i32*) local_unnamed_addr #2 39declare void @bar2(i32*, i32*) local_unnamed_addr #1 40 41 42; Function Attrs: argmemonly nounwind 43declare void @llvm.lifetime.end.p0i8(i64, i8* nocapture) #1 44 45; Function Attrs: nounwind uwtable 46define i32 @caller(i32 %arg) local_unnamed_addr #0 { 47bb: 48 %tmp = tail call i32 @callee_unknown_use2(i32 %arg) 49 ret i32 %tmp 50} 51 52attributes #0 = { nounwind uwtable} 53attributes #1 = { argmemonly nounwind } 54attributes #2 = { nounwind } 55 56!llvm.module.flags = !{!0} 57!llvm.ident = !{!1} 58 59!0 = !{i32 1, !"wchar_size", i32 4} 60!1 = !{!"clang version 5.0.0 (trunk 303574)"} 61!2 = !{!3, !3, i64 0} 62!3 = !{!"int", !4, i64 0} 63!4 = !{!"omnipotent char", !5, i64 0} 64!5 = !{!"Simple C/C++ TBAA"} 65 66 67 68