1 ; RUN: llc -verify-machineinstrs < %s -mtriple=ppc32-- | grep "__trampoline_setup"
3 module asm "\09.lazy_reference .objc_class_name_NSImageRep"
4 module asm "\09.objc_class_name_NSBitmapImageRep=0"
5 module asm "\09.globl .objc_class_name_NSBitmapImageRep"
6 %struct.CGImage = type opaque
7 %"struct.FRAME.-[NSBitmapImageRep copyWithZone:]" = type { ptr, ptr }
8 %struct.NSBitmapImageRep = type { %struct.NSImageRep }
9 %struct.NSImageRep = type { }
10 %struct.NSZone = type opaque
11 %struct.__block_1 = type { %struct.__invoke_impl, ptr, ptr }
12 %struct.__builtin_trampoline = type { [40 x i8] }
13 %struct.__invoke_impl = type { ptr, i32, i32, ptr }
14 %struct._objc__method_prototype_list = type opaque
15 %struct._objc_class = type { ptr, ptr, ptr, i32, i32, i32, ptr, ptr, ptr, ptr, ptr, ptr }
16 %struct._objc_class_ext = type opaque
17 %struct._objc_ivar_list = type opaque
18 %struct._objc_method = type { ptr, ptr, ptr }
19 %struct._objc_method_list = type opaque
20 %struct._objc_module = type { i32, i32, ptr, ptr }
21 %struct._objc_protocol = type { ptr, ptr, ptr, ptr, ptr }
22 %struct._objc_protocol_extension = type opaque
23 %struct._objc_super = type { ptr, ptr }
24 %struct._objc_symtab = type { i32, ptr, i16, i16, [1 x ptr] }
25 %struct.anon = type { ptr, i32, [1 x %struct._objc_method] }
26 %struct.objc_cache = type opaque
27 %struct.objc_object = type opaque
28 %struct.objc_selector = type opaque
29 %struct.objc_super = type opaque
30 @_NSConcreteStackBlock = external global ptr ; <ptr> [#uses=1]
31 @"\01L_OBJC_SELECTOR_REFERENCES_1" = internal global ptr @"\01L_OBJC_METH_VAR_NAME_1", section "__OBJC,__message_refs,literal_pointers,no_dead_strip" ; <ptr> [#uses=2]
32 @"\01L_OBJC_CLASS_NSBitmapImageRep" = internal global %struct._objc_class { ptr @"\01L_OBJC_METACLASS_NSBitmapImageRep", ptr @"\01L_OBJC_CLASS_NAME_1", ptr @"\01L_OBJC_CLASS_NAME_0", i32 0, i32 1, i32 0, ptr null, ptr @"\01L_OBJC_INSTANCE_METHODS_NSBitmapImageRep", ptr null, ptr null, ptr null, ptr null }, section "__OBJC,__class,regular,no_dead_strip" ; <ptr> [#uses=3]
33 @"\01L_OBJC_SELECTOR_REFERENCES_0" = internal global ptr @"\01L_OBJC_METH_VAR_NAME_0", section "__OBJC,__message_refs,literal_pointers,no_dead_strip" ; <ptr> [#uses=2]
34 @"\01L_OBJC_SYMBOLS" = internal global { i32, ptr, i16, i16, [1 x ptr] } { i32 0, ptr null, i16 1, i16 0, [1 x ptr] [ ptr @"\01L_OBJC_CLASS_NSBitmapImageRep" ] }, section "__OBJC,__symbols,regular,no_dead_strip" ; <ptr> [#uses=2]
35 @"\01L_OBJC_METH_VAR_NAME_0" = internal global [14 x i8] c"copyWithZone:\00", section "__TEXT,__cstring,cstring_literals", align 4 ; <ptr> [#uses=2]
36 @"\01L_OBJC_METH_VAR_TYPE_0" = internal global [20 x i8] c"@12@0:4^{_NSZone=}8\00", section "__TEXT,__cstring,cstring_literals", align 4 ; <ptr> [#uses=1]
37 @"\01L_OBJC_INSTANCE_METHODS_NSBitmapImageRep" = internal global { ptr, i32, [1 x %struct._objc_method] } { ptr null, i32 1, [1 x %struct._objc_method] [ %struct._objc_method { ptr @"\01L_OBJC_METH_VAR_NAME_0", ptr @"\01L_OBJC_METH_VAR_TYPE_0", ptr @"-[NSBitmapImageRep copyWithZone:]" } ] }, section "__OBJC,__inst_meth,regular,no_dead_strip" ; <ptr> [#uses=2]
38 @"\01L_OBJC_CLASS_NAME_0" = internal global [17 x i8] c"NSBitmapImageRep\00", section "__TEXT,__cstring,cstring_literals", align 4 ; <ptr> [#uses=1]
39 @"\01L_OBJC_CLASS_NAME_1" = internal global [11 x i8] c"NSImageRep\00", section "__TEXT,__cstring,cstring_literals", align 4 ; <ptr> [#uses=2]
40 @"\01L_OBJC_METACLASS_NSBitmapImageRep" = internal global %struct._objc_class { ptr @"\01L_OBJC_CLASS_NAME_1", ptr @"\01L_OBJC_CLASS_NAME_1", ptr @"\01L_OBJC_CLASS_NAME_0", i32 0, i32 2, i32 48, ptr null, ptr null, ptr null, ptr null, ptr null, ptr null }, section "__OBJC,__meta_class,regular,no_dead_strip" ; <ptr> [#uses=2]
41 @"\01L_OBJC_METH_VAR_NAME_1" = internal global [34 x i8] c"_performBlockUsingBackingCGImage:\00", section "__TEXT,__cstring,cstring_literals", align 4 ; <ptr> [#uses=2]
42 @"\01L_OBJC_IMAGE_INFO" = internal constant [2 x i32] zeroinitializer, section "__OBJC, __image_info,regular" ; <ptr> [#uses=1]
43 @"\01L_OBJC_CLASS_NAME_2" = internal global [1 x i8] zeroinitializer, section "__TEXT,__cstring,cstring_literals", align 4 ; <ptr> [#uses=1]
44 @"\01L_OBJC_MODULES" = internal global %struct._objc_module { i32 7, i32 16, ptr @"\01L_OBJC_CLASS_NAME_2", ptr @"\01L_OBJC_SYMBOLS" }, section "__OBJC,__module_info,regular,no_dead_strip" ; <ptr> [#uses=1]
45 @llvm.used = appending global [14 x ptr] [ ptr @"\01L_OBJC_SELECTOR_REFERENCES_1", ptr @"\01L_OBJC_CLASS_NSBitmapImageRep", ptr @"\01L_OBJC_SELECTOR_REFERENCES_0", ptr @"\01L_OBJC_SYMBOLS", ptr @"\01L_OBJC_METH_VAR_NAME_0", ptr @"\01L_OBJC_METH_VAR_TYPE_0", ptr @"\01L_OBJC_INSTANCE_METHODS_NSBitmapImageRep", ptr @"\01L_OBJC_CLASS_NAME_0", ptr @"\01L_OBJC_CLASS_NAME_1", ptr @"\01L_OBJC_METACLASS_NSBitmapImageRep", ptr @"\01L_OBJC_METH_VAR_NAME_1", ptr @"\01L_OBJC_IMAGE_INFO", ptr @"\01L_OBJC_CLASS_NAME_2", ptr @"\01L_OBJC_MODULES" ], section "llvm.metadata" ; <ptr> [#uses=0]
47 define internal ptr @"-[NSBitmapImageRep copyWithZone:]"(ptr %self, ptr %_cmd, ptr %zone) nounwind {
49 %self_addr = alloca ptr ; <ptr> [#uses=2]
50 %_cmd_addr = alloca ptr ; <ptr> [#uses=1]
51 %zone_addr = alloca ptr ; <ptr> [#uses=2]
52 %retval = alloca ptr ; <ptr> [#uses=1]
53 %__block_holder_tmp_1.0 = alloca %struct.__block_1 ; <ptr> [#uses=7]
54 %new = alloca ptr ; <ptr> [#uses=2]
55 %self.1 = alloca ptr ; <ptr> [#uses=2]
56 %0 = alloca ptr ; <ptr> [#uses=2]
57 %TRAMP.9 = alloca %struct.__builtin_trampoline, align 4 ; <ptr> [#uses=1]
58 %1 = alloca ptr ; <ptr> [#uses=2]
59 %2 = alloca ptr ; <ptr> [#uses=2]
60 %FRAME.7 = alloca %"struct.FRAME.-[NSBitmapImageRep copyWithZone:]" ; <ptr> [#uses=5]
61 %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
62 store ptr %self, ptr %self_addr
63 store ptr %_cmd, ptr %_cmd_addr
64 store ptr %zone, ptr %zone_addr
65 %3 = getelementptr %"struct.FRAME.-[NSBitmapImageRep copyWithZone:]", ptr %FRAME.7, i32 0, i32 0 ; <ptr> [#uses=1]
66 %4 = load ptr, ptr %self_addr, align 4 ; <ptr> [#uses=1]
67 store ptr %4, ptr %3, align 4
68 call void @llvm.init.trampoline(ptr %TRAMP.9, ptr @__helper_1.1632, ptr %FRAME.7) ; <ptr> [#uses=1]
69 %tramp = call ptr @llvm.adjust.trampoline(ptr %TRAMP.9)
70 store ptr %tramp, ptr %0, align 4
71 %5 = getelementptr %"struct.FRAME.-[NSBitmapImageRep copyWithZone:]", ptr %FRAME.7, i32 0, i32 1 ; <ptr> [#uses=1]
72 %6 = load ptr, ptr %0, align 4 ; <ptr> [#uses=1]
73 store ptr %6, ptr %5, align 4
74 store ptr null, ptr %new, align 4
75 %7 = getelementptr %struct.__block_1, ptr %__block_holder_tmp_1.0, i32 0, i32 0 ; <ptr> [#uses=1]
76 %8 = getelementptr %struct.__invoke_impl, ptr %7, i32 0, i32 0 ; <ptr> [#uses=1]
77 store ptr @_NSConcreteStackBlock, ptr %8, align 4
78 %9 = getelementptr %struct.__block_1, ptr %__block_holder_tmp_1.0, i32 0, i32 0 ; <ptr> [#uses=1]
79 %10 = getelementptr %struct.__invoke_impl, ptr %9, i32 0, i32 1 ; <ptr> [#uses=1]
80 store i32 67108864, ptr %10, align 4
81 %11 = getelementptr %struct.__block_1, ptr %__block_holder_tmp_1.0, i32 0, i32 0 ; <ptr> [#uses=1]
82 %12 = getelementptr %struct.__invoke_impl, ptr %11, i32 0, i32 2 ; <ptr> [#uses=1]
83 store i32 24, ptr %12, align 4
84 %13 = getelementptr %"struct.FRAME.-[NSBitmapImageRep copyWithZone:]", ptr %FRAME.7, i32 0, i32 1 ; <ptr> [#uses=1]
85 %14 = load ptr, ptr %13, align 4 ; <ptr> [#uses=1]
86 store ptr %14, ptr %1, align 4
87 %15 = getelementptr %struct.__block_1, ptr %__block_holder_tmp_1.0, i32 0, i32 0 ; <ptr> [#uses=1]
88 %16 = getelementptr %struct.__invoke_impl, ptr %15, i32 0, i32 3 ; <ptr> [#uses=1]
89 %17 = load ptr, ptr %1, align 4 ; <ptr> [#uses=1]
90 store ptr %17, ptr %16, align 4
91 %18 = getelementptr %struct.__block_1, ptr %__block_holder_tmp_1.0, i32 0, i32 1 ; <ptr> [#uses=1]
92 %19 = load ptr, ptr %zone_addr, align 4 ; <ptr> [#uses=1]
93 store ptr %19, ptr %18, align 4
94 %20 = getelementptr %struct.__block_1, ptr %__block_holder_tmp_1.0, i32 0, i32 2 ; <ptr> [#uses=1]
95 store ptr %new, ptr %20, align 4
96 %21 = getelementptr %"struct.FRAME.-[NSBitmapImageRep copyWithZone:]", ptr %FRAME.7, i32 0, i32 0 ; <ptr> [#uses=1]
97 %22 = load ptr, ptr %21, align 4 ; <ptr> [#uses=1]
98 store ptr %22, ptr %2, align 4
99 %23 = load ptr, ptr %2, align 4 ; <ptr> [#uses=1]
100 store ptr %23, ptr %self.1, align 4
101 %24 = load ptr, ptr @"\01L_OBJC_SELECTOR_REFERENCES_1", align 4 ; <ptr> [#uses=1]
102 %25 = load ptr, ptr %self.1, align 4 ; <ptr> [#uses=1]
103 %26 = call ptr (ptr, ptr, ...) inttoptr (i64 4294901504 to ptr)(ptr %25, ptr %24, ptr %__block_holder_tmp_1.0) nounwind ; <ptr> [#uses=0]
106 return: ; preds = %entry
107 %retval5 = load ptr, ptr %retval ; <ptr> [#uses=1]
111 declare void @llvm.init.trampoline(ptr, ptr, ptr) nounwind
112 declare ptr @llvm.adjust.trampoline(ptr) nounwind
114 define internal void @__helper_1.1632(ptr nest %CHAIN.8, ptr %_self, ptr %cgImage) nounwind {
116 %CHAIN.8_addr = alloca ptr ; <ptr> [#uses=2]
117 %_self_addr = alloca ptr ; <ptr> [#uses=3]
118 %cgImage_addr = alloca ptr ; <ptr> [#uses=1]
119 %zone = alloca ptr ; <ptr> [#uses=2]
120 %objc_super = alloca %struct._objc_super ; <ptr> [#uses=3]
121 %new = alloca ptr ; <ptr> [#uses=2]
122 %objc_super.5 = alloca ptr ; <ptr> [#uses=2]
123 %0 = alloca ptr ; <ptr> [#uses=2]
124 %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
125 store ptr %CHAIN.8, ptr %CHAIN.8_addr
126 store ptr %_self, ptr %_self_addr
127 store ptr %cgImage, ptr %cgImage_addr
128 %1 = load ptr, ptr %_self_addr, align 4 ; <ptr> [#uses=1]
129 %2 = getelementptr %struct.__block_1, ptr %1, i32 0, i32 2 ; <ptr> [#uses=1]
130 %3 = load ptr, ptr %2, align 4 ; <ptr> [#uses=1]
131 store ptr %3, ptr %new, align 4
132 %4 = load ptr, ptr %_self_addr, align 4 ; <ptr> [#uses=1]
133 %5 = getelementptr %struct.__block_1, ptr %4, i32 0, i32 1 ; <ptr> [#uses=1]
134 %6 = load ptr, ptr %5, align 4 ; <ptr> [#uses=1]
135 store ptr %6, ptr %zone, align 4
136 %7 = load ptr, ptr %CHAIN.8_addr, align 4 ; <ptr> [#uses=1]
137 %8 = getelementptr %"struct.FRAME.-[NSBitmapImageRep copyWithZone:]", ptr %7, i32 0, i32 0 ; <ptr> [#uses=1]
138 %9 = load ptr, ptr %8, align 4 ; <ptr> [#uses=1]
139 store ptr %9, ptr %0, align 4
140 %10 = load ptr, ptr %0, align 4 ; <ptr> [#uses=1]
141 %11 = getelementptr %struct._objc_super, ptr %objc_super, i32 0, i32 0 ; <ptr> [#uses=1]
142 store ptr %10, ptr %11, align 4
143 %12 = load ptr, ptr getelementptr (%struct._objc_class, ptr @"\01L_OBJC_CLASS_NSBitmapImageRep", i32 0, i32 1), align 4 ; <ptr> [#uses=1]
144 %13 = getelementptr %struct._objc_super, ptr %objc_super, i32 0, i32 1 ; <ptr> [#uses=1]
145 store ptr %12, ptr %13, align 4
146 store ptr %objc_super, ptr %objc_super.5, align 4
147 %14 = load ptr, ptr @"\01L_OBJC_SELECTOR_REFERENCES_0", align 4 ; <ptr> [#uses=1]
148 %15 = load ptr, ptr %objc_super.5, align 4 ; <ptr> [#uses=1]
149 %16 = load ptr, ptr %zone, align 4 ; <ptr> [#uses=1]
150 %17 = call ptr (ptr, ptr, ...) @objc_msgSendSuper(ptr %15, ptr %14, ptr %16) nounwind ; <ptr> [#uses=1]
151 %18 = load ptr, ptr %new, align 4 ; <ptr> [#uses=1]
152 store ptr %17, ptr %18, align 4
155 return: ; preds = %entry
159 declare ptr @objc_msgSendSuper(ptr, ptr, ...)