1 ; The expected behavior of this file is expected to change when partial
2 ; inlining legality check is enhanced.
4 ; RUN: opt -S -passes=partial-inliner -skip-partial-inlining-cost-analysis < %s | FileCheck %s
5 ; RUN: opt -S -passes=partial-inliner -skip-partial-inlining-cost-analysis < %s | FileCheck %s
7 %class.A = type { i32 }
9 @cond = local_unnamed_addr global i32 0, align 4
10 @condptr = external local_unnamed_addr global ptr, align 8
12 ; Function Attrs: uwtable
13 define void @_Z3foo_unknown_mem_accessv() local_unnamed_addr {
15 %tmp = alloca %class.A, align 4
16 %tmp1 = alloca %class.A, align 4
17 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %tmp)
18 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %tmp1)
19 %tmp4 = load ptr, ptr @condptr, align 8, !tbaa !2
20 %tmp5 = load i32, ptr %tmp4, align 4, !tbaa !6
21 %tmp6 = icmp eq i32 %tmp5, 0
22 br i1 %tmp6, label %bb7, label %bb8
25 call void @_ZN1A7memfuncEv(ptr nonnull %tmp)
28 bb8: ; preds = %bb7, %bb
29 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %tmp1)
30 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %tmp)
34 declare void @_Z3barv() local_unnamed_addr
35 declare void @llvm.lifetime.start.p0(i64, ptr nocapture)
36 declare void @_ZN1A7memfuncEv(ptr) local_unnamed_addr
37 declare void @llvm.lifetime.end.p0(i64, ptr nocapture)
39 define void @_Z3foo_unknown_calli(i32 %arg) local_unnamed_addr {
41 %tmp = alloca %class.A, align 4
42 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %tmp)
43 tail call void @_Z3barv()
44 %tmp2 = icmp eq i32 %arg, 0
45 br i1 %tmp2, label %bb3, label %bb4
48 call void @_ZN1A7memfuncEv(ptr nonnull %tmp)
51 bb4: ; preds = %bb3, %bb
52 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %tmp)
56 define void @_Z3goov() local_unnamed_addr {
57 ; CHECK-LABEL: @_Z3goov
62 call void @_Z3foo_unknown_mem_accessv()
63 %tmp = load i32, ptr @cond, align 4, !tbaa !2
64 tail call void @_Z3foo_unknown_calli(i32 %tmp)
68 ; CHECK-LABEL: define internal void @_Z3foo_unknown_calli.1.bb3
70 ; CHECK-NEXT: br label %bb3
73 ; CHECK-NOT: lifetime.ed
74 ; CHECK: br label %bb4.exitStub
76 ; CHECK: bb4.exitStub:
77 ; CHECK-NEXT: ret void
81 !llvm.module.flags = !{!0}
84 !0 = !{i32 1, !"wchar_size", i32 4}
85 !1 = !{!"clang version 5.0.0 (trunk 304489)"}
87 !3 = !{!"any pointer", !4, i64 0}
88 !4 = !{!"omnipotent char", !5, i64 0}
89 !5 = !{!"Simple C++ TBAA"}
91 !7 = !{!"int", !4, i64 0}