1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 4
2 ; RUN: opt -passes=inline -mtriple=aarch64--linux-gnu -S -o - < %s -inline-threshold=0 | FileCheck %s
4 target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"
5 target triple = "aarch64--linux-gnu"
8 @glbl = external global i32
10 define i32 @outer_add1(i32 %a) {
11 ; CHECK-LABEL: define i32 @outer_add1(
12 ; CHECK-SAME: i32 [[A:%.*]]) {
13 ; CHECK-NEXT: call void @pad()
14 ; CHECK-NEXT: store i32 0, ptr @glbl, align 4
15 ; CHECK-NEXT: ret i32 [[A]]
17 %C = call i32 @add(i32 %a, i32 0)
21 define i32 @outer_add2(i32 %a) {
22 ; CHECK-LABEL: define i32 @outer_add2(
23 ; CHECK-SAME: i32 [[A:%.*]]) {
24 ; CHECK-NEXT: call void @pad()
25 ; CHECK-NEXT: store i32 0, ptr @glbl, align 4
26 ; CHECK-NEXT: ret i32 [[A]]
28 %C = call i32 @add(i32 0, i32 %a)
32 define i32 @add(i32 %a, i32 %b) {
33 ; CHECK-LABEL: define i32 @add(
34 ; CHECK-SAME: i32 [[A:%.*]], i32 [[B:%.*]]) {
35 ; CHECK-NEXT: [[ADD:%.*]] = add i32 [[A]], [[B]]
36 ; CHECK-NEXT: call void @pad()
37 ; CHECK-NEXT: store i32 0, ptr @glbl, align 4
38 ; CHECK-NEXT: ret i32 [[ADD]]
42 store i32 0, ptr @glbl
48 define i32 @outer_sub1(i32 %a) {
49 ; CHECK-LABEL: define i32 @outer_sub1(
50 ; CHECK-SAME: i32 [[A:%.*]]) {
51 ; CHECK-NEXT: call void @pad()
52 ; CHECK-NEXT: store i32 0, ptr @glbl, align 4
53 ; CHECK-NEXT: ret i32 [[A]]
55 %C = call i32 @sub1(i32 %a, i32 0)
59 define i32 @sub1(i32 %a, i32 %b) {
60 ; CHECK-LABEL: define i32 @sub1(
61 ; CHECK-SAME: i32 [[A:%.*]], i32 [[B:%.*]]) {
62 ; CHECK-NEXT: [[SUB:%.*]] = sub i32 [[A]], [[B]]
63 ; CHECK-NEXT: call void @pad()
64 ; CHECK-NEXT: store i32 0, ptr @glbl, align 4
65 ; CHECK-NEXT: ret i32 [[SUB]]
69 store i32 0, ptr @glbl
74 define i32 @outer_sub2(i32 %a) {
75 ; CHECK-LABEL: define i32 @outer_sub2(
76 ; CHECK-SAME: i32 [[A:%.*]]) {
77 ; CHECK-NEXT: call void @pad()
78 ; CHECK-NEXT: ret i32 0
80 %C = call i32 @sub2(i32 %a)
84 define i32 @sub2(i32 %a) {
85 ; CHECK-LABEL: define i32 @sub2(
86 ; CHECK-SAME: i32 [[A:%.*]]) {
87 ; CHECK-NEXT: [[SUB:%.*]] = sub i32 [[A]], [[A]]
88 ; CHECK-NEXT: call void @pad()
89 ; CHECK-NEXT: ret i32 [[SUB]]
98 define i32 @outer_mul1(i32 %a) {
99 ; CHECK-LABEL: define i32 @outer_mul1(
100 ; CHECK-SAME: i32 [[A:%.*]]) {
101 ; CHECK-NEXT: call void @pad()
102 ; CHECK-NEXT: store i32 0, ptr @glbl, align 4
103 ; CHECK-NEXT: ret i32 0
105 %C = call i32 @mul(i32 %a, i32 0)
109 define i32 @outer_mul2(i32 %a) {
110 ; CHECK-LABEL: define i32 @outer_mul2(
111 ; CHECK-SAME: i32 [[A:%.*]]) {
112 ; CHECK-NEXT: call void @pad()
113 ; CHECK-NEXT: store i32 0, ptr @glbl, align 4
114 ; CHECK-NEXT: ret i32 [[A]]
116 %C = call i32 @mul(i32 %a, i32 1)
120 define i32 @mul(i32 %a, i32 %b) {
121 ; CHECK-LABEL: define i32 @mul(
122 ; CHECK-SAME: i32 [[A:%.*]], i32 [[B:%.*]]) {
123 ; CHECK-NEXT: [[MUL:%.*]] = mul i32 [[A]], [[B]]
124 ; CHECK-NEXT: call void @pad()
125 ; CHECK-NEXT: store i32 0, ptr @glbl, align 4
126 ; CHECK-NEXT: ret i32 [[MUL]]
128 %mul = mul i32 %a, %b
130 store i32 0, ptr @glbl
136 define i32 @outer_div1(i32 %a) {
137 ; CHECK-LABEL: define i32 @outer_div1(
138 ; CHECK-SAME: i32 [[A:%.*]]) {
139 ; CHECK-NEXT: call void @pad()
140 ; CHECK-NEXT: store i32 0, ptr @glbl, align 4
141 ; CHECK-NEXT: ret i32 0
143 %C = call i32 @div1(i32 0, i32 %a)
147 define i32 @outer_div2(i32 %a) {
148 ; CHECK-LABEL: define i32 @outer_div2(
149 ; CHECK-SAME: i32 [[A:%.*]]) {
150 ; CHECK-NEXT: call void @pad()
151 ; CHECK-NEXT: store i32 0, ptr @glbl, align 4
152 ; CHECK-NEXT: ret i32 [[A]]
154 %C = call i32 @div1(i32 %a, i32 1)
158 define i32 @div1(i32 %a, i32 %b) {
159 ; CHECK-LABEL: define i32 @div1(
160 ; CHECK-SAME: i32 [[A:%.*]], i32 [[B:%.*]]) {
161 ; CHECK-NEXT: [[DIV:%.*]] = sdiv i32 [[A]], [[B]]
162 ; CHECK-NEXT: call void @pad()
163 ; CHECK-NEXT: store i32 0, ptr @glbl, align 4
164 ; CHECK-NEXT: ret i32 [[DIV]]
166 %div = sdiv i32 %a, %b
168 store i32 0, ptr @glbl
173 define i32 @outer_div3(i32 %a) {
174 ; CHECK-LABEL: define i32 @outer_div3(
175 ; CHECK-SAME: i32 [[A:%.*]]) {
176 ; CHECK-NEXT: call void @pad()
177 ; CHECK-NEXT: ret i32 1
179 %C = call i32 @div2(i32 %a)
183 define i32 @div2(i32 %a) {
184 ; CHECK-LABEL: define i32 @div2(
185 ; CHECK-SAME: i32 [[A:%.*]]) {
186 ; CHECK-NEXT: [[DIV:%.*]] = sdiv i32 [[A]], [[A]]
187 ; CHECK-NEXT: call void @pad()
188 ; CHECK-NEXT: ret i32 [[DIV]]
190 %div = sdiv i32 %a, %a
197 define i32 @outer_rem1(i32 %a) {
198 ; CHECK-LABEL: define i32 @outer_rem1(
199 ; CHECK-SAME: i32 [[A:%.*]]) {
200 ; CHECK-NEXT: call void @pad()
201 ; CHECK-NEXT: store i32 0, ptr @glbl, align 4
202 ; CHECK-NEXT: ret i32 0
204 %C = call i32 @rem1(i32 0, i32 %a)
208 define i32 @outer_rem2(i32 %a) {
209 ; CHECK-LABEL: define i32 @outer_rem2(
210 ; CHECK-SAME: i32 [[A:%.*]]) {
211 ; CHECK-NEXT: call void @pad()
212 ; CHECK-NEXT: store i32 0, ptr @glbl, align 4
213 ; CHECK-NEXT: ret i32 0
215 %C = call i32 @rem1(i32 %a, i32 1)
219 define i32 @rem1(i32 %a, i32 %b) {
220 ; CHECK-LABEL: define i32 @rem1(
221 ; CHECK-SAME: i32 [[A:%.*]], i32 [[B:%.*]]) {
222 ; CHECK-NEXT: [[REM:%.*]] = urem i32 [[A]], [[B]]
223 ; CHECK-NEXT: call void @pad()
224 ; CHECK-NEXT: store i32 0, ptr @glbl, align 4
225 ; CHECK-NEXT: ret i32 [[REM]]
227 %rem = urem i32 %a, %b
229 store i32 0, ptr @glbl
234 define i32 @outer_rem3(i32 %a) {
235 ; CHECK-LABEL: define i32 @outer_rem3(
236 ; CHECK-SAME: i32 [[A:%.*]]) {
237 ; CHECK-NEXT: call void @pad()
238 ; CHECK-NEXT: ret i32 0
240 %C = call i32 @rem2(i32 %a)
244 define i32 @rem2(i32 %a) {
245 ; CHECK-LABEL: define i32 @rem2(
246 ; CHECK-SAME: i32 [[A:%.*]]) {
247 ; CHECK-NEXT: [[REM:%.*]] = urem i32 [[A]], [[A]]
248 ; CHECK-NEXT: call void @pad()
249 ; CHECK-NEXT: ret i32 [[REM]]
251 %rem = urem i32 %a, %a
258 define i32 @outer_shl1(i32 %a) {
259 ; CHECK-LABEL: define i32 @outer_shl1(
260 ; CHECK-SAME: i32 [[A:%.*]]) {
261 ; CHECK-NEXT: call void @pad()
262 ; CHECK-NEXT: store i32 0, ptr @glbl, align 4
263 ; CHECK-NEXT: ret i32 [[A]]
265 %C = call i32 @shl(i32 %a, i32 0)
269 define i32 @shl(i32 %a, i32 %b) {
270 ; CHECK-LABEL: define i32 @shl(
271 ; CHECK-SAME: i32 [[A:%.*]], i32 [[B:%.*]]) {
272 ; CHECK-NEXT: [[SHL:%.*]] = shl i32 [[A]], [[B]]
273 ; CHECK-NEXT: call void @pad()
274 ; CHECK-NEXT: store i32 0, ptr @glbl, align 4
275 ; CHECK-NEXT: ret i32 [[SHL]]
277 %shl = shl i32 %a, %b
279 store i32 0, ptr @glbl
285 define i32 @outer_shr1(i32 %a) {
286 ; CHECK-LABEL: define i32 @outer_shr1(
287 ; CHECK-SAME: i32 [[A:%.*]]) {
288 ; CHECK-NEXT: call void @pad()
289 ; CHECK-NEXT: store i32 0, ptr @glbl, align 4
290 ; CHECK-NEXT: ret i32 [[A]]
292 %C = call i32 @shr(i32 %a, i32 0)
296 define i32 @shr(i32 %a, i32 %b) {
297 ; CHECK-LABEL: define i32 @shr(
298 ; CHECK-SAME: i32 [[A:%.*]], i32 [[B:%.*]]) {
299 ; CHECK-NEXT: [[SHR:%.*]] = ashr i32 [[A]], [[B]]
300 ; CHECK-NEXT: call void @pad()
301 ; CHECK-NEXT: store i32 0, ptr @glbl, align 4
302 ; CHECK-NEXT: ret i32 [[SHR]]
304 %shr = ashr i32 %a, %b
306 store i32 0, ptr @glbl
312 define i1 @outer_and1(i1 %a) {
313 ; CHECK-LABEL: define i1 @outer_and1(
314 ; CHECK-SAME: i1 [[A:%.*]]) {
315 ; CHECK-NEXT: call void @pad()
316 ; CHECK-NEXT: store i32 0, ptr @glbl, align 4
317 ; CHECK-NEXT: ret i1 false
319 %c = call i1 @and1(i1 %a, i1 false)
323 define i1 @outer_and2(i1 %a) {
324 ; CHECK-LABEL: define i1 @outer_and2(
325 ; CHECK-SAME: i1 [[A:%.*]]) {
326 ; CHECK-NEXT: call void @pad()
327 ; CHECK-NEXT: store i32 0, ptr @glbl, align 4
328 ; CHECK-NEXT: ret i1 [[A]]
330 %c = call i1 @and1(i1 %a, i1 true)
334 define i1 @and1(i1 %a, i1 %b) {
335 ; CHECK-LABEL: define i1 @and1(
336 ; CHECK-SAME: i1 [[A:%.*]], i1 [[B:%.*]]) {
337 ; CHECK-NEXT: [[AND:%.*]] = and i1 [[A]], [[B]]
338 ; CHECK-NEXT: call void @pad()
339 ; CHECK-NEXT: store i32 0, ptr @glbl, align 4
340 ; CHECK-NEXT: ret i1 [[AND]]
344 store i32 0, ptr @glbl
349 define i1 @outer_and3(i1 %a) {
350 ; CHECK-LABEL: define i1 @outer_and3(
351 ; CHECK-SAME: i1 [[A:%.*]]) {
352 ; CHECK-NEXT: call void @pad()
353 ; CHECK-NEXT: ret i1 [[A]]
355 %c = call i1 @and2(i1 %a)
359 define i1 @and2(i1 %a) {
360 ; CHECK-LABEL: define i1 @and2(
361 ; CHECK-SAME: i1 [[A:%.*]]) {
362 ; CHECK-NEXT: [[AND:%.*]] = and i1 [[A]], [[A]]
363 ; CHECK-NEXT: call void @pad()
364 ; CHECK-NEXT: ret i1 [[AND]]
373 define i1 @outer_or1(i1 %a) {
374 ; CHECK-LABEL: define i1 @outer_or1(
375 ; CHECK-SAME: i1 [[A:%.*]]) {
376 ; CHECK-NEXT: call void @pad()
377 ; CHECK-NEXT: store i32 0, ptr @glbl, align 4
378 ; CHECK-NEXT: ret i1 [[A]]
380 %c = call i1 @or1(i1 %a, i1 false)
384 define i1 @outer_or2(i1 %a) {
385 ; CHECK-LABEL: define i1 @outer_or2(
386 ; CHECK-SAME: i1 [[A:%.*]]) {
387 ; CHECK-NEXT: call void @pad()
388 ; CHECK-NEXT: store i32 0, ptr @glbl, align 4
389 ; CHECK-NEXT: ret i1 true
391 %c = call i1 @or1(i1 %a, i1 true)
395 define i1 @or1(i1 %a, i1 %b) {
396 ; CHECK-LABEL: define i1 @or1(
397 ; CHECK-SAME: i1 [[A:%.*]], i1 [[B:%.*]]) {
398 ; CHECK-NEXT: [[OR:%.*]] = or i1 [[A]], [[B]]
399 ; CHECK-NEXT: call void @pad()
400 ; CHECK-NEXT: store i32 0, ptr @glbl, align 4
401 ; CHECK-NEXT: ret i1 [[OR]]
405 store i32 0, ptr @glbl
410 define i1 @outer_or3(i1 %a) {
411 ; CHECK-LABEL: define i1 @outer_or3(
412 ; CHECK-SAME: i1 [[A:%.*]]) {
413 ; CHECK-NEXT: call void @pad()
414 ; CHECK-NEXT: ret i1 [[A]]
416 %c = call i1 @or2(i1 %a)
420 define i1 @or2(i1 %a) {
421 ; CHECK-LABEL: define i1 @or2(
422 ; CHECK-SAME: i1 [[A:%.*]]) {
423 ; CHECK-NEXT: [[OR:%.*]] = or i1 [[A]], [[A]]
424 ; CHECK-NEXT: call void @pad()
425 ; CHECK-NEXT: ret i1 [[OR]]
434 define i1 @outer_xor1(i1 %a) {
435 ; CHECK-LABEL: define i1 @outer_xor1(
436 ; CHECK-SAME: i1 [[A:%.*]]) {
437 ; CHECK-NEXT: call void @pad()
438 ; CHECK-NEXT: store i32 0, ptr @glbl, align 4
439 ; CHECK-NEXT: ret i1 [[A]]
441 %c = call i1 @xor1(i1 %a, i1 false)
445 define i1 @xor1(i1 %a, i1 %b) {
446 ; CHECK-LABEL: define i1 @xor1(
447 ; CHECK-SAME: i1 [[A:%.*]], i1 [[B:%.*]]) {
448 ; CHECK-NEXT: [[XOR:%.*]] = xor i1 [[A]], [[B]]
449 ; CHECK-NEXT: call void @pad()
450 ; CHECK-NEXT: store i32 0, ptr @glbl, align 4
451 ; CHECK-NEXT: ret i1 [[XOR]]
455 store i32 0, ptr @glbl
460 define i1 @outer_xor3(i1 %a) {
461 ; CHECK-LABEL: define i1 @outer_xor3(
462 ; CHECK-SAME: i1 [[A:%.*]]) {
463 ; CHECK-NEXT: call void @pad()
464 ; CHECK-NEXT: ret i1 false
466 %c = call i1 @xor2(i1 %a)
470 define i1 @xor2(i1 %a) {
471 ; CHECK-LABEL: define i1 @xor2(
472 ; CHECK-SAME: i1 [[A:%.*]]) {
473 ; CHECK-NEXT: [[XOR:%.*]] = xor i1 [[A]], [[A]]
474 ; CHECK-NEXT: call void @pad()
475 ; CHECK-NEXT: ret i1 [[XOR]]