9
9
; Test the most trivial example.
10
10
11
11
; CHECK-LABEL: define i32 @simple_func1(i32 %x, i32 %y)
12
- ; CHECK: %1 = tail call i32 @simple_func1_merged (i32 %x, i32 %y, i32* @g1)
12
+ ; CHECK: %1 = tail call i32 @simple_func1Tm (i32 %x, i32 %y, i32* @g1)
13
13
; CHECK: ret i32 %1
14
14
define i32 @simple_func1 (i32 %x , i32 %y ) {
15
15
%sum = add i32 %x , %y
@@ -20,7 +20,7 @@ define i32 @simple_func1(i32 %x, i32 %y) {
20
20
}
21
21
22
22
; CHECK-LABEL: define i32 @simple_func2(i32 %x, i32 %y)
23
- ; CHECK: %1 = tail call i32 @simple_func1_merged (i32 %x, i32 %y, i32* @g2)
23
+ ; CHECK: %1 = tail call i32 @simple_func1Tm (i32 %x, i32 %y, i32* @g2)
24
24
; CHECK: ret i32 %1
25
25
define i32 @simple_func2 (i32 %x , i32 %y ) {
26
26
%sum = add i32 %x , %y
@@ -30,15 +30,15 @@ define i32 @simple_func2(i32 %x, i32 %y) {
30
30
ret i32 %sum3
31
31
}
32
32
33
- ; CHECK-LABEL: define internal i32 @simple_func1_merged (i32, i32, i32*)
33
+ ; CHECK-LABEL: define internal i32 @simple_func1Tm (i32, i32, i32*)
34
34
; CHECK: %l = load i32, i32* %2
35
35
; CHECK: ret
36
36
37
37
38
38
; Merge 3 functions with 3 types of differing instructions: load, store and call.
39
39
40
40
; CHECK-LABEL: define i32 @func1_of_3(i32 %x)
41
- ; CHECK: %1 = tail call i32 @func1_of_3_merged (i32 %x, i32* @g1, i32* @g1, void (i32)* @callee1)
41
+ ; CHECK: %1 = tail call i32 @func1_of_3Tm (i32 %x, i32* @g1, i32* @g1, void (i32)* @callee1)
42
42
; CHECK: ret i32 %1
43
43
define i32 @func1_of_3 (i32 %x ) {
44
44
%l1 = load i32 , i32* @g1 , align 4
@@ -52,7 +52,7 @@ define i32 @func1_of_3(i32 %x) {
52
52
}
53
53
54
54
; CHECK-LABEL: define i32 @func2_of_3(i32 %x)
55
- ; CHECK: %1 = tail call i32 @func1_of_3_merged (i32 %x, i32* @g2, i32* @g2, void (i32)* @callee2)
55
+ ; CHECK: %1 = tail call i32 @func1_of_3Tm (i32 %x, i32* @g2, i32* @g2, void (i32)* @callee2)
56
56
; CHECK: ret i32 %1
57
57
define i32 @func2_of_3 (i32 %x ) {
58
58
%l1 = load i32 , i32* @g2 , align 4
@@ -66,7 +66,7 @@ define i32 @func2_of_3(i32 %x) {
66
66
}
67
67
68
68
; CHECK-LABEL: define i32 @func3_of_3(i32 %x)
69
- ; CHECK: %1 = tail call i32 @func1_of_3_merged (i32 %x, i32* @g3, i32* @g1, void (i32)* @callee3)
69
+ ; CHECK: %1 = tail call i32 @func1_of_3Tm (i32 %x, i32* @g3, i32* @g1, void (i32)* @callee3)
70
70
; CHECK: ret i32 %1
71
71
define i32 @func3_of_3 (i32 %x ) {
72
72
%l1 = load i32 , i32* @g3 , align 4
@@ -79,7 +79,7 @@ define i32 @func3_of_3(i32 %x) {
79
79
ret i32 %sum3
80
80
}
81
81
82
- ; CHECK-LABEL: define internal i32 @func1_of_3_merged (i32, i32*, i32*, void (i32)*)
82
+ ; CHECK-LABEL: define internal i32 @func1_of_3Tm (i32, i32*, i32*, void (i32)*)
83
83
; CHECK: %l1 = load i32, i32* %1
84
84
; CHECK: %l2 = load i32, i32* %2
85
85
; CHECK: store i32 %sum2, i32* %1
@@ -93,7 +93,7 @@ declare void @callee3(i32 %x)
93
93
; Preserve attributes
94
94
95
95
; CHECK-LABEL: define void @sret_func1(i32* sret %p, i32 %x, i32 %y)
96
- ; CHECK: tail call void @sret_func1_merged (i32* sret %p, i32 %x, i32 %y, i32* @g1)
96
+ ; CHECK: tail call void @sret_func1Tm (i32* sret %p, i32 %x, i32 %y, i32* @g1)
97
97
; CHECK: ret void
98
98
define void @sret_func1 (i32* sret %p , i32 %x , i32 %y ) {
99
99
%sum = add i32 %x , %y
@@ -104,7 +104,7 @@ define void @sret_func1(i32* sret %p, i32 %x, i32 %y) {
104
104
}
105
105
106
106
; CHECK-LABEL: define void @sret_func2(i32* sret %p, i32 %x, i32 %y)
107
- ; CHECK: tail call void @sret_func1_merged (i32* sret %p, i32 %x, i32 %y, i32* @g2)
107
+ ; CHECK: tail call void @sret_func1Tm (i32* sret %p, i32 %x, i32 %y, i32* @g2)
108
108
; CHECK: ret void
109
109
define void @sret_func2 (i32* sret %p , i32 %x , i32 %y ) {
110
110
%sum = add i32 %x , %y
@@ -114,7 +114,7 @@ define void @sret_func2(i32* sret %p, i32 %x, i32 %y) {
114
114
ret void
115
115
}
116
116
117
- ; CHECK-LABEL: define internal void @sret_func1_merged (i32* sret, i32, i32, i32*)
117
+ ; CHECK-LABEL: define internal void @sret_func1Tm (i32* sret, i32, i32, i32*)
118
118
; CHECK: %l = load i32, i32* %3, align 4
119
119
; CHECK: store i32 %sum2, i32* %0
120
120
; CHECK: ret
@@ -124,7 +124,7 @@ define void @sret_func2(i32* sret %p, i32 %x, i32 %y) {
124
124
; Instead merge those functions which match best.
125
125
126
126
; CHECK-LABEL: define i32 @func1_merged_with3(i32 %x)
127
- ; CHECK: %1 = tail call i32 @func1_merged_with3_merged (i32 %x, i32* @g1)
127
+ ; CHECK: %1 = tail call i32 @func1_merged_with3Tm (i32 %x, i32* @g1)
128
128
; CHECK: ret i32 %1
129
129
define i32 @func1_merged_with3 (i32 %x ) {
130
130
%l1 = load i32 , i32* @g1 , align 4
@@ -141,7 +141,7 @@ define i32 @func1_merged_with3(i32 %x) {
141
141
}
142
142
143
143
; CHECK-LABEL: define i32 @func2_merged_with4(i32 %x)
144
- ; CHECK: %1 = tail call i32 @func2_merged_with4_merged (i32 %x, i32* @g2)
144
+ ; CHECK: %1 = tail call i32 @func2_merged_with4Tm (i32 %x, i32* @g2)
145
145
; CHECK: ret i32 %1
146
146
define i32 @func2_merged_with4 (i32 %x ) {
147
147
%l1 = load i32 , i32* @g2 , align 4
@@ -158,7 +158,7 @@ define i32 @func2_merged_with4(i32 %x) {
158
158
}
159
159
160
160
; CHECK-LABEL: define i32 @func3_merged_with1(i32 %x)
161
- ; CHECK: %1 = tail call i32 @func1_merged_with3_merged (i32 %x, i32* @g2)
161
+ ; CHECK: %1 = tail call i32 @func1_merged_with3Tm (i32 %x, i32* @g2)
162
162
; CHECK: ret i32 %1
163
163
define i32 @func3_merged_with1 (i32 %x ) {
164
164
%l1 = load i32 , i32* @g2 , align 4
@@ -174,7 +174,7 @@ define i32 @func3_merged_with1(i32 %x) {
174
174
ret i32 %sum5
175
175
}
176
176
177
- ; CHECK-LABEL: define internal i32 @func1_merged_with3_merged (i32, i32*)
177
+ ; CHECK-LABEL: define internal i32 @func1_merged_with3Tm (i32, i32*)
178
178
; CHECK: load i32, i32* %1, align 4
179
179
; CHECK: load i32, i32* @g2, align 4
180
180
; CHECK: load i32, i32* @g3, align 4
@@ -183,7 +183,7 @@ define i32 @func3_merged_with1(i32 %x) {
183
183
; CHECK: ret i32
184
184
185
185
; CHECK-LABEL: define i32 @func4_merged_with2(i32 %x) {
186
- ; CHECK: %1 = tail call i32 @func2_merged_with4_merged (i32 %x, i32* @g1)
186
+ ; CHECK: %1 = tail call i32 @func2_merged_with4Tm (i32 %x, i32* @g1)
187
187
; CHECK: ret i32 %1
188
188
define i32 @func4_merged_with2 (i32 %x ) {
189
189
%l1 = load i32 , i32* @g1 , align 4
@@ -205,7 +205,7 @@ define i32 @func4_merged_with2(i32 %x) {
205
205
; Also check that the calling convention is preserved.
206
206
207
207
; CHECK-LABEL: define fastcc i32 @callee1_a(i32 %x, i32 %y)
208
- ; CHECK: %1 = tail call fastcc i32 @callee1_a_merged (i32 %x, i32 %y, i32* @g1)
208
+ ; CHECK: %1 = tail call fastcc i32 @callee1_aTm (i32 %x, i32 %y, i32* @g1)
209
209
; CHECK: ret i32 %1
210
210
define fastcc i32 @callee1_a (i32 %x , i32 %y ) {
211
211
%sum = add i32 %x , %y
@@ -216,7 +216,7 @@ define fastcc i32 @callee1_a(i32 %x, i32 %y) {
216
216
}
217
217
218
218
; CHECK-LABEL: define fastcc i32 @callee1_b(i32 %x, i32 %y)
219
- ; CHECK: %1 = tail call fastcc i32 @callee1_a_merged (i32 %x, i32 %y, i32* @g2)
219
+ ; CHECK: %1 = tail call fastcc i32 @callee1_aTm (i32 %x, i32 %y, i32* @g2)
220
220
; CHECK: ret i32 %1
221
221
define fastcc i32 @callee1_b (i32 %x , i32 %y ) {
222
222
%sum = add i32 %x , %y
@@ -226,8 +226,8 @@ define fastcc i32 @callee1_b(i32 %x, i32 %y) {
226
226
ret i32 %sum3
227
227
}
228
228
229
- ; CHECK-LABEL: define internal fastcc i32 @callee1_a_merged (i32, i32, i32*)
230
- ; CHECK: call i32 @callee2_a_merged (i32 %sum2, i32 %1, i32* %2)
229
+ ; CHECK-LABEL: define internal fastcc i32 @callee1_aTm (i32, i32, i32*)
230
+ ; CHECK: call i32 @callee2_aTm (i32 %sum2, i32 %1, i32* %2)
231
231
; CHECK: ret
232
232
233
233
; CHECK-NOT: @callee2_a(
@@ -249,7 +249,7 @@ define internal i32 @callee2_b(i32 %x, i32 %y) {
249
249
}
250
250
251
251
; CHECK-LABEL: define i32 @caller_a(i32 %x, i32 %y)
252
- ; CHECK: %1 = tail call i32 @caller_a_merged (i32 %x, i32 %y, i32* @g1)
252
+ ; CHECK: %1 = tail call i32 @caller_aTm (i32 %x, i32 %y, i32* @g1)
253
253
; CHECK: ret i32 %1
254
254
define i32 @caller_a (i32 %x , i32 %y ) {
255
255
%sum = add i32 %x , %y
@@ -260,7 +260,7 @@ define i32 @caller_a(i32 %x, i32 %y) {
260
260
}
261
261
262
262
; CHECK-LABEL: define i32 @caller_b(i32 %x, i32 %y)
263
- ; CHECK: %1 = tail call i32 @caller_a_merged (i32 %x, i32 %y, i32* @g2)
263
+ ; CHECK: %1 = tail call i32 @caller_aTm (i32 %x, i32 %y, i32* @g2)
264
264
; CHECK: ret i32 %1
265
265
define i32 @caller_b (i32 %x , i32 %y ) {
266
266
%sum = add i32 %x , %y
@@ -270,8 +270,8 @@ define i32 @caller_b(i32 %x, i32 %y) {
270
270
ret i32 %sum3
271
271
}
272
272
273
- ; CHECK-LABEL: define internal i32 @caller_a_merged (i32, i32, i32*)
274
- ; CHECK: call fastcc i32 @callee1_a_merged (i32 %sum2, i32 %1, i32* %2)
273
+ ; CHECK-LABEL: define internal i32 @caller_aTm (i32, i32, i32*)
274
+ ; CHECK: call fastcc i32 @callee1_aTm (i32 %sum2, i32 %1, i32* %2)
275
275
; CHECK: ret
276
276
277
277
@@ -327,7 +327,7 @@ done:
327
327
; Check self recursive functions
328
328
329
329
; CHECK-LABEL: define internal void @recursive1(i32 %x, i32 %y)
330
- ; CHECK: tail call void @recursive1_merged (i32 %x, i32 %y, i32* @g1, void (i32, i32)* @recursive1)
330
+ ; CHECK: tail call void @recursive1Tm (i32 %x, i32 %y, i32* @g1, void (i32, i32)* @recursive1)
331
331
; CHECK: ret void
332
332
define internal void @recursive1 (i32 %x , i32 %y ) {
333
333
br i1 undef , label %bb1 , label %bb2
342
342
}
343
343
344
344
; CHECK-LABEL: define internal void @recursive2(i32 %x, i32 %y)
345
- ; CHECK: tail call void @recursive1_merged (i32 %x, i32 %y, i32* @g2, void (i32, i32)* @recursive2)
345
+ ; CHECK: tail call void @recursive1Tm (i32 %x, i32 %y, i32* @g2, void (i32, i32)* @recursive2)
346
346
; CHECK: ret void
347
347
define internal void @recursive2 (i32 %x , i32 %y ) {
348
348
br i1 undef , label %bb1 , label %bb2
@@ -355,14 +355,14 @@ bb1:
355
355
bb2:
356
356
ret void
357
357
}
358
- ; CHECK-LABEL: define internal void @recursive1_merged (i32, i32, i32*, void (i32, i32)*)
358
+ ; CHECK-LABEL: define internal void @recursive1Tm (i32, i32, i32*, void (i32, i32)*)
359
359
; CHECK: load i32, i32* %2
360
360
; CHECK: call void %3(i32 %0, i32 %1)
361
361
; CHECK: ret void
362
362
363
363
364
364
; CHECK-LABEL: define internal void @another_recursive_func(i32 %x)
365
- ; CHECK: tail call void @another_recursive_func_merged (i32 %x, i32* @g1, void (i32)* @another_recursive_func)
365
+ ; CHECK: tail call void @another_recursive_funcTm (i32 %x, i32* @g1, void (i32)* @another_recursive_func)
366
366
; CHECK: ret void
367
367
define internal void @another_recursive_func (i32 %x ) {
368
368
br i1 undef , label %bb1 , label %bb2
377
377
}
378
378
; CHECK-NOT: @not_really_recursive(
379
379
380
- ; CHECK-LABEL: define internal void @another_recursive_func_merged (i32, i32*, void (i32)*)
380
+ ; CHECK-LABEL: define internal void @another_recursive_funcTm (i32, i32*, void (i32)*)
381
381
; CHECK: store i32 %0, i32* %1
382
382
; CHECK: call void %2(i32 %0)
383
383
; CHECK: ret void
398
398
; CHECK: call void @recursive1(i32 %x, i32 %x)
399
399
; CHECK: call void @recursive2(i32 %x, i32 %x)
400
400
; CHECK: call void @another_recursive_func(i32 %x)
401
- ; CHECK: call void @another_recursive_func_merged (i32 %x, i32* @g2, void (i32)* @callee1)
401
+ ; CHECK: call void @another_recursive_funcTm (i32 %x, i32* @g2, void (i32)* @callee1)
402
402
; CHECK: ret void
403
403
define void @call_recursive_funcs (i32 %x ) {
404
404
call void @recursive1 (i32 %x , i32 %x )
0 commit comments