llvm.org GIT mirror llvm / 561c44f
Changed renaming of local symbols by inserting a dot vefore the numeric suffix. One code change and several test changes to match that details in http://reviews.llvm.org/D9481 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237150 91177308-0d34-0410-b5e6-96231b3b80d8 Sunil Srivastava 4 years ago
29 changed file(s) with 122 addition(s) and 122 deletion(s). Raw diff Collapse all Expand all
5252 while (1) {
5353 // Trim any suffix off and append the next number.
5454 UniqueName.resize(BaseSize);
55 raw_svector_ostream(UniqueName) << ++LastUnique;
55 raw_svector_ostream(UniqueName) << "." << ++LastUnique;
5656
5757 // Try insert the vmap entry with this suffix.
5858 auto IterBool = vmap.insert(std::make_pair(UniqueName, V));
3939 entry:
4040 ; PROMOTED-LABEL: test2:
4141 ; In stress mode, constant vector are promoted
42 ; PROMOTED: adrp [[PAGEADDR:x[0-9]+]], [[CSTV1:__PromotedConst[0-9]+]]@PAGE
42 ; PROMOTED: adrp [[PAGEADDR:x[0-9]+]], [[CSTV1:__PromotedConst.[0-9]+]]@PAGE
4343 ; PROMOTED: ldr q[[REGNUM:[0-9]+]], {{\[}}[[PAGEADDR]], [[CSTV1]]@PAGEOFF]
4444 ; Destination register is defined by ABI
4545 ; PROMOTED-NEXT: add.16b v0, v0, v[[REGNUM]]
1111
1212 ; CHECK-LABEL: f1:
1313 define void @f1(i32 %a1, i32 %a2) #0 {
14 ; CHECK-NEXT: adrp x8, [[SET1:__MergedGlobals[0-9]*]]@PAGE
14 ; CHECK-NEXT: adrp x8, [[SET1:__MergedGlobals.[0-9]*]]@PAGE
1515 ; CHECK-NEXT: add x8, x8, [[SET1]]@PAGEOFF
1616 ; CHECK-NEXT: stp w0, w1, [x8]
1717 ; CHECK-NEXT: ret
2626
2727 ; CHECK-LABEL: f2:
2828 define void @f2(i32 %a1, i32 %a2, i32 %a3) #0 {
29 ; CHECK-NEXT: adrp x8, [[SET2:__MergedGlobals[0-9]*]]@PAGE
29 ; CHECK-NEXT: adrp x8, [[SET2:__MergedGlobals.[0-9]*]]@PAGE
3030 ; CHECK-NEXT: add x8, x8, [[SET2]]@PAGEOFF
3131 ; CHECK-NEXT: stp w0, w1, [x8]
3232 ; CHECK-NEXT: str w2, [x8, #8]
66 @g2 = internal addrspace(1) global i32 2
77
88
9 ; CHECK: _MergedGlobals1:
9 ; CHECK: _MergedGlobals.1:
1010 @g3 = internal addrspace(2) global i32 3
1111 @g4 = internal addrspace(2) global i32 4
5858 ; Make sure that the complete variable fits within the range of the maximum
5959 ; offset. Having the starting offset in range is not sufficient.
6060 ; When this works properly, @g3 is placed in a separate chunk of merged globals.
61 ; CHECK: _MergedGlobals1:
61 ; CHECK: _MergedGlobals.1:
6262 @g3 = internal global [30 x i32] [ i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10 ], align 4
6363
6464 ; Global variables that can be placed in BSS should be kept together in a
6565 ; separate pool of merged globals.
66 ; CHECK: _MergedGlobals2
66 ; CHECK: _MergedGlobals.2
6767 @g4 = internal global i32 0
6868 @g5 = internal global i32 0
6969
7070 ; Global variables that are constant can be merged together
71 ; CHECK: _MergedGlobals3
71 ; CHECK: _MergedGlobals.3
7272 @g6 = internal constant [12 x i32] zeroinitializer, align 4
7373 @g7 = internal constant [12 x i32] zeroinitializer, align 4
9696 ; CHECK: [[LPAD3_VAL:\%.+]] = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
9797 ; CHECK-NEXT: cleanup
9898 ; CHECK-NEXT: catch i8* bitcast (%rtti.TypeDescriptor2* @"\01??_R0H@8" to i8*)
99 ; CHECK-NEXT: [[RECOVER3:\%.+]] = call i8* (...) @llvm.eh.actions(i32 1, i8* bitcast (%rtti.TypeDescriptor2* @"\01??_R0H@8" to i8*), i32 2, i8* (i8*, i8*)* @"\01?test@@YAXXZ.catch1", i32 0, void (i8*, i8*)* @"\01?test@@YAXXZ.cleanup")
99 ; CHECK-NEXT: [[RECOVER3:\%.+]] = call i8* (...) @llvm.eh.actions(i32 1, i8* bitcast (%rtti.TypeDescriptor2* @"\01??_R0H@8" to i8*), i32 2, i8* (i8*, i8*)* @"\01?test@@YAXXZ.catch.1", i32 0, void (i8*, i8*)* @"\01?test@@YAXXZ.cleanup")
100100 ; CHECK-NEXT: indirectbr i8* [[RECOVER3]], [label %try.cont, label %try.cont15]
101101
102102 lpad3: ; preds = %invoke.cont2
190190 ; CHECK: ret void
191191 ; CHECK: }
192192
193 ; CHECK-LABEL: define internal i8* @"\01?test@@YAXXZ.catch1"(i8*, i8*)
193 ; CHECK-LABEL: define internal i8* @"\01?test@@YAXXZ.catch.1"(i8*, i8*)
194194 ; CHECK: entry:
195195 ; CHECK: [[RECOVER_TMP0:\%.+]] = call i8* @llvm.framerecover(i8* bitcast (void ()* @"\01?test@@YAXXZ" to i8*), i8* %1, i32 2)
196196 ; CHECK: [[TMP0_PTR:\%.+]] = bitcast i8* [[RECOVER_TMP0]] to i32*
7575 ; CHECK-NEXT: catch i8* null
7676 ; CHECK-NEXT: [[RECOVER:\%.+]] = call i8* (...) @llvm.eh.actions(
7777 ; CHECK-SAME: i32 1, i8* bitcast (%eh.HandlerMapEntry* @llvm.eh.handlermapentry.H to i8*), i32 0, i8* (i8*, i8*)* @"\01?test@@YAXXZ.catch",
78 ; CHECK-SAME: i32 1, i8* bitcast (%eh.HandlerMapEntry* @llvm.eh.handlermapentry._J to i8*), i32 1, i8* (i8*, i8*)* @"\01?test@@YAXXZ.catch1",
79 ; CHECK-SAME: i32 1, i8* bitcast (%eh.HandlerMapEntry* @"llvm.eh.handlermapentry.reference.?AVSomeClass@@" to i8*), i32 2, i8* (i8*, i8*)* @"\01?test@@YAXXZ.catch2",
80 ; CHECK-SAME: i32 1, i8* null, i32 -1, i8* (i8*, i8*)* @"\01?test@@YAXXZ.catch3")
78 ; CHECK-SAME: i32 1, i8* bitcast (%eh.HandlerMapEntry* @llvm.eh.handlermapentry._J to i8*), i32 1, i8* (i8*, i8*)* @"\01?test@@YAXXZ.catch.1",
79 ; CHECK-SAME: i32 1, i8* bitcast (%eh.HandlerMapEntry* @"llvm.eh.handlermapentry.reference.?AVSomeClass@@" to i8*), i32 2, i8* (i8*, i8*)* @"\01?test@@YAXXZ.catch.2",
80 ; CHECK-SAME: i32 1, i8* null, i32 -1, i8* (i8*, i8*)* @"\01?test@@YAXXZ.catch.3")
8181 ; CHECK-NEXT: indirectbr i8* [[RECOVER]], [label %ret]
8282
8383 lpad: ; preds = %entry
167167 ; CHECK: ret i8* blockaddress(@"\01?test@@YAXXZ", %ret)
168168 ; CHECK: }
169169
170 ; CHECK-LABEL: define internal i8* @"\01?test@@YAXXZ.catch1"(i8*, i8*)
170 ; CHECK-LABEL: define internal i8* @"\01?test@@YAXXZ.catch.1"(i8*, i8*)
171171 ; CHECK: entry:
172172 ; CHECK: [[RECOVER_LL:\%.+]] = call i8* @llvm.framerecover(i8* bitcast (void ()* @"\01?test@@YAXXZ" to i8*), i8* %1, i32 1)
173173 ; CHECK: [[LL_PTR:\%.+]] = bitcast i8* [[RECOVER_LL]] to i64*
176176 ; CHECK: ret i8* blockaddress(@"\01?test@@YAXXZ", %ret)
177177 ; CHECK: }
178178
179 ; CHECK-LABEL: define internal i8* @"\01?test@@YAXXZ.catch2"(i8*, i8*)
179 ; CHECK-LABEL: define internal i8* @"\01?test@@YAXXZ.catch.2"(i8*, i8*)
180180 ; CHECK: entry:
181181 ; CHECK: [[RECOVER_OBJ:\%.+]] = call i8* @llvm.framerecover(i8* bitcast (void ()* @"\01?test@@YAXXZ" to i8*), i8* %1, i32 2)
182182 ; CHECK: [[OBJ_PTR:\%.+]] = bitcast i8* [[RECOVER_OBJ]] to %class.SomeClass**
185185 ; CHECK: ret i8* blockaddress(@"\01?test@@YAXXZ", %ret)
186186 ; CHECK: }
187187
188 ; CHECK-LABEL: define internal i8* @"\01?test@@YAXXZ.catch3"(i8*, i8*)
188 ; CHECK-LABEL: define internal i8* @"\01?test@@YAXXZ.catch.3"(i8*, i8*)
189189 ; CHECK: entry:
190190 ; CHECK: call void @"\01?handle_exception@@YAXXZ"()
191191 ; CHECK: ret i8* blockaddress(@"\01?test@@YAXXZ", %ret)
5454 ; CHECK: landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
5555 ; CHECK: catch i8* bitcast (%rtti.TypeDescriptor2* @"\01??_R0H@8" to i8*)
5656 ; CHECK: catch i8* bitcast (%rtti.TypeDescriptor2* @"\01??_R0M@8" to i8*)
57 ; CHECK: [[RECOVER:\%.+]] = call i8* (...) @llvm.eh.actions(i32 1, i8* bitcast (%rtti.TypeDescriptor2* @"\01??_R0H@8" to i8*), i32 0, i8* (i8*, i8*)* @"\01?test@@YAXXZ.catch", i32 1, i8* bitcast (%rtti.TypeDescriptor2* @"\01??_R0M@8" to i8*), i32 1, i8* (i8*, i8*)* @"\01?test@@YAXXZ.catch1")
57 ; CHECK: [[RECOVER:\%.+]] = call i8* (...) @llvm.eh.actions(i32 1, i8* bitcast (%rtti.TypeDescriptor2* @"\01??_R0H@8" to i8*), i32 0, i8* (i8*, i8*)* @"\01?test@@YAXXZ.catch", i32 1, i8* bitcast (%rtti.TypeDescriptor2* @"\01??_R0M@8" to i8*), i32 1, i8* (i8*, i8*)* @"\01?test@@YAXXZ.catch.1")
5858 ; CHECK: indirectbr i8* [[RECOVER]], [label %try.cont10, label %try.cont]
5959
6060 lpad: ; preds = %entry
147147 ; CHECK: [[LPAD1_LABEL]]:{{[ ]+}}; preds = %entry
148148 ; CHECK: [[LPAD1_VAL:\%.+]] = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
149149 ; CHECK: catch i8* bitcast (%rtti.TypeDescriptor2* @"\01??_R0M@8" to i8*)
150 ; CHECK: [[RECOVER1:\%.+]] = call i8* (...) @llvm.eh.actions(i32 1, i8* bitcast (%rtti.TypeDescriptor2* @"\01??_R0M@8" to i8*), i32 1, i8* (i8*, i8*)* @"\01?test@@YAXXZ.catch1")
150 ; CHECK: [[RECOVER1:\%.+]] = call i8* (...) @llvm.eh.actions(i32 1, i8* bitcast (%rtti.TypeDescriptor2* @"\01??_R0M@8" to i8*), i32 1, i8* (i8*, i8*)* @"\01?test@@YAXXZ.catch.1")
151151 ; CHECK: indirectbr i8* [[RECOVER1]], []
152152 ;
153153 ; CHECK: }
154154
155 ; CHECK: define internal i8* @"\01?test@@YAXXZ.catch1"(i8*, i8*)
155 ; CHECK: define internal i8* @"\01?test@@YAXXZ.catch.1"(i8*, i8*)
156156 ; CHECK: entry:
157157 ; CHECK: [[RECOVER_F1:\%.+]] = call i8* @llvm.framerecover(i8* bitcast (void ()* @"\01?test@@YAXXZ" to i8*), i8* %1, i32 1)
158158 ; CHECK: [[F_PTR1:\%.+]] = bitcast i8* [[RECOVER_F1]] to float*
110110 ; CHECK-NEXT: catch i8* bitcast (i8** @_ZTIi to i8*)
111111 ; CHECK-NEXT: catch i8* bitcast (i8** @_ZTIf to i8*)
112112 ; CHECK-NEXT: [[RECOVER1:\%.+]] = call i8* (...) @llvm.eh.actions(
113 ; CHECK-SAME: i32 1, i8* bitcast (i8** @_ZTIi to i8*), i32 1, i8* (i8*, i8*)* @_Z4testv.catch1,
113 ; CHECK-SAME: i32 1, i8* bitcast (i8** @_ZTIi to i8*), i32 1, i8* (i8*, i8*)* @_Z4testv.catch.1,
114114 ; CHECK-SAME: i32 0, void (i8*, i8*)* @_Z4testv.cleanup,
115115 ; CHECK-SAME: i32 1, i8* bitcast (i8** @_ZTIf to i8*), i32 0, i8* (i8*, i8*)* @_Z4testv.catch)
116116 ; CHECK-NEXT: indirectbr i8* [[RECOVER1]], [label %try.cont19, label %try.cont]
132132 ; CHECK-NEXT: catch i8* bitcast (i8** @_ZTIi to i8*)
133133 ; CHECK-NEXT: catch i8* bitcast (i8** @_ZTIf to i8*)
134134 ; CHECK-NEXT: [[RECOVER3:\%.+]] = call i8* (...) @llvm.eh.actions(
135 ; CHECK-SAME: i32 0, void (i8*, i8*)* @_Z4testv.cleanup2,
136 ; CHECK-SAME: i32 1, i8* bitcast (i8** @_ZTIi to i8*), i32 1, i8* (i8*, i8*)* @_Z4testv.catch1,
135 ; CHECK-SAME: i32 0, void (i8*, i8*)* @_Z4testv.cleanup.2,
136 ; CHECK-SAME: i32 1, i8* bitcast (i8** @_ZTIi to i8*), i32 1, i8* (i8*, i8*)* @_Z4testv.catch.1,
137137 ; CHECK-SAME: i32 0, void (i8*, i8*)* @_Z4testv.cleanup,
138138 ; CHECK-SAME: i32 1, i8* bitcast (i8** @_ZTIf to i8*), i32 0, i8* (i8*, i8*)* @_Z4testv.catch)
139139 ; CHECK-NEXT: indirectbr i8* [[RECOVER3]], [label %try.cont19, label %try.cont]
250250 ; CHECK: }
251251
252252 ; This catch handler should be outlined.
253 ; CHECK: define internal i8* @_Z4testv.catch1(i8*, i8*)
253 ; CHECK: define internal i8* @_Z4testv.catch.1(i8*, i8*)
254254 ; CHECK: entry:
255255 ; CHECK: [[RECOVER_I:\%.+]] = call i8* @llvm.framerecover(i8* bitcast (void ()* @_Z4testv to i8*), i8* %1, i32 1)
256256 ; CHECK: [[I_PTR:\%.+]] = bitcast i8* [[RECOVER_I]] to i32*
276276 ; CHECK: }
277277
278278 ; This cleanup handler should be outlined.
279 ; CHECK: define internal void @_Z4testv.cleanup2(i8*, i8*)
279 ; CHECK: define internal void @_Z4testv.cleanup.2(i8*, i8*)
280280 ; CHECK: entry:
281281 ; CHECK: [[RECOVER_INNER:\%.+]] = call i8* @llvm.framerecover(i8* bitcast (void ()* @_Z4testv to i8*), i8* %1, i32 3)
282282 ; CHECK: [[INNER_PTR:\%.+]] = bitcast i8* [[RECOVER_INNER]] to %class.Inner*
6262 ; CHECK: landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
6363 ; CHECK: catch i8* bitcast (%rtti.TypeDescriptor2* @"\01??_R0H@8" to i8*)
6464 ; CHECK: catch i8* bitcast (%rtti.TypeDescriptor2* @"\01??_R0M@8" to i8*)
65 ; CHECK: [[RECOVER:\%.+]] = call i8* (...) @llvm.eh.actions(i32 1, i8* bitcast (%rtti.TypeDescriptor2* @"\01??_R0H@8" to i8*), i32 0, i8* (i8*, i8*)* @"\01?test@@YAXXZ.catch", i32 1, i8* bitcast (%rtti.TypeDescriptor2* @"\01??_R0M@8" to i8*), i32 1, i8* (i8*, i8*)* @"\01?test@@YAXXZ.catch1")
65 ; CHECK: [[RECOVER:\%.+]] = call i8* (...) @llvm.eh.actions(i32 1, i8* bitcast (%rtti.TypeDescriptor2* @"\01??_R0H@8" to i8*), i32 0, i8* (i8*, i8*)* @"\01?test@@YAXXZ.catch", i32 1, i8* bitcast (%rtti.TypeDescriptor2* @"\01??_R0M@8" to i8*), i32 1, i8* (i8*, i8*)* @"\01?test@@YAXXZ.catch.1")
6666 ; CHECK: indirectbr i8* [[RECOVER]], [label %try.cont19, label %try.cont10]
6767
6868 lpad: ; preds = %entry
194194 ; CHECK: [[LPAD1_VAL:\%.+]] = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
195195 ; CHECK: catch i8* bitcast (%rtti.TypeDescriptor2* @"\01??_R0H@8" to i8*)
196196 ; CHECK: catch i8* bitcast (%rtti.TypeDescriptor2* @"\01??_R0M@8" to i8*)
197 ; CHECK: [[RECOVER1:\%.+]] = call i8* (...) @llvm.eh.actions(i32 1, i8* bitcast (%rtti.TypeDescriptor2* @"\01??_R0H@8" to i8*), i32 2, i8* (i8*, i8*)* @"\01?test@@YAXXZ.catch2", i32 1, i8* bitcast (%rtti.TypeDescriptor2* @"\01??_R0M@8" to i8*), i32 1, i8* (i8*, i8*)* @"\01?test@@YAXXZ.catch1")
197 ; CHECK: [[RECOVER1:\%.+]] = call i8* (...) @llvm.eh.actions(i32 1, i8* bitcast (%rtti.TypeDescriptor2* @"\01??_R0H@8" to i8*), i32 2, i8* (i8*, i8*)* @"\01?test@@YAXXZ.catch.2", i32 1, i8* bitcast (%rtti.TypeDescriptor2* @"\01??_R0M@8" to i8*), i32 1, i8* (i8*, i8*)* @"\01?test@@YAXXZ.catch.1")
198198 ; CHECK: indirectbr i8* [[RECOVER1]], [label %invoke.cont2]
199199 ;
200200 ; CHECK: invoke.cont9:
203203 ; CHECK: [[LPAD8_LABEL]]:{{[ ]+}}; preds = %invoke.cont2
204204 ; CHECK: [[LPAD8_VAL:\%.+]] = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
205205 ; CHECK: catch i8* bitcast (%rtti.TypeDescriptor2* @"\01??_R0M@8" to i8*)
206 ; CHECK: [[RECOVER2:\%.+]] = call i8* (...) @llvm.eh.actions(i32 1, i8* bitcast (%rtti.TypeDescriptor2* @"\01??_R0M@8" to i8*), i32 1, i8* (i8*, i8*)* @"\01?test@@YAXXZ.catch1")
206 ; CHECK: [[RECOVER2:\%.+]] = call i8* (...) @llvm.eh.actions(i32 1, i8* bitcast (%rtti.TypeDescriptor2* @"\01??_R0M@8" to i8*), i32 1, i8* (i8*, i8*)* @"\01?test@@YAXXZ.catch.1")
207207 ; CHECK: indirectbr i8* [[RECOVER2]], []
208208 ;
209209 ; CHECK: }
210210
211 ; CHECK: define internal i8* @"\01?test@@YAXXZ.catch1"(i8*, i8*)
211 ; CHECK: define internal i8* @"\01?test@@YAXXZ.catch.1"(i8*, i8*)
212212 ; CHECK: entry:
213213 ; CHECK: [[RECOVER_F:\%.+]] = call i8* @llvm.framerecover(i8* bitcast (void ()* @"\01?test@@YAXXZ" to i8*), i8* %1, i32 1)
214214 ; CHECK: [[F_PTR:\%.+]] = bitcast i8* [[RECOVER_F]] to float*
217217 ; CHECK: ret i8* blockaddress(@"\01?test@@YAXXZ", %try.cont19)
218218 ; CHECK: }
219219
220 ; CHECK: define internal i8* @"\01?test@@YAXXZ.catch2"(i8*, i8*)
220 ; CHECK: define internal i8* @"\01?test@@YAXXZ.catch.2"(i8*, i8*)
221221 ; CHECK: entry:
222222 ; CHECK: [[RECOVER_J:\%.+]] = call i8* @llvm.framerecover(i8* bitcast (void ()* @"\01?test@@YAXXZ" to i8*), i8* %1, i32 2)
223223 ; CHECK: [[J_PTR:\%.+]] = bitcast i8* [[RECOVER_J]] to i32*
9393 %exn3 = load i8*, i8** %exn.slot
9494 call void @llvm.eh.begincatch(i8* %exn3, i8* null) #1
9595 call void @llvm.eh.endcatch() #1
96 br label %try.cont4
96 br label %try.cont.4
9797
9898 ; This block should not be eliminated.
99 ; CHECK: try.cont4:
100 try.cont4: ; preds = %catch2, %try.cont
99 ; CHECK: try.cont.4:
100 try.cont.4: ; preds = %catch2, %try.cont
101101 ret void
102102
103103 try.cont: ; No predecessors!
104 br label %try.cont4
104 br label %try.cont.4
105105
106106 unreachable: ; preds = %catch, %entry
107107 unreachable
169169 ; CHECK-NOT: call void @llvm.eh.endcatch()
170170 try.cont: ; preds = %catch2
171171 call void @llvm.eh.endcatch() #1
172 br label %try.cont4
173
174 try.cont4: ; preds = %try.cont
172 br label %try.cont.4
173
174 try.cont.4: ; preds = %try.cont
175175 ret void
176176
177177 unreachable: ; preds = %catch, %entry
185185 ; CHECK: }
186186
187187 ; The outlined test1.catch1 handler should return to a valid block address.
188 ; CHECK-LABEL: define internal i8* @"\01?test1@@YAXXZ.catch1"(i8*, i8*)
188 ; CHECK-LABEL: define internal i8* @"\01?test1@@YAXXZ.catch.1"(i8*, i8*)
189189 ; WILL-CHECK: ret i8* inttoptr (
190190 ; CHECK-NOT: ret i8* inttoptr (i32 1 to i8*)
191191 ; CHECK: }
196196 ; CHECK: }
197197
198198 ; The outlined test2.catch1 handler should return to a valid block address.
199 ; CHECK-LABEL: define internal i8* @"\01?test2@@YAXXZ.catch2"(i8*, i8*)
199 ; CHECK-LABEL: define internal i8* @"\01?test2@@YAXXZ.catch.2"(i8*, i8*)
200200 ; WILL-CHECK: ret i8* inttoptr (
201201 ; CHECK-NOT: ret i8* inttoptr (i32 1 to i8*)
202202 ; CHECK: }
1515 ; CHECK: @.str = internal unnamed_addr constant { [14 x i8], [50 x i8] } { [14 x i8] c"Hello, world!\00", [50 x i8] zeroinitializer }, align 32
1616
1717 ; Check emitted location descriptions:
18 ; CHECK: [[VARNAME:@__asan_gen_[0-9]+]] = private unnamed_addr constant [7 x i8] c"global\00", align 1
19 ; CHECK: [[FILENAME:@__asan_gen_[0-9]+]] = private unnamed_addr constant [22 x i8] c"/tmp/asan-globals.cpp\00", align 1
20 ; CHECK: [[LOCDESCR:@__asan_gen_[0-9]+]] = private unnamed_addr constant { [22 x i8]*, i32, i32 } { [22 x i8]* [[FILENAME]], i32 5, i32 5 }
18 ; CHECK: [[VARNAME:@__asan_gen_.[0-9]+]] = private unnamed_addr constant [7 x i8] c"global\00", align 1
19 ; CHECK: [[FILENAME:@__asan_gen_.[0-9]+]] = private unnamed_addr constant [22 x i8] c"/tmp/asan-globals.cpp\00", align 1
20 ; CHECK: [[LOCDESCR:@__asan_gen_.[0-9]+]] = private unnamed_addr constant { [22 x i8]*, i32, i32 } { [22 x i8]* [[FILENAME]], i32 5, i32 5 }
2121
2222 ; Check that location decriptors and global names were passed into __asan_register_globals:
2323 ; CHECK: i64 ptrtoint ([7 x i8]* [[VARNAME]] to i64)
66 ; CHECK-SAME: variable: i32* @x{{[,)]}}
77 ; CHECK: !DIGlobalVariable(name: "x",
88 ; CHECK-NOT: linkageName:
9 ; CHECK-SAME: variable: i32* @x1{{[,)]}}
9 ; CHECK-SAME: variable: i32* @x.1{{[,)]}}
1010 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-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"
1111 target triple = "x86_64-apple-macosx10.7.0"
1212
1010 ret i32 %add
1111 }
1212
13 ; CHECK-LABEL: define internal i32 @foo1
13 ; CHECK-LABEL: define internal i32 @foo.1
1414 ; CHECK-NEXT: entry:
1515 ; CHECK-NEXT: ret i32 4
1616
6060 @AConst = linkonce constant i32 123
6161
6262 ; Renamed version of Intern1.
63 ; CHECK-DAG: @Intern1{{[0-9]+}} = internal constant i32 52
63 ; CHECK-DAG: @Intern1.{{[0-9]+}} = internal constant i32 52
6464
6565
6666 ; Globals linked from testlink2.
33 ; Basic depth-3 chain
44 define double @test1(double %A1, double %A2, double %A3, double %B1, double %B2, double %B3) {
55 ; CHECK-LABEL: @test1(
6 ; CHECK: %X1.v.i1.11 = insertelement <3 x double> undef, double %B1, i32 0
7 ; CHECK: %X1.v.i1.22 = insertelement <3 x double> %X1.v.i1.11, double %B2, i32 1
8 ; CHECK: %X1.v.i1 = insertelement <3 x double> %X1.v.i1.22, double %B3, i32 2
9 ; CHECK: %X1.v.i0.13 = insertelement <3 x double> undef, double %A1, i32 0
10 ; CHECK: %X1.v.i0.24 = insertelement <3 x double> %X1.v.i0.13, double %A2, i32 1
11 ; CHECK: %X1.v.i0 = insertelement <3 x double> %X1.v.i0.24, double %A3, i32 2
6 ; CHECK: %X1.v.i1.1.1 = insertelement <3 x double> undef, double %B1, i32 0
7 ; CHECK: %X1.v.i1.2.2 = insertelement <3 x double> %X1.v.i1.1.1, double %B2, i32 1
8 ; CHECK: %X1.v.i1 = insertelement <3 x double> %X1.v.i1.2.2, double %B3, i32 2
9 ; CHECK: %X1.v.i0.1.3 = insertelement <3 x double> undef, double %A1, i32 0
10 ; CHECK: %X1.v.i0.2.4 = insertelement <3 x double> %X1.v.i0.1.3, double %A2, i32 1
11 ; CHECK: %X1.v.i0 = insertelement <3 x double> %X1.v.i0.2.4, double %A3, i32 2
1212 %X1 = fsub double %A1, %B1
1313 %X2 = fsub double %A2, %B2
1414 %X3 = fsub double %A3, %B3
2323 ; CHECK: %Z1 = fadd <3 x double> %Y1, %X1.v.i1
2424 %R1 = fmul double %Z1, %Z2
2525 %R = fmul double %R1, %Z3
26 ; CHECK: %Z1.v.r210 = extractelement <3 x double> %Z1, i32 2
26 ; CHECK: %Z1.v.r2.10 = extractelement <3 x double> %Z1, i32 2
2727 ; CHECK: %Z1.v.r1 = extractelement <3 x double> %Z1, i32 0
2828 ; CHECK: %Z1.v.r2 = extractelement <3 x double> %Z1, i32 1
2929 ; CHECK: %R1 = fmul double %Z1.v.r1, %Z1.v.r2
30 ; CHECK: %R = fmul double %R1, %Z1.v.r210
30 ; CHECK: %R = fmul double %R1, %Z1.v.r2.10
3131 ret double %R
3232 ; CHECK: ret double %R
3333 }
3333 ; CHECK: %arrayidx.i = getelementptr inbounds float, float* %a, i64 7
3434 ; CHECK: store float %1, float* %arrayidx.i, align 4, !noalias !16
3535 ; CHECK: %2 = load float, float* %a, align 4, !alias.scope !16, !noalias !17
36 ; CHECK: %arrayidx.i.i1 = getelementptr inbounds float, float* %b, i64 5
37 ; CHECK: store float %2, float* %arrayidx.i.i1, align 4, !alias.scope !21, !noalias !22
38 ; CHECK: %arrayidx1.i.i2 = getelementptr inbounds float, float* %b, i64 8
39 ; CHECK: store float %2, float* %arrayidx1.i.i2, align 4, !alias.scope !23, !noalias !24
36 ; CHECK: %arrayidx.i.i.1 = getelementptr inbounds float, float* %b, i64 5
37 ; CHECK: store float %2, float* %arrayidx.i.i.1, align 4, !alias.scope !21, !noalias !22
38 ; CHECK: %arrayidx1.i.i.2 = getelementptr inbounds float, float* %b, i64 8
39 ; CHECK: store float %2, float* %arrayidx1.i.i.2, align 4, !alias.scope !23, !noalias !24
4040 ; CHECK: %3 = load float, float* %a, align 4, !alias.scope !16
41 ; CHECK: %arrayidx.i3 = getelementptr inbounds float, float* %b, i64 7
42 ; CHECK: store float %3, float* %arrayidx.i3, align 4, !alias.scope !16
41 ; CHECK: %arrayidx.i.3 = getelementptr inbounds float, float* %b, i64 7
42 ; CHECK: store float %3, float* %arrayidx.i.3, align 4, !alias.scope !16
4343 ; CHECK: ret void
4444 ; CHECK: }
4545
6060 ; CHECK: %arrayidx.i = getelementptr inbounds float, float* %a, i64 7
6161 ; CHECK: store float %1, float* %arrayidx.i, align 4, !alias.scope !14, !noalias !13
6262 ; CHECK: %2 = load float, float* %c, align 4, !noalias !15
63 ; CHECK: %arrayidx.i1 = getelementptr inbounds float, float* %a, i64 6
64 ; CHECK: store float %2, float* %arrayidx.i1, align 4, !alias.scope !19, !noalias !20
63 ; CHECK: %arrayidx.i.1 = getelementptr inbounds float, float* %a, i64 6
64 ; CHECK: store float %2, float* %arrayidx.i.1, align 4, !alias.scope !19, !noalias !20
6565 ; CHECK: %arrayidx1.i = getelementptr inbounds float, float* %b, i64 8
6666 ; CHECK: store float %2, float* %arrayidx1.i, align 4, !alias.scope !20, !noalias !19
6767 ; CHECK: %3 = load float, float* %c, align 4
186186 %c2 = sext i8 %c1 to i32 ; [#uses=1]
187187 %RV = and i32 %c2, 255 ; [#uses=1]
188188 ret i32 %RV
189 ; CHECK: %c21 = and i32 %X, 255
190 ; CHECK: ret i32 %c21
189 ; CHECK: %c2.1 = and i32 %X, 255
190 ; CHECK: ret i32 %c2.1
191191 }
192192
193193 define i32 @test22(i32 %X) {
574574 ; CHECK: %0 = shl i8 %tmp4, 2
575575 ; CHECK: %tmp54 = and i8 %0, 16
576576 %tmp55 = xor i8 %tmp54, %tmp51
577 ; CHECK: ret i8 %tmp551
577 ; CHECK: ret i8 %tmp55.1
578578 ret i8 %tmp55
579579 }
580580
742742 %or = or i32 %shl, 7
743743 ret i32 %or
744744 ; CHECK-LABEL: @test57(
745 ; CHECK: %shl = shl i32 %shr1, 4
745 ; CHECK: %shl = shl i32 %shr.1, 4
746746 }
747747
748748
6262 ; CHECK-LABEL: @test7(
6363 ; CHECK-NEXT: %A1 = and i32 %A, 7
6464 ; CHECK-NEXT: %B1 = and i32 %B, 128
65 ; CHECK-NEXT: %C11 = or i32 %A1, %B1
66 ; CHECK-NEXT: ret i32 %C11
65 ; CHECK-NEXT: %C1.1 = or i32 %A1, %B1
66 ; CHECK-NEXT: ret i32 %C1.1
6767 %A1 = and i32 %A, 7 ; [#uses=1]
6868 %B1 = and i32 %B, 128 ; [#uses=1]
6969 %C1 = xor i32 %A1, %B1 ; [#uses=1]
9595 define i8 @test10(i8 %A) {
9696 ; CHECK-LABEL: @test10(
9797 ; CHECK-NEXT: %B = and i8 %A, 3
98 ; CHECK-NEXT: %C1 = or i8 %B, 4
99 ; CHECK-NEXT: ret i8 %C1
98 ; CHECK-NEXT: %C.1 = or i8 %B, 4
99 ; CHECK-NEXT: ret i8 %C.1
100100 %B = and i8 %A, 3 ; [#uses=1]
101101 %C = xor i8 %B, 4 ; [#uses=1]
102102 ret i8 %C
44 ; CHECK: @.memset_pattern = private unnamed_addr constant [4 x i32] [i32 1, i32 1, i32 1, i32 1]
55
66 ; For @test13_pattern
7 ; CHECK: @.memset_pattern1 = private unnamed_addr constant [2 x i32*] [i32* @G, i32* @G]
7 ; CHECK: @.memset_pattern.1 = private unnamed_addr constant [2 x i32*] [i32* @G, i32* @G]
88
99 target triple = "x86_64-apple-darwin10.0.0"
1010
3333 ; CHECK-NEXT: br label %loop_begin.us1
3434
3535 ; CHECK: loop_begin.us1: ; preds = %loop_begin.backedge.us5, %.split.split.us
36 ; CHECK-NEXT: %var_val.us2 = load i32, i32* %var
36 ; CHECK-NEXT: %var_val.us.2 = load i32, i32* %var
3737 ; CHECK-NEXT: switch i32 2, label %default.us-lcssa.us-lcssa.us [
3838 ; CHECK-NEXT: i32 1, label %inc.us4
3939 ; CHECK-NEXT: i32 2, label %dec.us3
6464 ; CHECK-NEXT: br label %loop_begin.us1
6565
6666 ; CHECK: loop_begin.us1: ; preds = %loop_begin.backedge.us6, %.split.split.us
67 ; CHECK-NEXT: %var_val.us2 = load i32, i32* %var
67 ; CHECK-NEXT: %var_val.us.2 = load i32, i32* %var
6868 ; CHECK-NEXT: switch i32 %c, label %second_switch.us3 [
6969 ; CHECK-NEXT: i32 1, label %loop_begin.inc_crit_edge.us
7070 ; CHECK-NEXT: ]
3838 !llvm.bitsets = !{ !0, !1, !2, !3, !4, !5, !6, !7 }
3939
4040 ; CHECK: @bits_use{{[0-9]*}} = private alias i8* @bits{{[0-9]*}}
41 ; CHECK: @bits_use{{[0-9]*}} = private alias i8* @bits{{[0-9]*}}
42 ; CHECK: @bits_use{{[0-9]*}} = private alias i8* @bits{{[0-9]*}}
41 ; CHECK: @bits_use.{{[0-9]*}} = private alias i8* @bits{{[0-9]*}}
42 ; CHECK: @bits_use.{{[0-9]*}} = private alias i8* @bits{{[0-9]*}}
4343
4444 ; CHECK: @a = alias getelementptr inbounds ({ i32, [0 x i8], [63 x i32], [4 x i8], i32, [0 x i8], [2 x i32] }, { i32, [0 x i8], [63 x i32], [4 x i8], i32, [0 x i8], [2 x i32] }* [[G]], i32 0, i32 0)
4545 ; CHECK: @b = alias getelementptr inbounds ({ i32, [0 x i8], [63 x i32], [4 x i8], i32, [0 x i8], [2 x i32] }, { i32, [0 x i8], [63 x i32], [4 x i8], i32, [0 x i8], [2 x i32] }* [[G]], i32 0, i32 2)
6161 ; CHECK-DARWIN: [[G]] = private constant
6262
6363 ; CHECK: @bits{{[0-9]*}} = private alias getelementptr inbounds ([68 x i8], [68 x i8]* [[BA]], i32 0, i32 0)
64 ; CHECK: @bits{{[0-9]*}} = private alias getelementptr inbounds ([68 x i8], [68 x i8]* [[BA]], i32 0, i32 0)
64 ; CHECK: @bits.{{[0-9]*}} = private alias getelementptr inbounds ([68 x i8], [68 x i8]* [[BA]], i32 0, i32 0)
6565
6666 declare i1 @llvm.bitset.test(i8* %ptr, metadata %bitset) nounwind readnone
6767
7979 ; CHECK: [[R6:%[^ ]*]] = icmp ult i32 [[R5]], 68
8080 ; CHECK: br i1 [[R6]]
8181
82 ; CHECK: [[R8:%[^ ]*]] = getelementptr i8, i8* @bits_use{{[0-9]*}}, i32 [[R5]]
82 ; CHECK: [[R8:%[^ ]*]] = getelementptr i8, i8* @bits_use.{{[0-9]*}}, i32 [[R5]]
8383 ; CHECK: [[R9:%[^ ]*]] = load i8, i8* [[R8]]
8484 ; CHECK: [[R10:%[^ ]*]] = and i8 [[R9]], 1
8585 ; CHECK: [[R11:%[^ ]*]] = icmp ne i8 [[R10]], 0
122122 ; CHECK: [[T6:%[^ ]*]] = icmp ult i32 [[T5]], 66
123123 ; CHECK: br i1 [[T6]]
124124
125 ; CHECK: [[T8:%[^ ]*]] = getelementptr i8, i8* @bits_use{{[0-9]*}}, i32 [[T5]]
125 ; CHECK: [[T8:%[^ ]*]] = getelementptr i8, i8* @bits_use.{{[0-9]*}}, i32 [[T5]]
126126 ; CHECK: [[T9:%[^ ]*]] = load i8, i8* [[T8]]
127127 ; CHECK: [[T10:%[^ ]*]] = and i8 [[T9]], 2
128128 ; CHECK: [[T11:%[^ ]*]] = icmp ne i8 [[T10]], 0
33 ; On output we should got binary comparison tree. Check that all is fine.
44
55 ;CHECK: entry:
6 ;CHECK-NEXT: br label %NodeBlock19
6 ;CHECK-NEXT: br label %NodeBlock.19
77
8 ;CHECK: NodeBlock19: ; preds = %entry
9 ;CHECK-NEXT: %Pivot20 = icmp slt i32 %tmp158, 10
10 ;CHECK-NEXT: br i1 %Pivot20, label %NodeBlock5, label %NodeBlock17
8 ;CHECK: NodeBlock.19: ; preds = %entry
9 ;CHECK-NEXT: %Pivot.20 = icmp slt i32 %tmp158, 10
10 ;CHECK-NEXT: br i1 %Pivot.20, label %NodeBlock.5, label %NodeBlock.17
1111
12 ;CHECK: NodeBlock17: ; preds = %NodeBlock19
13 ;CHECK-NEXT: %Pivot18 = icmp slt i32 %tmp158, 13
14 ;CHECK-NEXT: br i1 %Pivot18, label %NodeBlock9, label %NodeBlock15
12 ;CHECK: NodeBlock.17: ; preds = %NodeBlock.19
13 ;CHECK-NEXT: %Pivot.18 = icmp slt i32 %tmp158, 13
14 ;CHECK-NEXT: br i1 %Pivot.18, label %NodeBlock.9, label %NodeBlock.15
1515
16 ;CHECK: NodeBlock15: ; preds = %NodeBlock17
17 ;CHECK-NEXT: %Pivot16 = icmp slt i32 %tmp158, 14
18 ;CHECK-NEXT: br i1 %Pivot16, label %bb330, label %NodeBlock13
16 ;CHECK: NodeBlock.15: ; preds = %NodeBlock.17
17 ;CHECK-NEXT: %Pivot.16 = icmp slt i32 %tmp158, 14
18 ;CHECK-NEXT: br i1 %Pivot.16, label %bb330, label %NodeBlock.13
1919
20 ;CHECK: NodeBlock13: ; preds = %NodeBlock15
21 ;CHECK-NEXT: %Pivot14 = icmp slt i32 %tmp158, 15
22 ;CHECK-NEXT: br i1 %Pivot14, label %bb332, label %LeafBlock11
20 ;CHECK: NodeBlock.13: ; preds = %NodeBlock.15
21 ;CHECK-NEXT: %Pivot.14 = icmp slt i32 %tmp158, 15
22 ;CHECK-NEXT: br i1 %Pivot.14, label %bb332, label %LeafBlock.11
2323
24 ;CHECK: LeafBlock11: ; preds = %NodeBlock13
24 ;CHECK: LeafBlock.11: ; preds = %NodeBlock.13
2525 ;CHECK-NEXT: %SwitchLeaf12 = icmp eq i32 %tmp158, 15
2626 ;CHECK-NEXT: br i1 %SwitchLeaf12, label %bb334, label %NewDefault
2727
28 ;CHECK: NodeBlock9: ; preds = %NodeBlock17
29 ;CHECK-NEXT: %Pivot10 = icmp slt i32 %tmp158, 11
30 ;CHECK-NEXT: br i1 %Pivot10, label %bb324, label %NodeBlock7
28 ;CHECK: NodeBlock.9: ; preds = %NodeBlock.17
29 ;CHECK-NEXT: %Pivot.10 = icmp slt i32 %tmp158, 11
30 ;CHECK-NEXT: br i1 %Pivot.10, label %bb324, label %NodeBlock.7
3131
32 ;CHECK: NodeBlock7: ; preds = %NodeBlock9
33 ;CHECK-NEXT: %Pivot8 = icmp slt i32 %tmp158, 12
34 ;CHECK-NEXT: br i1 %Pivot8, label %bb326, label %bb328
32 ;CHECK: NodeBlock.7: ; preds = %NodeBlock.9
33 ;CHECK-NEXT: %Pivot.8 = icmp slt i32 %tmp158, 12
34 ;CHECK-NEXT: br i1 %Pivot.8, label %bb326, label %bb328
3535
36 ;CHECK: NodeBlock5: ; preds = %NodeBlock19
37 ;CHECK-NEXT: %Pivot6 = icmp slt i32 %tmp158, 7
38 ;CHECK-NEXT: br i1 %Pivot6, label %NodeBlock, label %NodeBlock3
36 ;CHECK: NodeBlock.5: ; preds = %NodeBlock.19
37 ;CHECK-NEXT: %Pivot.6 = icmp slt i32 %tmp158, 7
38 ;CHECK-NEXT: br i1 %Pivot.6, label %NodeBlock, label %NodeBlock.3
3939
40 ;CHECK: NodeBlock3: ; preds = %NodeBlock5
41 ;CHECK-NEXT: %Pivot4 = icmp slt i32 %tmp158, 8
42 ;CHECK-NEXT: br i1 %Pivot4, label %bb, label %NodeBlock1
40 ;CHECK: NodeBlock.3: ; preds = %NodeBlock.5
41 ;CHECK-NEXT: %Pivot.4 = icmp slt i32 %tmp158, 8
42 ;CHECK-NEXT: br i1 %Pivot.4, label %bb, label %NodeBlock.1
4343
44 ;CHECK: NodeBlock1: ; preds = %NodeBlock3
45 ;CHECK-NEXT: %Pivot2 = icmp slt i32 %tmp158, 9
46 ;CHECK-NEXT: br i1 %Pivot2, label %bb338, label %bb322
44 ;CHECK: NodeBlock.1: ; preds = %NodeBlock.3
45 ;CHECK-NEXT: %Pivot.2 = icmp slt i32 %tmp158, 9
46 ;CHECK-NEXT: br i1 %Pivot.2, label %bb338, label %bb322
4747
48 ;CHECK: NodeBlock: ; preds = %NodeBlock5
48 ;CHECK: NodeBlock: ; preds = %NodeBlock.5
4949 ;CHECK-NEXT: %Pivot = icmp slt i32 %tmp158, 0
5050 ;CHECK-NEXT: br i1 %Pivot, label %LeafBlock, label %bb338
5151
7373 ; CHECK: gc.statepoint.p0f_isVoidf
7474 ; CHECK: gc.statepoint.p0f_i1i1f
7575 ; CHECK: (i1 (i1)* @i1_return_i1, i32 1, i32 0, i1 false, i32 0, i32 0)
76 ; CHECK: %call12 = call i1 @llvm.experimental.gc.result.i1
76 ; CHECK: %call1.2 = call i1 @llvm.experimental.gc.result.i1
7777 entry:
7878 %call1 = tail call i1 (i1) @i1_return_i1(i1 false)
7979 ret i1 %call1
66 ; CHECK: @switch.table = private unnamed_addr constant [7 x i32] [i32 55, i32 123, i32 0, i32 -1, i32 27, i32 62, i32 1]
77
88 ; The float table for @h
9 ; CHECK: @switch.table1 = private unnamed_addr constant [4 x float] [float 0x40091EB860000000, float 0x3FF3BE76C0000000, float 0x4012449BA0000000, float 0x4001AE1480000000]
9 ; CHECK: @switch.table.1 = private unnamed_addr constant [4 x float] [float 0x40091EB860000000, float 0x3FF3BE76C0000000, float 0x4012449BA0000000, float 0x4001AE1480000000]
1010
1111 ; The table for @foostring
12 ; CHECK: @switch.table2 = private unnamed_addr constant [4 x i8*] [i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str2, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str3, i64 0, i64 0)]
12 ; CHECK: @switch.table.2 = private unnamed_addr constant [4 x i8*] [i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str2, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str3, i64 0, i64 0)]
1313
1414 ; The table for @earlyreturncrash
15 ; CHECK: @switch.table3 = private unnamed_addr constant [4 x i32] [i32 42, i32 9, i32 88, i32 5]
15 ; CHECK: @switch.table.3 = private unnamed_addr constant [4 x i32] [i32 42, i32 9, i32 88, i32 5]
1616
1717 ; The table for @large.
18 ; CHECK: @switch.table4 = private unnamed_addr constant [199 x i32] [i32 1, i32 4, i32 9,
18 ; CHECK: @switch.table.4 = private unnamed_addr constant [199 x i32] [i32 1, i32 4, i32 9,
1919
2020 ; The table for @cprop
21 ; CHECK: @switch.table5 = private unnamed_addr constant [7 x i32] [i32 5, i32 42, i32 126, i32 -452, i32 128, i32 6, i32 7]
21 ; CHECK: @switch.table.5 = private unnamed_addr constant [7 x i32] [i32 5, i32 42, i32 126, i32 -452, i32 128, i32 6, i32 7]
2222
2323 ; The table for @unreachable_case
24 ; CHECK: @switch.table6 = private unnamed_addr constant [9 x i32] [i32 0, i32 0, i32 0, i32 2, i32 -1, i32 1, i32 1, i32 1, i32 1]
24 ; CHECK: @switch.table.6 = private unnamed_addr constant [9 x i32] [i32 0, i32 0, i32 0, i32 2, i32 -1, i32 1, i32 1, i32 1, i32 1]
2525
2626 ; A simple int-to-int selection switch.
2727 ; It is dense enough to be replaced by table lookup.
9696 ; CHECK-NEXT: %switch.shiftamt = mul i32 %switch.tableidx, 8
9797 ; CHECK-NEXT: %switch.downshift = lshr i32 89655594, %switch.shiftamt
9898 ; CHECK-NEXT: %switch.masked = trunc i32 %switch.downshift to i8
99 ; CHECK-NEXT: %switch.gep = getelementptr inbounds [4 x float], [4 x float]* @switch.table1, i32 0, i32 %switch.tableidx
99 ; CHECK-NEXT: %switch.gep = getelementptr inbounds [4 x float], [4 x float]* @switch.table.1, i32 0, i32 %switch.tableidx
100100 ; CHECK-NEXT: %switch.load = load float, float* %switch.gep
101101 ; CHECK-NEXT: br label %sw.epilog
102102 ; CHECK: sw.epilog:
143143 ; CHECK-NEXT: %0 = icmp ult i32 %switch.tableidx, 4
144144 ; CHECK-NEXT: br i1 %0, label %switch.lookup, label %return
145145 ; CHECK: switch.lookup:
146 ; CHECK-NEXT: %switch.gep = getelementptr inbounds [4 x i8*], [4 x i8*]* @switch.table2, i32 0, i32 %switch.tableidx
146 ; CHECK-NEXT: %switch.gep = getelementptr inbounds [4 x i8*], [4 x i8*]* @switch.table.2, i32 0, i32 %switch.tableidx
147147 ; CHECK-NEXT: %switch.load = load i8*, i8** %switch.gep
148148 ; CHECK-NEXT: ret i8* %switch.load
149149 }
172172
173173 ; CHECK-LABEL: @earlyreturncrash(
174174 ; CHECK: switch.lookup:
175 ; CHECK-NEXT: %switch.gep = getelementptr inbounds [4 x i32], [4 x i32]* @switch.table3, i32 0, i32 %switch.tableidx
175 ; CHECK-NEXT: %switch.gep = getelementptr inbounds [4 x i32], [4 x i32]* @switch.table.3, i32 0, i32 %switch.tableidx
176176 ; CHECK-NEXT: %switch.load = load i32, i32* %switch.gep
177177 ; CHECK-NEXT: ret i32 %switch.load
178178 ; CHECK: sw.epilog:
748748
749749 ; CHECK-LABEL: @cprop(
750750 ; CHECK: switch.lookup:
751 ; CHECK: %switch.gep = getelementptr inbounds [7 x i32], [7 x i32]* @switch.table5, i32 0, i32 %switch.tableidx
751 ; CHECK: %switch.gep = getelementptr inbounds [7 x i32], [7 x i32]* @switch.table.5, i32 0, i32 %switch.tableidx
752752 }
753753
754754 define i32 @unreachable_case(i32 %x) {
777777
778778 ; CHECK-LABEL: @unreachable_case(
779779 ; CHECK: switch.lookup:
780 ; CHECK: getelementptr inbounds [9 x i32], [9 x i32]* @switch.table6, i32 0, i32 %switch.tableidx
780 ; CHECK: getelementptr inbounds [9 x i32], [9 x i32]* @switch.table.6, i32 0, i32 %switch.tableidx
781781 }
782782
783783 define i32 @unreachable_default(i32 %x) {
804804 ; CHECK-NEXT: %switch.tableidx = sub i32 %x, 0
805805 ; CHECK-NOT: icmp
806806 ; CHECK-NOT: br 1i
807 ; CHECK-NEXT: %switch.gep = getelementptr inbounds [4 x i32], [4 x i32]* @switch.table7, i32 0, i32 %switch.tableidx
807 ; CHECK-NEXT: %switch.gep = getelementptr inbounds [4 x i32], [4 x i32]* @switch.table.7, i32 0, i32 %switch.tableidx
808808 ; CHECK-NEXT: %switch.load = load i32, i32* %switch.gep
809809 ; CHECK-NEXT: ret i32 %switch.load
810810 }
22 ; Test that we don't crash and have a different basic block for each incoming edge.
33 define void @test0() {
44 ; CHECK-LABEL: @test0
5 ; CHECK: %merge = phi i64 [ 1, %BB3 ], [ 0, %NewDefault ], [ 0, %NodeBlock5 ], [ 0, %LeafBlock1 ]
5 ; CHECK: %merge = phi i64 [ 1, %BB3 ], [ 0, %NewDefault ], [ 0, %NodeBlock.5 ], [ 0, %LeafBlock.1 ]
66 BB1:
77 switch i32 undef, label %BB2 [
88 i32 3, label %BB2
4242
4343 bb3:
4444 ; CHECK-LABEL: bb3
45 ; CHECK: %tmp = phi i32 [ 1, %NodeBlock ], [ 0, %bb2 ], [ 1, %LeafBlock3 ]
45 ; CHECK: %tmp = phi i32 [ 1, %NodeBlock ], [ 0, %bb2 ], [ 1, %LeafBlock.3 ]
4646 %tmp = phi i32 [ 1, %bb1 ], [ 0, %bb2 ], [ 1, %bb1 ], [ 1, %bb1 ]
47 ; CHECK-NEXT: %tmp2 = phi i32 [ 2, %NodeBlock ], [ 5, %bb2 ], [ 2, %LeafBlock3 ]
47 ; CHECK-NEXT: %tmp2 = phi i32 [ 2, %NodeBlock ], [ 5, %bb2 ], [ 2, %LeafBlock.3 ]
4848 %tmp2 = phi i32 [ 2, %bb1 ], [ 2, %bb1 ], [ 5, %bb2 ], [ 2, %bb1 ]
4949 br label %exit
5050