2 ; RUN: opt < %s -passes=partial-inliner -skip-partial-inlining-cost-analysis -S | FileCheck %s
3 ; RUN: opt < %s -passes=partial-inliner -skip-partial-inlining-cost-analysis -S | FileCheck %s
5 %"class.base" = type { ptr }
6 %"struct.base" = type opaque
8 @g = external local_unnamed_addr global i32, align 4
10 ; Function Attrs: nounwind uwtable
11 define i32 @callee_sinkable_bitcast(i32 %arg) local_unnamed_addr #0 {
12 ; CHECK-LABEL:define{{.*}}@callee_sinkable_bitcast.{{[0-9]}}
14 ; CHECK: call void @llvm.lifetime
16 %tmp = alloca %"class.base", align 4
17 %tmp2 = load i32, ptr @g, align 4, !tbaa !2
18 %tmp3 = add nsw i32 %tmp2, 1
19 %tmp4 = icmp slt i32 %arg, 0
20 br i1 %tmp4, label %bb6, label %bb5
23 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %tmp) #2
24 store i32 %tmp3, ptr %tmp, align 4, !tbaa !2
25 store i32 %tmp3, ptr @g, align 4, !tbaa !2
26 call void @bar(ptr nonnull %tmp) #2
27 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %tmp) #2
30 bb6: ; preds = %bb5, %bb
31 %tmp7 = phi i32 [ 1, %bb5 ], [ 0, %bb ]
35 declare void @llvm.lifetime.start.p0(i64, ptr nocapture) #1
37 declare void @bar(ptr) local_unnamed_addr #2
38 declare void @bar2(ptr, ptr) local_unnamed_addr #1
41 ; Function Attrs: argmemonly nounwind
42 declare void @llvm.lifetime.end.p0(i64, ptr nocapture) #1
44 ; Function Attrs: nounwind uwtable
45 define i32 @caller(i32 %arg) local_unnamed_addr #0 {
47 %tmp = tail call i32 @callee_sinkable_bitcast(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"}