blob: a63271515ca1a31d55f526b2d83d94204ec1c3be [file] [log] [blame]
Jakob Stoklund Olesen30ac0462010-01-06 23:47:07 +00001; RUN: llc -relocation-model=pic -pre-regalloc-taildup < %s | grep {:$} | sort | uniq -d | count 0
2target 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"
3target triple = "thumbv7-apple-darwin10"
4
5%struct.PlatformMutex = type { i32, [40 x i8] }
6%struct.SpinLock = type { %struct.PlatformMutex }
7%"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"* }
8%"struct.WTF::TCMalloc_ThreadCache_FreeList" = type { i8*, i16, i16 }
9%struct.__darwin_pthread_handler_rec = type { void (i8*)*, i8*, %struct.__darwin_pthread_handler_rec* }
10%struct._opaque_pthread_t = type { i32, %struct.__darwin_pthread_handler_rec*, [596 x i8] }
11
12@_ZN3WTFL8heap_keyE = internal global i32 0 ; <i32*> [#uses=1]
13@_ZN3WTFL10tsd_initedE.b = internal global i1 false ; <i1*> [#uses=2]
14@_ZN3WTFL13pageheap_lockE = internal global %struct.SpinLock { %struct.PlatformMutex { i32 850045863, [40 x i8] zeroinitializer } } ; <%struct.SpinLock*> [#uses=1]
15@_ZN3WTFL12thread_heapsE = internal global %"struct.WTF::TCMalloc_ThreadCache"* null ; <%"struct.WTF::TCMalloc_ThreadCache"**> [#uses=1]
16@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]
17
18define arm_apcscc %"struct.WTF::TCMalloc_ThreadCache"* @_ZN3WTF20TCMalloc_ThreadCache22CreateCacheIfNecessaryEv() nounwind {
19entry:
20 %0 = tail call arm_apcscc i32 @pthread_mutex_lock(%struct.PlatformMutex* getelementptr inbounds (%struct.SpinLock* @_ZN3WTFL13pageheap_lockE, i32 0, i32 0)) nounwind
21 %.b24 = load i1* @_ZN3WTFL10tsd_initedE.b, align 4 ; <i1> [#uses=1]
22 br i1 %.b24, label %bb5, label %bb6
23
24bb5: ; preds = %entry
25 %1 = tail call arm_apcscc %struct._opaque_pthread_t* @pthread_self() nounwind
26 br label %bb6
27
28bb6: ; preds = %bb5, %entry
29 %me.0 = phi %struct._opaque_pthread_t* [ %1, %bb5 ], [ null, %entry ] ; <%struct._opaque_pthread_t*> [#uses=2]
30 br label %bb11
31
32bb7: ; preds = %bb11
33 %2 = getelementptr inbounds %"struct.WTF::TCMalloc_ThreadCache"* %h.0, i32 0, i32 1
34 %3 = load %struct._opaque_pthread_t** %2, align 4
35 %4 = tail call arm_apcscc i32 @pthread_equal(%struct._opaque_pthread_t* %3, %struct._opaque_pthread_t* %me.0) nounwind
36 %5 = icmp eq i32 %4, 0
37 br i1 %5, label %bb10, label %bb14
38
39bb10: ; preds = %bb7
40 %6 = getelementptr inbounds %"struct.WTF::TCMalloc_ThreadCache"* %h.0, i32 0, i32 6
41 br label %bb11
42
43bb11: ; preds = %bb10, %bb6
44 %h.0.in = phi %"struct.WTF::TCMalloc_ThreadCache"** [ @_ZN3WTFL12thread_heapsE, %bb6 ], [ %6, %bb10 ] ; <%"struct.WTF::TCMalloc_ThreadCache"**> [#uses=1]
45 %h.0 = load %"struct.WTF::TCMalloc_ThreadCache"** %h.0.in, align 4 ; <%"struct.WTF::TCMalloc_ThreadCache"*> [#uses=4]
46 %7 = icmp eq %"struct.WTF::TCMalloc_ThreadCache"* %h.0, null
47 br i1 %7, label %bb13, label %bb7
48
49bb13: ; preds = %bb11
50 %8 = tail call arm_apcscc %"struct.WTF::TCMalloc_ThreadCache"* @_ZN3WTF20TCMalloc_ThreadCache7NewHeapEP17_opaque_pthread_t(%struct._opaque_pthread_t* %me.0) nounwind
51 br label %bb14
52
53bb14: ; preds = %bb13, %bb7
54 %heap.1 = phi %"struct.WTF::TCMalloc_ThreadCache"* [ %8, %bb13 ], [ %h.0, %bb7 ] ; <%"struct.WTF::TCMalloc_ThreadCache"*> [#uses=4]
55 %9 = tail call arm_apcscc i32 @pthread_mutex_unlock(%struct.PlatformMutex* getelementptr inbounds (%struct.SpinLock* @_ZN3WTFL13pageheap_lockE, i32 0, i32 0)) nounwind
56 %10 = getelementptr inbounds %"struct.WTF::TCMalloc_ThreadCache"* %heap.1, i32 0, i32 2
57 %11 = load i8* %10, align 4
58 %toBool15not = icmp eq i8 %11, 0 ; <i1> [#uses=1]
59 br i1 %toBool15not, label %bb19, label %bb22
60
61bb19: ; preds = %bb14
62 %.b = load i1* @_ZN3WTFL10tsd_initedE.b, align 4 ; <i1> [#uses=1]
63 br i1 %.b, label %bb21, label %bb22
64
65bb21: ; preds = %bb19
66 store i8 1, i8* %10, align 4
67 %12 = load i32* @_ZN3WTFL8heap_keyE, align 4
68 %13 = bitcast %"struct.WTF::TCMalloc_ThreadCache"* %heap.1 to i8*
69 %14 = tail call arm_apcscc i32 @pthread_setspecific(i32 %12, i8* %13) nounwind
70 ret %"struct.WTF::TCMalloc_ThreadCache"* %heap.1
71
72bb22: ; preds = %bb19, %bb14
73 ret %"struct.WTF::TCMalloc_ThreadCache"* %heap.1
74}
75
76declare arm_apcscc i32 @pthread_mutex_lock(%struct.PlatformMutex*)
77
78declare arm_apcscc i32 @pthread_mutex_unlock(%struct.PlatformMutex*)
79
80declare hidden arm_apcscc %"struct.WTF::TCMalloc_ThreadCache"* @_ZN3WTF20TCMalloc_ThreadCache7NewHeapEP17_opaque_pthread_t(%struct._opaque_pthread_t*) nounwind
81
82declare arm_apcscc i32 @pthread_setspecific(i32, i8*)
83
84declare arm_apcscc %struct._opaque_pthread_t* @pthread_self()
85
86declare arm_apcscc i32 @pthread_equal(%struct._opaque_pthread_t*, %struct._opaque_pthread_t*)
87