1; RUN: llc -mtriple=powerpc64-bgq-linux -mcpu=a2 < %s 2target 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" 3target triple = "powerpc64-bgq-linux" 4 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 { i32 (...)**, i64 } 7%"class.std::__exception_ptr::exception_ptr" = type { i8* } 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 { %struct.__pthread_internal_list*, %struct.__pthread_internal_list* } 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, i8*, i32, i32 } 15%"class.std::__1::unique_lock" = type { %"class.std::__1::mutex"*, i8 } 16 17declare i32 @__gxx_personality_v0(...) 18 19; Function Attrs: optsize 20define void @_ZNSt3__117__assoc_sub_state4copyEv(%"class.std::__1::__assoc_sub_state"* %this) #0 align 2 personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) { 21entry: 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", %"class.std::__1::__assoc_sub_state"* %this, i64 0, i32 2 27 %__m_.i.i = getelementptr inbounds %"class.std::__1::unique_lock", %"class.std::__1::unique_lock"* %__lk, i64 0, i32 0 28 store %"class.std::__1::mutex"* %__mut_, %"class.std::__1::mutex"** %__m_.i.i, align 8, !tbaa !5 29 %__owns_.i.i = getelementptr inbounds %"class.std::__1::unique_lock", %"class.std::__1::unique_lock"* %__lk, i64 0, i32 1 30 store i8 1, i8* %__owns_.i.i, align 8, !tbaa !6 31 call void @_ZNSt3__15mutex4lockEv(%"class.std::__1::mutex"* %__mut_) #4 32 invoke void @_ZNSt3__117__assoc_sub_state10__sub_waitERNS_11unique_lockINS_5mutexEEE(%"class.std::__1::__assoc_sub_state"* %this, %"class.std::__1::unique_lock"* %__lk) #4 33 to label %invoke.cont unwind label %lpad 34 35invoke.cont: ; preds = %entry 36 %__exception_ = getelementptr inbounds %"class.std::__1::__assoc_sub_state", %"class.std::__1::__assoc_sub_state"* %this, i64 0, i32 1 37 %0 = bitcast { i64, i64 }* %tmp to i8* 38 call void @llvm.memset.p0i8.i64(i8* %0, i8 0, i64 16, i32 8, i1 false) 39 call void @_ZNSt15__exception_ptr13exception_ptrC1EMS0_FvvE(%"class.std::__exception_ptr::exception_ptr"* %ref.tmp, { i64, i64 }* byval %tmp) #5 40 %call = call zeroext i1 @_ZNSt15__exception_ptrneERKNS_13exception_ptrES2_(%"class.std::__exception_ptr::exception_ptr"* %__exception_, %"class.std::__exception_ptr::exception_ptr"* %ref.tmp) #5 41 call void @_ZNSt15__exception_ptr13exception_ptrD1Ev(%"class.std::__exception_ptr::exception_ptr"* %ref.tmp) #5 42 br i1 %call, label %if.then, label %if.end 43 44if.then: ; preds = %invoke.cont 45 call void @_ZNSt15__exception_ptr13exception_ptrC1ERKS0_(%"class.std::__exception_ptr::exception_ptr"* %agg.tmp, %"class.std::__exception_ptr::exception_ptr"* %__exception_) #5 46 invoke void @_ZSt17rethrow_exceptionNSt15__exception_ptr13exception_ptrE(%"class.std::__exception_ptr::exception_ptr"* %agg.tmp) #6 47 to label %invoke.cont4 unwind label %lpad3 48 49invoke.cont4: ; preds = %if.then 50 unreachable 51 52lpad: ; preds = %entry 53 %1 = landingpad { i8*, i32 } 54 cleanup 55 %2 = extractvalue { i8*, i32 } %1, 0 56 %3 = extractvalue { i8*, i32 } %1, 1 57 br label %ehcleanup 58 59lpad3: ; preds = %if.then 60 %4 = landingpad { i8*, i32 } 61 cleanup 62 %5 = extractvalue { i8*, i32 } %4, 0 63 %6 = extractvalue { i8*, i32 } %4, 1 64 call void @_ZNSt15__exception_ptr13exception_ptrD1Ev(%"class.std::__exception_ptr::exception_ptr"* %agg.tmp) #5 65 br label %ehcleanup 66 67if.end: ; preds = %invoke.cont 68 %7 = load i8, i8* %__owns_.i.i, align 8, !tbaa !6, !range !4 69 %tobool.i.i = icmp eq i8 %7, 0 70 br i1 %tobool.i.i, label %_ZNSt3__111unique_lockINS_5mutexEED1Ev.exit, label %if.then.i.i 71 72if.then.i.i: ; preds = %if.end 73 %8 = load %"class.std::__1::mutex"*, %"class.std::__1::mutex"** %__m_.i.i, align 8, !tbaa !5 74 call void @_ZNSt3__15mutex6unlockEv(%"class.std::__1::mutex"* %8) #5 75 br label %_ZNSt3__111unique_lockINS_5mutexEED1Ev.exit 76 77_ZNSt3__111unique_lockINS_5mutexEED1Ev.exit: ; preds = %if.then.i.i, %if.end 78 ret void 79 80ehcleanup: ; preds = %lpad3, %lpad 81 %exn.slot.0 = phi i8* [ %5, %lpad3 ], [ %2, %lpad ] 82 %ehselector.slot.0 = phi i32 [ %6, %lpad3 ], [ %3, %lpad ] 83 %9 = load i8, i8* %__owns_.i.i, align 8, !tbaa !6, !range !4 84 %tobool.i.i9 = icmp eq i8 %9, 0 85 br i1 %tobool.i.i9, label %_ZNSt3__111unique_lockINS_5mutexEED1Ev.exit12, label %if.then.i.i11 86 87if.then.i.i11: ; preds = %ehcleanup 88 %10 = load %"class.std::__1::mutex"*, %"class.std::__1::mutex"** %__m_.i.i, align 8, !tbaa !5 89 call void @_ZNSt3__15mutex6unlockEv(%"class.std::__1::mutex"* %10) #5 90 br label %_ZNSt3__111unique_lockINS_5mutexEED1Ev.exit12 91 92_ZNSt3__111unique_lockINS_5mutexEED1Ev.exit12: ; preds = %if.then.i.i11, %ehcleanup 93 %lpad.val = insertvalue { i8*, i32 } undef, i8* %exn.slot.0, 0 94 %lpad.val5 = insertvalue { i8*, i32 } %lpad.val, i32 %ehselector.slot.0, 1 95 resume { i8*, i32 } %lpad.val5 96} 97 98; Function Attrs: optsize 99declare void @_ZNSt3__117__assoc_sub_state10__sub_waitERNS_11unique_lockINS_5mutexEEE(%"class.std::__1::__assoc_sub_state"*, %"class.std::__1::unique_lock"*) #0 align 2 100 101; Function Attrs: nounwind optsize 102declare zeroext i1 @_ZNSt15__exception_ptrneERKNS_13exception_ptrES2_(%"class.std::__exception_ptr::exception_ptr"*, %"class.std::__exception_ptr::exception_ptr"*) #1 103 104; Function Attrs: nounwind optsize 105declare void @_ZNSt15__exception_ptr13exception_ptrC1EMS0_FvvE(%"class.std::__exception_ptr::exception_ptr"*, { i64, i64 }* byval) #1 106 107; Function Attrs: nounwind optsize 108declare void @_ZNSt15__exception_ptr13exception_ptrD1Ev(%"class.std::__exception_ptr::exception_ptr"*) #1 109 110; Function Attrs: noreturn optsize 111declare void @_ZSt17rethrow_exceptionNSt15__exception_ptr13exception_ptrE(%"class.std::__exception_ptr::exception_ptr"*) #2 112 113; Function Attrs: nounwind optsize 114declare void @_ZNSt15__exception_ptr13exception_ptrC1ERKS0_(%"class.std::__exception_ptr::exception_ptr"*, %"class.std::__exception_ptr::exception_ptr"*) #1 115 116; Function Attrs: nounwind optsize 117declare void @_ZNSt3__15mutex6unlockEv(%"class.std::__1::mutex"*) #1 118 119; Function Attrs: optsize 120declare void @_ZNSt3__15mutex4lockEv(%"class.std::__1::mutex"*) #0 121 122; Function Attrs: nounwind 123declare void @llvm.memset.p0i8.i64(i8* nocapture, i8, i64, i32, i1) #3 124 125attributes #0 = { optsize "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" } 126attributes #1 = { nounwind optsize "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" } 127attributes #2 = { noreturn optsize "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" } 128attributes #3 = { nounwind } 129attributes #4 = { optsize } 130attributes #5 = { nounwind optsize } 131attributes #6 = { noreturn optsize } 132 133!0 = !{!"any pointer", !1} 134!1 = !{!"omnipotent char", !2} 135!2 = !{!"Simple C/C++ TBAA"} 136!3 = !{!"bool", !1} 137!4 = !{i8 0, i8 2} 138!5 = !{!0, !0, i64 0} 139!6 = !{!3, !3, i64 0} 140