1*9880d681SAndroid Build Coastguard Worker; RUN: llc -relocation-model=pic < %s | grep ":$" | sort | uniq -d | count 0 2*9880d681SAndroid Build Coastguard Workertarget datalayout = "e-p:32:32:32-i1:8:32-i8:8:32-i16:16:32-i32:32:32-i64:32:32-f32:32:32-f64:32:32-v64:64:64-v128:128:128-a0:0:32-n32" 3*9880d681SAndroid Build Coastguard Workertarget triple = "thumbv7-apple-darwin10" 4*9880d681SAndroid Build Coastguard Worker 5*9880d681SAndroid Build Coastguard Worker; This function produces a duplicate LPC label unless special care is taken when duplicating a t2LDRpci_pic instruction. 6*9880d681SAndroid Build Coastguard Worker 7*9880d681SAndroid Build Coastguard Worker%struct.PlatformMutex = type { i32, [40 x i8] } 8*9880d681SAndroid Build Coastguard Worker%struct.SpinLock = type { %struct.PlatformMutex } 9*9880d681SAndroid Build Coastguard Worker%"struct.WTF::TCMalloc_ThreadCache" = type { i32, %struct._opaque_pthread_t*, i8, [68 x %"struct.WTF::TCMalloc_ThreadCache_FreeList"], i32, i32, %"struct.WTF::TCMalloc_ThreadCache"*, %"struct.WTF::TCMalloc_ThreadCache"* } 10*9880d681SAndroid Build Coastguard Worker%"struct.WTF::TCMalloc_ThreadCache_FreeList" = type { i8*, i16, i16 } 11*9880d681SAndroid Build Coastguard Worker%struct.__darwin_pthread_handler_rec = type { void (i8*)*, i8*, %struct.__darwin_pthread_handler_rec* } 12*9880d681SAndroid Build Coastguard Worker%struct._opaque_pthread_t = type { i32, %struct.__darwin_pthread_handler_rec*, [596 x i8] } 13*9880d681SAndroid Build Coastguard Worker 14*9880d681SAndroid Build Coastguard Worker@_ZN3WTFL8heap_keyE = internal global i32 0 ; <i32*> [#uses=1] 15*9880d681SAndroid Build Coastguard Worker@_ZN3WTFL10tsd_initedE.b = internal global i1 false ; <i1*> [#uses=2] 16*9880d681SAndroid Build Coastguard Worker@_ZN3WTFL13pageheap_lockE = internal global %struct.SpinLock { %struct.PlatformMutex { i32 850045863, [40 x i8] zeroinitializer } } ; <%struct.SpinLock*> [#uses=1] 17*9880d681SAndroid Build Coastguard Worker@_ZN3WTFL12thread_heapsE = internal global %"struct.WTF::TCMalloc_ThreadCache"* null ; <%"struct.WTF::TCMalloc_ThreadCache"**> [#uses=1] 18*9880d681SAndroid Build Coastguard Worker@llvm.used = appending global [1 x i8*] [i8* bitcast (%"struct.WTF::TCMalloc_ThreadCache"* ()* @_ZN3WTF20TCMalloc_ThreadCache22CreateCacheIfNecessaryEv to i8*)], section "llvm.metadata" ; <[1 x i8*]*> [#uses=0] 19*9880d681SAndroid Build Coastguard Worker 20*9880d681SAndroid Build Coastguard Workerdefine %"struct.WTF::TCMalloc_ThreadCache"* @_ZN3WTF20TCMalloc_ThreadCache22CreateCacheIfNecessaryEv() nounwind { 21*9880d681SAndroid Build Coastguard Workerentry: 22*9880d681SAndroid Build Coastguard Worker %0 = tail call i32 @pthread_mutex_lock(%struct.PlatformMutex* getelementptr inbounds (%struct.SpinLock, %struct.SpinLock* @_ZN3WTFL13pageheap_lockE, i32 0, i32 0)) nounwind 23*9880d681SAndroid Build Coastguard Worker %.b24 = load i1, i1* @_ZN3WTFL10tsd_initedE.b, align 4 ; <i1> [#uses=1] 24*9880d681SAndroid Build Coastguard Worker br i1 %.b24, label %bb5, label %bb6 25*9880d681SAndroid Build Coastguard Worker 26*9880d681SAndroid Build Coastguard Workerbb5: ; preds = %entry 27*9880d681SAndroid Build Coastguard Worker %1 = tail call %struct._opaque_pthread_t* @pthread_self() nounwind 28*9880d681SAndroid Build Coastguard Worker br label %bb6 29*9880d681SAndroid Build Coastguard Worker 30*9880d681SAndroid Build Coastguard Workerbb6: ; preds = %bb5, %entry 31*9880d681SAndroid Build Coastguard Worker %me.0 = phi %struct._opaque_pthread_t* [ %1, %bb5 ], [ null, %entry ] ; <%struct._opaque_pthread_t*> [#uses=2] 32*9880d681SAndroid Build Coastguard Worker br label %bb11 33*9880d681SAndroid Build Coastguard Worker 34*9880d681SAndroid Build Coastguard Workerbb7: ; preds = %bb11 35*9880d681SAndroid Build Coastguard Worker %2 = getelementptr inbounds %"struct.WTF::TCMalloc_ThreadCache", %"struct.WTF::TCMalloc_ThreadCache"* %h.0, i32 0, i32 1 36*9880d681SAndroid Build Coastguard Worker %3 = load %struct._opaque_pthread_t*, %struct._opaque_pthread_t** %2, align 4 37*9880d681SAndroid Build Coastguard Worker %4 = tail call i32 @pthread_equal(%struct._opaque_pthread_t* %3, %struct._opaque_pthread_t* %me.0) nounwind 38*9880d681SAndroid Build Coastguard Worker %5 = icmp eq i32 %4, 0 39*9880d681SAndroid Build Coastguard Worker br i1 %5, label %bb10, label %bb14 40*9880d681SAndroid Build Coastguard Worker 41*9880d681SAndroid Build Coastguard Workerbb10: ; preds = %bb7 42*9880d681SAndroid Build Coastguard Worker %6 = getelementptr inbounds %"struct.WTF::TCMalloc_ThreadCache", %"struct.WTF::TCMalloc_ThreadCache"* %h.0, i32 0, i32 6 43*9880d681SAndroid Build Coastguard Worker br label %bb11 44*9880d681SAndroid Build Coastguard Worker 45*9880d681SAndroid Build Coastguard Workerbb11: ; preds = %bb10, %bb6 46*9880d681SAndroid Build Coastguard Worker %h.0.in = phi %"struct.WTF::TCMalloc_ThreadCache"** [ @_ZN3WTFL12thread_heapsE, %bb6 ], [ %6, %bb10 ] ; <%"struct.WTF::TCMalloc_ThreadCache"**> [#uses=1] 47*9880d681SAndroid Build Coastguard Worker %h.0 = load %"struct.WTF::TCMalloc_ThreadCache"*, %"struct.WTF::TCMalloc_ThreadCache"** %h.0.in, align 4 ; <%"struct.WTF::TCMalloc_ThreadCache"*> [#uses=4] 48*9880d681SAndroid Build Coastguard Worker %7 = icmp eq %"struct.WTF::TCMalloc_ThreadCache"* %h.0, null 49*9880d681SAndroid Build Coastguard Worker br i1 %7, label %bb13, label %bb7 50*9880d681SAndroid Build Coastguard Worker 51*9880d681SAndroid Build Coastguard Workerbb13: ; preds = %bb11 52*9880d681SAndroid Build Coastguard Worker %8 = tail call %"struct.WTF::TCMalloc_ThreadCache"* @_ZN3WTF20TCMalloc_ThreadCache7NewHeapEP17_opaque_pthread_t(%struct._opaque_pthread_t* %me.0) nounwind 53*9880d681SAndroid Build Coastguard Worker br label %bb14 54*9880d681SAndroid Build Coastguard Worker 55*9880d681SAndroid Build Coastguard Workerbb14: ; preds = %bb13, %bb7 56*9880d681SAndroid Build Coastguard Worker %heap.1 = phi %"struct.WTF::TCMalloc_ThreadCache"* [ %8, %bb13 ], [ %h.0, %bb7 ] ; <%"struct.WTF::TCMalloc_ThreadCache"*> [#uses=4] 57*9880d681SAndroid Build Coastguard Worker %9 = tail call i32 @pthread_mutex_unlock(%struct.PlatformMutex* getelementptr inbounds (%struct.SpinLock, %struct.SpinLock* @_ZN3WTFL13pageheap_lockE, i32 0, i32 0)) nounwind 58*9880d681SAndroid Build Coastguard Worker %10 = getelementptr inbounds %"struct.WTF::TCMalloc_ThreadCache", %"struct.WTF::TCMalloc_ThreadCache"* %heap.1, i32 0, i32 2 59*9880d681SAndroid Build Coastguard Worker %11 = load i8, i8* %10, align 4 60*9880d681SAndroid Build Coastguard Worker %toBool15not = icmp eq i8 %11, 0 ; <i1> [#uses=1] 61*9880d681SAndroid Build Coastguard Worker br i1 %toBool15not, label %bb19, label %bb22 62*9880d681SAndroid Build Coastguard Worker 63*9880d681SAndroid Build Coastguard Workerbb19: ; preds = %bb14 64*9880d681SAndroid Build Coastguard Worker %.b = load i1, i1* @_ZN3WTFL10tsd_initedE.b, align 4 ; <i1> [#uses=1] 65*9880d681SAndroid Build Coastguard Worker br i1 %.b, label %bb21, label %bb22 66*9880d681SAndroid Build Coastguard Worker 67*9880d681SAndroid Build Coastguard Workerbb21: ; preds = %bb19 68*9880d681SAndroid Build Coastguard Worker store i8 1, i8* %10, align 4 69*9880d681SAndroid Build Coastguard Worker %12 = load i32, i32* @_ZN3WTFL8heap_keyE, align 4 70*9880d681SAndroid Build Coastguard Worker %13 = bitcast %"struct.WTF::TCMalloc_ThreadCache"* %heap.1 to i8* 71*9880d681SAndroid Build Coastguard Worker %14 = tail call i32 @pthread_setspecific(i32 %12, i8* %13) nounwind 72*9880d681SAndroid Build Coastguard Worker ret %"struct.WTF::TCMalloc_ThreadCache"* %heap.1 73*9880d681SAndroid Build Coastguard Worker 74*9880d681SAndroid Build Coastguard Workerbb22: ; preds = %bb19, %bb14 75*9880d681SAndroid Build Coastguard Worker ret %"struct.WTF::TCMalloc_ThreadCache"* %heap.1 76*9880d681SAndroid Build Coastguard Worker} 77*9880d681SAndroid Build Coastguard Worker 78*9880d681SAndroid Build Coastguard Workerdeclare i32 @pthread_mutex_lock(%struct.PlatformMutex*) 79*9880d681SAndroid Build Coastguard Worker 80*9880d681SAndroid Build Coastguard Workerdeclare i32 @pthread_mutex_unlock(%struct.PlatformMutex*) 81*9880d681SAndroid Build Coastguard Worker 82*9880d681SAndroid Build Coastguard Workerdeclare hidden %"struct.WTF::TCMalloc_ThreadCache"* @_ZN3WTF20TCMalloc_ThreadCache7NewHeapEP17_opaque_pthread_t(%struct._opaque_pthread_t*) nounwind 83*9880d681SAndroid Build Coastguard Worker 84*9880d681SAndroid Build Coastguard Workerdeclare i32 @pthread_setspecific(i32, i8*) 85*9880d681SAndroid Build Coastguard Worker 86*9880d681SAndroid Build Coastguard Workerdeclare %struct._opaque_pthread_t* @pthread_self() 87*9880d681SAndroid Build Coastguard Worker 88*9880d681SAndroid Build Coastguard Workerdeclare i32 @pthread_equal(%struct._opaque_pthread_t*, %struct._opaque_pthread_t*) 89*9880d681SAndroid Build Coastguard Worker 90