1 ; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-linux -mcpu=a2 < %s
2 target datalayout = "E-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-f128:128:128-v128:128:128-n32:64"
3 target triple = "powerpc64le-unknown-linux"
5 %"class.std::__1::__assoc_sub_state" = type { %"class.std::__1::__shared_count", %"class.std::__exception_ptr::exception_ptr", %"class.std::__1::mutex", %"class.std::__1::condition_variable", i32 }
6 %"class.std::__1::__shared_count" = type { ptr, i64 }
7 %"class.std::__exception_ptr::exception_ptr" = type { ptr }
8 %"class.std::__1::mutex" = type { %union.pthread_mutex_t }
9 %union.pthread_mutex_t = type { %"struct.<anonymous union>::__pthread_mutex_s" }
10 %"struct.<anonymous union>::__pthread_mutex_s" = type { i32, i32, i32, i32, i32, i32, %struct.__pthread_internal_list }
11 %struct.__pthread_internal_list = type { ptr, ptr }
12 %"class.std::__1::condition_variable" = type { %union.pthread_cond_t }
13 %union.pthread_cond_t = type { %struct.anon }
14 %struct.anon = type { i32, i32, i64, i64, i64, ptr, i32, i32 }
15 %"class.std::__1::unique_lock" = type { ptr, i8 }
17 declare i32 @__gxx_personality_v0(...)
19 ; Function Attrs: optsize
20 define void @_ZNSt3__117__assoc_sub_state4copyEv(ptr %this) #0 align 2 personality ptr @__gxx_personality_v0 {
22 %__lk = alloca %"class.std::__1::unique_lock", align 8
23 %ref.tmp = alloca %"class.std::__exception_ptr::exception_ptr", align 8
24 %tmp = alloca { i64, i64 }, align 8
25 %agg.tmp = alloca %"class.std::__exception_ptr::exception_ptr", align 8
26 %__mut_ = getelementptr inbounds %"class.std::__1::__assoc_sub_state", ptr %this, i64 0, i32 2
27 store ptr %__mut_, ptr %__lk, align 8, !tbaa !5
28 %__owns_.i.i = getelementptr inbounds %"class.std::__1::unique_lock", ptr %__lk, i64 0, i32 1
29 store i8 1, ptr %__owns_.i.i, align 8, !tbaa !6
30 call void @_ZNSt3__15mutex4lockEv(ptr %__mut_) #4
31 invoke void @_ZNSt3__117__assoc_sub_state10__sub_waitERNS_11unique_lockINS_5mutexEEE(ptr %this, ptr %__lk) #4
32 to label %invoke.cont unwind label %lpad
34 invoke.cont: ; preds = %entry
35 %__exception_ = getelementptr inbounds %"class.std::__1::__assoc_sub_state", ptr %this, i64 0, i32 1
36 call void @llvm.memset.p0.i64(ptr align 8 %tmp, i8 0, i64 16, i1 false)
37 call void @_ZNSt15__exception_ptr13exception_ptrC1EMS0_FvvE(ptr %ref.tmp, ptr byval({ i64, i64 }) %tmp) #5
38 %call = call zeroext i1 @_ZNSt15__exception_ptrneERKNS_13exception_ptrES2_(ptr %__exception_, ptr %ref.tmp) #5
39 call void @_ZNSt15__exception_ptr13exception_ptrD1Ev(ptr %ref.tmp) #5
40 br i1 %call, label %if.then, label %if.end
42 if.then: ; preds = %invoke.cont
43 call void @_ZNSt15__exception_ptr13exception_ptrC1ERKS0_(ptr %agg.tmp, ptr %__exception_) #5
44 invoke void @_ZSt17rethrow_exceptionNSt15__exception_ptr13exception_ptrE(ptr %agg.tmp) #6
45 to label %invoke.cont4 unwind label %lpad3
47 invoke.cont4: ; preds = %if.then
50 lpad: ; preds = %entry
51 %0 = landingpad { ptr, i32 }
53 %1 = extractvalue { ptr, i32 } %0, 0
54 %2 = extractvalue { ptr, i32 } %0, 1
57 lpad3: ; preds = %if.then
58 %3 = landingpad { ptr, i32 }
60 %4 = extractvalue { ptr, i32 } %3, 0
61 %5 = extractvalue { ptr, i32 } %3, 1
62 call void @_ZNSt15__exception_ptr13exception_ptrD1Ev(ptr %agg.tmp) #5
65 if.end: ; preds = %invoke.cont
66 %6 = load i8, ptr %__owns_.i.i, align 8, !tbaa !6, !range !4
67 %tobool.i.i = icmp eq i8 %6, 0
68 br i1 %tobool.i.i, label %_ZNSt3__111unique_lockINS_5mutexEED1Ev.exit, label %if.then.i.i
70 if.then.i.i: ; preds = %if.end
71 %7 = load ptr, ptr %__lk, align 8, !tbaa !5
72 call void @_ZNSt3__15mutex6unlockEv(ptr %7) #5
73 br label %_ZNSt3__111unique_lockINS_5mutexEED1Ev.exit
75 _ZNSt3__111unique_lockINS_5mutexEED1Ev.exit: ; preds = %if.then.i.i, %if.end
78 ehcleanup: ; preds = %lpad3, %lpad
79 %exn.slot.0 = phi ptr [ %4, %lpad3 ], [ %1, %lpad ]
80 %ehselector.slot.0 = phi i32 [ %5, %lpad3 ], [ %2, %lpad ]
81 %8 = load i8, ptr %__owns_.i.i, align 8, !tbaa !6, !range !4
82 %tobool.i.i9 = icmp eq i8 %8, 0
83 br i1 %tobool.i.i9, label %_ZNSt3__111unique_lockINS_5mutexEED1Ev.exit12, label %if.then.i.i11
85 if.then.i.i11: ; preds = %ehcleanup
86 %9 = load ptr, ptr %__lk, align 8, !tbaa !5
87 call void @_ZNSt3__15mutex6unlockEv(ptr %9) #5
88 br label %_ZNSt3__111unique_lockINS_5mutexEED1Ev.exit12
90 _ZNSt3__111unique_lockINS_5mutexEED1Ev.exit12: ; preds = %if.then.i.i11, %ehcleanup
91 %lpad.val = insertvalue { ptr, i32 } undef, ptr %exn.slot.0, 0
92 %lpad.val5 = insertvalue { ptr, i32 } %lpad.val, i32 %ehselector.slot.0, 1
93 resume { ptr, i32 } %lpad.val5
96 ; Function Attrs: optsize
97 declare void @_ZNSt3__117__assoc_sub_state10__sub_waitERNS_11unique_lockINS_5mutexEEE(ptr, ptr) #0 align 2
99 ; Function Attrs: nounwind optsize
100 declare zeroext i1 @_ZNSt15__exception_ptrneERKNS_13exception_ptrES2_(ptr, ptr) #1
102 ; Function Attrs: nounwind optsize
103 declare void @_ZNSt15__exception_ptr13exception_ptrC1EMS0_FvvE(ptr, ptr byval({ i64, i64 })) #1
105 ; Function Attrs: nounwind optsize
106 declare void @_ZNSt15__exception_ptr13exception_ptrD1Ev(ptr) #1
108 ; Function Attrs: noreturn optsize
109 declare void @_ZSt17rethrow_exceptionNSt15__exception_ptr13exception_ptrE(ptr) #2
111 ; Function Attrs: nounwind optsize
112 declare void @_ZNSt15__exception_ptr13exception_ptrC1ERKS0_(ptr, ptr) #1
114 ; Function Attrs: nounwind optsize
115 declare void @_ZNSt3__15mutex6unlockEv(ptr) #1
117 ; Function Attrs: optsize
118 declare void @_ZNSt3__15mutex4lockEv(ptr) #0
120 ; Function Attrs: nounwind
121 declare void @llvm.memset.p0.i64(ptr nocapture, i8, i64, i1) #3
123 attributes #0 = { optsize "less-precise-fpmad"="false" "frame-pointer"="all" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
124 attributes #1 = { nounwind optsize "less-precise-fpmad"="false" "frame-pointer"="all" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
125 attributes #2 = { noreturn optsize "less-precise-fpmad"="false" "frame-pointer"="all" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
126 attributes #3 = { nounwind }
127 attributes #4 = { optsize }
128 attributes #5 = { nounwind optsize }
129 attributes #6 = { noreturn optsize }
131 !0 = !{!"any pointer", !1}
132 !1 = !{!"omnipotent char", !2}
133 !2 = !{!"Simple C/C++ TBAA"}
136 !5 = !{!0, !0, i64 0}
137 !6 = !{!3, !3, i64 0}