1 ; RUN: opt -inline -mtriple=aarch64--linux-gnu -S -o - < %s -inline-threshold=0 | FileCheck %s
3 target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"
4 target triple = "aarch64--linux-gnu"
7 @glbl = external global i32
9 define i32 @outer_add1(i32 %a) {
10 ; CHECK-LABEL: @outer_add1(
11 ; CHECK-NOT: call i32 @add
12 %C = call i32 @add(i32 %a, i32 0)
16 define i32 @outer_add2(i32 %a) {
17 ; CHECK-LABEL: @outer_add2(
18 ; CHECK-NOT: call i32 @add
19 %C = call i32 @add(i32 0, i32 %a)
23 define i32 @add(i32 %a, i32 %b) {
26 store i32 0, i32* @glbl
32 define i32 @outer_sub1(i32 %a) {
33 ; CHECK-LABEL: @outer_sub1(
34 ; CHECK-NOT: call i32 @sub1
35 %C = call i32 @sub1(i32 %a, i32 0)
39 define i32 @sub1(i32 %a, i32 %b) {
42 store i32 0, i32* @glbl
47 define i32 @outer_sub2(i32 %a) {
48 ; CHECK-LABEL: @outer_sub2(
49 ; CHECK-NOT: call i32 @sub2
50 %C = call i32 @sub2(i32 %a)
54 define i32 @sub2(i32 %a) {
62 define i32 @outer_mul1(i32 %a) {
63 ; CHECK-LABEL: @outer_mul1(
64 ; CHECK-NOT: call i32 @mul
65 %C = call i32 @mul(i32 %a, i32 0)
69 define i32 @outer_mul2(i32 %a) {
70 ; CHECK-LABEL: @outer_mul2(
71 ; CHECK-NOT: call i32 @mul
72 %C = call i32 @mul(i32 %a, i32 1)
76 define i32 @mul(i32 %a, i32 %b) {
79 store i32 0, i32* @glbl
85 define i32 @outer_div1(i32 %a) {
86 ; CHECK-LABEL: @outer_div1(
87 ; CHECK-NOT: call i32 @div1
88 %C = call i32 @div1(i32 0, i32 %a)
92 define i32 @outer_div2(i32 %a) {
93 ; CHECK-LABEL: @outer_div2(
94 ; CHECK-NOT: call i32 @div1
95 %C = call i32 @div1(i32 %a, i32 1)
99 define i32 @div1(i32 %a, i32 %b) {
100 %div = sdiv i32 %a, %b
102 store i32 0, i32* @glbl
107 define i32 @outer_div3(i32 %a) {
108 ; CHECK-LABEL: @outer_div3(
109 ; CHECK-NOT: call i32 @div
110 %C = call i32 @div2(i32 %a)
114 define i32 @div2(i32 %a) {
115 %div = sdiv i32 %a, %a
122 define i32 @outer_rem1(i32 %a) {
123 ; CHECK-LABEL: @outer_rem1(
124 ; CHECK-NOT: call i32 @rem
125 %C = call i32 @rem1(i32 0, i32 %a)
129 define i32 @outer_rem2(i32 %a) {
130 ; CHECK-LABEL: @outer_rem2(
131 ; CHECK-NOT: call i32 @rem
132 %C = call i32 @rem1(i32 %a, i32 1)
136 define i32 @rem1(i32 %a, i32 %b) {
137 %rem = urem i32 %a, %b
139 store i32 0, i32* @glbl
144 define i32 @outer_rem3(i32 %a) {
145 ; CHECK-LABEL: @outer_rem3(
146 ; CHECK-NOT: call i32 @rem
147 %C = call i32 @rem2(i32 %a)
151 define i32 @rem2(i32 %a) {
152 %rem = urem i32 %a, %a
159 define i32 @outer_shl1(i32 %a) {
160 ; CHECK-LABEL: @outer_shl1(
161 ; CHECK-NOT: call i32 @shl
162 %C = call i32 @shl(i32 %a, i32 0)
166 define i32 @shl(i32 %a, i32 %b) {
167 %shl = shl i32 %a, %b
169 store i32 0, i32* @glbl
175 define i32 @outer_shr1(i32 %a) {
176 ; CHECK-LABEL: @outer_shr1(
177 ; CHECK-NOT: call i32 @shr
178 %C = call i32 @shr(i32 %a, i32 0)
182 define i32 @shr(i32 %a, i32 %b) {
183 %shr = ashr i32 %a, %b
185 store i32 0, i32* @glbl
191 define i1 @outer_and1(i1 %a) {
192 ; check-label: @outer_and1(
193 ; check-not: call i1 @and1
194 %c = call i1 @and1(i1 %a, i1 false)
198 define i1 @outer_and2(i1 %a) {
199 ; check-label: @outer_and2(
200 ; check-not: call i1 @and1
201 %c = call i1 @and1(i1 %a, i1 true)
205 define i1 @and1(i1 %a, i1 %b) {
208 store i32 0, i32* @glbl
213 define i1 @outer_and3(i1 %a) {
214 ; check-label: @outer_and3(
215 ; check-not: call i1 @and2
216 %c = call i1 @and2(i1 %a)
220 define i1 @and2(i1 %a) {
228 define i1 @outer_or1(i1 %a) {
229 ; check-label: @outer_or1(
230 ; check-not: call i1 @or1
231 %c = call i1 @or1(i1 %a, i1 false)
235 define i1 @outer_or2(i1 %a) {
236 ; check-label: @outer_or2(
237 ; check-not: call i1 @or1
238 %c = call i1 @or1(i1 %a, i1 true)
242 define i1 @or1(i1 %a, i1 %b) {
245 store i32 0, i32* @glbl
250 define i1 @outer_or3(i1 %a) {
251 ; check-label: @outer_or3(
252 ; check-not: call i1 @or2
253 %c = call i1 @or2(i1 %a)
257 define i1 @or2(i1 %a) {
265 define i1 @outer_xor1(i1 %a) {
266 ; check-label: @outer_xor1(
267 ; check-not: call i1 @xor
268 %c = call i1 @xor1(i1 %a, i1 false)
272 define i1 @xor1(i1 %a, i1 %b) {
275 store i32 0, i32* @glbl
280 define i1 @outer_xor3(i1 %a) {
281 ; check-label: @outer_xor3(
282 ; check-not: call i1 @xor
283 %c = call i1 @xor2(i1 %a)
287 define i1 @xor2(i1 %a) {