1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 2
2 ; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal -S < %s | FileCheck %s --check-prefixes=CHECK,TUNIT
4 declare float @llvm.copysign.f32(float, float)
5 declare float @llvm.fabs.f32(float)
7 define float @ret_copysign(float %arg0, float %arg1) {
8 ; CHECK-LABEL: define float @ret_copysign
9 ; CHECK-SAME: (float [[ARG0:%.*]], float [[ARG1:%.*]]) #[[ATTR1:[0-9]+]] {
10 ; CHECK-NEXT: [[CALL:%.*]] = call float @llvm.copysign.f32(float [[ARG0]], float [[ARG1]]) #[[ATTR2:[0-9]+]]
11 ; CHECK-NEXT: ret float [[CALL]]
13 %call = call float @llvm.copysign.f32(float %arg0, float %arg1)
17 define float @ret_copysign_fabs_rhs(float %arg0, float %arg1) {
18 ; CHECK-LABEL: define nofpclass(ninf nzero nsub nnorm) float @ret_copysign_fabs_rhs
19 ; CHECK-SAME: (float [[ARG0:%.*]], float [[ARG1:%.*]]) #[[ATTR1]] {
20 ; CHECK-NEXT: [[FABS_ARG1:%.*]] = call float @llvm.fabs.f32(float [[ARG1]]) #[[ATTR2]]
21 ; CHECK-NEXT: [[CALL:%.*]] = call nofpclass(ninf nzero nsub nnorm) float @llvm.copysign.f32(float [[ARG0]], float [[FABS_ARG1]]) #[[ATTR2]]
22 ; CHECK-NEXT: ret float [[CALL]]
24 %fabs.arg1 = call float @llvm.fabs.f32(float %arg1)
25 %call = call float @llvm.copysign.f32(float %arg0, float %fabs.arg1)
29 define float @ret_copysign_nnan_lhs_fabs_rhs(float nofpclass(nan) %arg0, float %arg1) {
30 ; CHECK-LABEL: define nofpclass(nan ninf nzero nsub nnorm) float @ret_copysign_nnan_lhs_fabs_rhs
31 ; CHECK-SAME: (float nofpclass(nan) [[ARG0:%.*]], float [[ARG1:%.*]]) #[[ATTR1]] {
32 ; CHECK-NEXT: [[FABS_ARG1:%.*]] = call float @llvm.fabs.f32(float [[ARG1]]) #[[ATTR2]]
33 ; CHECK-NEXT: [[CALL:%.*]] = call nofpclass(nan ninf nzero nsub nnorm) float @llvm.copysign.f32(float nofpclass(nan) [[ARG0]], float [[FABS_ARG1]]) #[[ATTR2]]
34 ; CHECK-NEXT: ret float [[CALL]]
36 %fabs.arg1 = call float @llvm.fabs.f32(float %arg1)
37 %call = call float @llvm.copysign.f32(float %arg0, float %fabs.arg1)
42 define float @ret_copysign_lhs_fabs_nnan_rhs(float %arg0, float %arg1) {
43 ; CHECK-LABEL: define nofpclass(ninf nzero nsub nnorm) float @ret_copysign_lhs_fabs_nnan_rhs
44 ; CHECK-SAME: (float [[ARG0:%.*]], float [[ARG1:%.*]]) #[[ATTR1]] {
45 ; CHECK-NEXT: [[FABS_ARG1:%.*]] = call nnan float @llvm.fabs.f32(float [[ARG1]]) #[[ATTR2]]
46 ; CHECK-NEXT: [[CALL:%.*]] = call nofpclass(ninf nzero nsub nnorm) float @llvm.copysign.f32(float [[ARG0]], float [[FABS_ARG1]]) #[[ATTR2]]
47 ; CHECK-NEXT: ret float [[CALL]]
49 %fabs.arg1 = call nnan float @llvm.fabs.f32(float %arg1)
50 %call = call float @llvm.copysign.f32(float %arg0, float %fabs.arg1)
55 define float @ret_copysign_noneg_lhs(float nofpclass(ninf nnorm nsub nzero) %arg0, float %arg1) {
56 ; CHECK-LABEL: define float @ret_copysign_noneg_lhs
57 ; CHECK-SAME: (float nofpclass(ninf nzero nsub nnorm) [[ARG0:%.*]], float [[ARG1:%.*]]) #[[ATTR1]] {
58 ; CHECK-NEXT: [[CALL:%.*]] = call float @llvm.copysign.f32(float nofpclass(ninf nzero nsub nnorm) [[ARG0]], float [[ARG1]]) #[[ATTR2]]
59 ; CHECK-NEXT: ret float [[CALL]]
61 %call = call float @llvm.copysign.f32(float %arg0, float %arg1)
65 define float @ret_copysign_noneg_rhs(float %arg0, float nofpclass(ninf nnorm nsub nzero) %arg1) {
66 ; CHECK-LABEL: define float @ret_copysign_noneg_rhs
67 ; CHECK-SAME: (float [[ARG0:%.*]], float nofpclass(ninf nzero nsub nnorm) [[ARG1:%.*]]) #[[ATTR1]] {
68 ; CHECK-NEXT: [[CALL:%.*]] = call float @llvm.copysign.f32(float [[ARG0]], float nofpclass(ninf nzero nsub nnorm) [[ARG1]]) #[[ATTR2]]
69 ; CHECK-NEXT: ret float [[CALL]]
71 %call = call float @llvm.copysign.f32(float %arg0, float %arg1)
75 define float @ret_copysign_noneg_nonan_rhs(float %arg0, float nofpclass(ninf nnorm nsub nzero nan) %arg1) {
76 ; CHECK-LABEL: define nofpclass(ninf nzero nsub nnorm) float @ret_copysign_noneg_nonan_rhs
77 ; CHECK-SAME: (float [[ARG0:%.*]], float nofpclass(nan ninf nzero nsub nnorm) [[ARG1:%.*]]) #[[ATTR1]] {
78 ; CHECK-NEXT: [[CALL:%.*]] = call nofpclass(ninf nzero nsub nnorm) float @llvm.copysign.f32(float [[ARG0]], float nofpclass(nan ninf nzero nsub nnorm) [[ARG1]]) #[[ATTR2]]
79 ; CHECK-NEXT: ret float [[CALL]]
81 %call = call float @llvm.copysign.f32(float %arg0, float %arg1)
85 define float @ret_copysign_nopos_lhs(float nofpclass(pinf pnorm psub pzero) %arg0, float %arg1) {
86 ; CHECK-LABEL: define float @ret_copysign_nopos_lhs
87 ; CHECK-SAME: (float nofpclass(pinf pzero psub pnorm) [[ARG0:%.*]], float [[ARG1:%.*]]) #[[ATTR1]] {
88 ; CHECK-NEXT: [[CALL:%.*]] = call float @llvm.copysign.f32(float nofpclass(pinf pzero psub pnorm) [[ARG0]], float [[ARG1]]) #[[ATTR2]]
89 ; CHECK-NEXT: ret float [[CALL]]
91 %call = call float @llvm.copysign.f32(float %arg0, float %arg1)
95 define float @ret_copysign_nopos_rhs(float %arg0, float nofpclass(pinf pnorm psub pzero) %arg1) {
96 ; CHECK-LABEL: define float @ret_copysign_nopos_rhs
97 ; CHECK-SAME: (float [[ARG0:%.*]], float nofpclass(pinf pzero psub pnorm) [[ARG1:%.*]]) #[[ATTR1]] {
98 ; CHECK-NEXT: [[CALL:%.*]] = call float @llvm.copysign.f32(float [[ARG0]], float nofpclass(pinf pzero psub pnorm) [[ARG1]]) #[[ATTR2]]
99 ; CHECK-NEXT: ret float [[CALL]]
101 %call = call float @llvm.copysign.f32(float %arg0, float %arg1)
105 define float @ret_copysign_nonan_lhs(float nofpclass(nan) %arg0, float %arg1) {
106 ; CHECK-LABEL: define nofpclass(nan) float @ret_copysign_nonan_lhs
107 ; CHECK-SAME: (float nofpclass(nan) [[ARG0:%.*]], float [[ARG1:%.*]]) #[[ATTR1]] {
108 ; CHECK-NEXT: [[CALL:%.*]] = call nofpclass(nan) float @llvm.copysign.f32(float nofpclass(nan) [[ARG0]], float [[ARG1]]) #[[ATTR2]]
109 ; CHECK-NEXT: ret float [[CALL]]
111 %call = call float @llvm.copysign.f32(float %arg0, float %arg1)
115 define float @ret_copysign_nonan_rhs(float %arg0, float nofpclass(nan) %arg1) {
116 ; CHECK-LABEL: define float @ret_copysign_nonan_rhs
117 ; CHECK-SAME: (float [[ARG0:%.*]], float nofpclass(nan) [[ARG1:%.*]]) #[[ATTR1]] {
118 ; CHECK-NEXT: [[CALL:%.*]] = call float @llvm.copysign.f32(float [[ARG0]], float nofpclass(nan) [[ARG1]]) #[[ATTR2]]
119 ; CHECK-NEXT: ret float [[CALL]]
121 %call = call float @llvm.copysign.f32(float %arg0, float %arg1)
125 define float @ret_copysign_noneg_nonan_lhs(float nofpclass(ninf nnorm nsub nzero nan) %arg0, float %arg1) {
126 ; CHECK-LABEL: define nofpclass(nan) float @ret_copysign_noneg_nonan_lhs
127 ; CHECK-SAME: (float nofpclass(nan ninf nzero nsub nnorm) [[ARG0:%.*]], float [[ARG1:%.*]]) #[[ATTR1]] {
128 ; CHECK-NEXT: [[CALL:%.*]] = call nofpclass(nan) float @llvm.copysign.f32(float nofpclass(nan ninf nzero nsub nnorm) [[ARG0]], float [[ARG1]]) #[[ATTR2]]
129 ; CHECK-NEXT: ret float [[CALL]]
131 %call = call float @llvm.copysign.f32(float %arg0, float %arg1)
135 define float @ret_copysign_nopos_nonan_lhs(float nofpclass(pinf pnorm psub pzero nan) %arg0, float %arg1) {
136 ; CHECK-LABEL: define nofpclass(nan) float @ret_copysign_nopos_nonan_lhs
137 ; CHECK-SAME: (float nofpclass(nan pinf pzero psub pnorm) [[ARG0:%.*]], float [[ARG1:%.*]]) #[[ATTR1]] {
138 ; CHECK-NEXT: [[CALL:%.*]] = call nofpclass(nan) float @llvm.copysign.f32(float nofpclass(nan pinf pzero psub pnorm) [[ARG0]], float [[ARG1]]) #[[ATTR2]]
139 ; CHECK-NEXT: ret float [[CALL]]
141 %call = call float @llvm.copysign.f32(float %arg0, float %arg1)
145 define float @ret_copysign_mixed_lhs0(float nofpclass(ninf pnorm nsub nzero) %arg0, float %arg1) {
146 ; CHECK-LABEL: define float @ret_copysign_mixed_lhs0
147 ; CHECK-SAME: (float nofpclass(ninf nzero nsub pnorm) [[ARG0:%.*]], float [[ARG1:%.*]]) #[[ATTR1]] {
148 ; CHECK-NEXT: [[CALL:%.*]] = call float @llvm.copysign.f32(float nofpclass(ninf nzero nsub pnorm) [[ARG0]], float [[ARG1]]) #[[ATTR2]]
149 ; CHECK-NEXT: ret float [[CALL]]
151 %call = call float @llvm.copysign.f32(float %arg0, float %arg1)
155 define float @ret_copysign_mixed_lhs1(float nofpclass(pinf nnorm psub pzero) %arg0, float %arg1) {
156 ; CHECK-LABEL: define float @ret_copysign_mixed_lhs1
157 ; CHECK-SAME: (float nofpclass(pinf pzero psub nnorm) [[ARG0:%.*]], float [[ARG1:%.*]]) #[[ATTR1]] {
158 ; CHECK-NEXT: [[CALL:%.*]] = call float @llvm.copysign.f32(float nofpclass(pinf pzero psub nnorm) [[ARG0]], float [[ARG1]]) #[[ATTR2]]
159 ; CHECK-NEXT: ret float [[CALL]]
161 %call = call float @llvm.copysign.f32(float %arg0, float %arg1)
165 define float @ret_copysign_mixed_lhs2(float nofpclass(ninf pnorm psub nzero qnan) %arg0, float %arg1) {
166 ; CHECK-LABEL: define nofpclass(qnan) float @ret_copysign_mixed_lhs2
167 ; CHECK-SAME: (float nofpclass(qnan ninf nzero psub pnorm) [[ARG0:%.*]], float [[ARG1:%.*]]) #[[ATTR1]] {
168 ; CHECK-NEXT: [[CALL:%.*]] = call nofpclass(qnan) float @llvm.copysign.f32(float nofpclass(qnan ninf nzero psub pnorm) [[ARG0]], float [[ARG1]]) #[[ATTR2]]
169 ; CHECK-NEXT: ret float [[CALL]]
171 %call = call float @llvm.copysign.f32(float %arg0, float %arg1)
175 define float @ret_copysign_noninf_lhs(float nofpclass(ninf) %arg0, float %arg1) {
176 ; CHECK-LABEL: define float @ret_copysign_noninf_lhs
177 ; CHECK-SAME: (float nofpclass(ninf) [[ARG0:%.*]], float [[ARG1:%.*]]) #[[ATTR1]] {
178 ; CHECK-NEXT: [[CALL:%.*]] = call float @llvm.copysign.f32(float nofpclass(ninf) [[ARG0]], float [[ARG1]]) #[[ATTR2]]
179 ; CHECK-NEXT: ret float [[CALL]]
181 %call = call float @llvm.copysign.f32(float %arg0, float %arg1)
185 define float @ret_copysign_nopinf_lhs(float nofpclass(pinf) %arg0, float %arg1) {
186 ; CHECK-LABEL: define float @ret_copysign_nopinf_lhs
187 ; CHECK-SAME: (float nofpclass(pinf) [[ARG0:%.*]], float [[ARG1:%.*]]) #[[ATTR1]] {
188 ; CHECK-NEXT: [[CALL:%.*]] = call float @llvm.copysign.f32(float nofpclass(pinf) [[ARG0]], float [[ARG1]]) #[[ATTR2]]
189 ; CHECK-NEXT: ret float [[CALL]]
191 %call = call float @llvm.copysign.f32(float %arg0, float %arg1)
195 define float @ret_copysign_noinf_lhs(float nofpclass(inf) %arg0, float %arg1) {
196 ; CHECK-LABEL: define nofpclass(inf) float @ret_copysign_noinf_lhs
197 ; CHECK-SAME: (float nofpclass(inf) [[ARG0:%.*]], float [[ARG1:%.*]]) #[[ATTR1]] {
198 ; CHECK-NEXT: [[CALL:%.*]] = call nofpclass(inf) float @llvm.copysign.f32(float nofpclass(inf) [[ARG0]], float [[ARG1]]) #[[ATTR2]]
199 ; CHECK-NEXT: ret float [[CALL]]
201 %call = call float @llvm.copysign.f32(float %arg0, float %arg1)
205 define float @ret_copysign_nonzero_lhs(float nofpclass(nzero) %arg0, float %arg1) {
206 ; CHECK-LABEL: define float @ret_copysign_nonzero_lhs
207 ; CHECK-SAME: (float nofpclass(nzero) [[ARG0:%.*]], float [[ARG1:%.*]]) #[[ATTR1]] {
208 ; CHECK-NEXT: [[CALL:%.*]] = call float @llvm.copysign.f32(float nofpclass(nzero) [[ARG0]], float [[ARG1]]) #[[ATTR2]]
209 ; CHECK-NEXT: ret float [[CALL]]
211 %call = call float @llvm.copysign.f32(float %arg0, float %arg1)
215 define float @ret_copysign_nopzero_lhs(float nofpclass(pzero) %arg0, float %arg1) {
216 ; CHECK-LABEL: define float @ret_copysign_nopzero_lhs
217 ; CHECK-SAME: (float nofpclass(pzero) [[ARG0:%.*]], float [[ARG1:%.*]]) #[[ATTR1]] {
218 ; CHECK-NEXT: [[CALL:%.*]] = call float @llvm.copysign.f32(float nofpclass(pzero) [[ARG0]], float [[ARG1]]) #[[ATTR2]]
219 ; CHECK-NEXT: ret float [[CALL]]
221 %call = call float @llvm.copysign.f32(float %arg0, float %arg1)
225 define float @ret_copysign_nozero_lhs(float nofpclass(zero) %arg0, float %arg1) {
226 ; CHECK-LABEL: define nofpclass(zero) float @ret_copysign_nozero_lhs
227 ; CHECK-SAME: (float nofpclass(zero) [[ARG0:%.*]], float [[ARG1:%.*]]) #[[ATTR1]] {
228 ; CHECK-NEXT: [[CALL:%.*]] = call nofpclass(zero) float @llvm.copysign.f32(float nofpclass(zero) [[ARG0]], float [[ARG1]]) #[[ATTR2]]
229 ; CHECK-NEXT: ret float [[CALL]]
231 %call = call float @llvm.copysign.f32(float %arg0, float %arg1)
235 define float @ret_copysign_nonsub_lhs(float nofpclass(nsub) %arg0, float %arg1) {
236 ; CHECK-LABEL: define float @ret_copysign_nonsub_lhs
237 ; CHECK-SAME: (float nofpclass(nsub) [[ARG0:%.*]], float [[ARG1:%.*]]) #[[ATTR1]] {
238 ; CHECK-NEXT: [[CALL:%.*]] = call float @llvm.copysign.f32(float nofpclass(nsub) [[ARG0]], float [[ARG1]]) #[[ATTR2]]
239 ; CHECK-NEXT: ret float [[CALL]]
241 %call = call float @llvm.copysign.f32(float %arg0, float %arg1)
245 define float @ret_copysign_nopsub_lhs(float nofpclass(psub) %arg0, float %arg1) {
246 ; CHECK-LABEL: define float @ret_copysign_nopsub_lhs
247 ; CHECK-SAME: (float nofpclass(psub) [[ARG0:%.*]], float [[ARG1:%.*]]) #[[ATTR1]] {
248 ; CHECK-NEXT: [[CALL:%.*]] = call float @llvm.copysign.f32(float nofpclass(psub) [[ARG0]], float [[ARG1]]) #[[ATTR2]]
249 ; CHECK-NEXT: ret float [[CALL]]
251 %call = call float @llvm.copysign.f32(float %arg0, float %arg1)
255 define float @ret_copysign_nosub_lhs(float nofpclass(sub) %arg0, float %arg1) {
256 ; CHECK-LABEL: define nofpclass(sub) float @ret_copysign_nosub_lhs
257 ; CHECK-SAME: (float nofpclass(sub) [[ARG0:%.*]], float [[ARG1:%.*]]) #[[ATTR1]] {
258 ; CHECK-NEXT: [[CALL:%.*]] = call nofpclass(sub) float @llvm.copysign.f32(float nofpclass(sub) [[ARG0]], float [[ARG1]]) #[[ATTR2]]
259 ; CHECK-NEXT: ret float [[CALL]]
261 %call = call float @llvm.copysign.f32(float %arg0, float %arg1)
265 define float @ret_copysign_nonnorm_lhs(float nofpclass(nnorm) %arg0, float %arg1) {
266 ; CHECK-LABEL: define float @ret_copysign_nonnorm_lhs
267 ; CHECK-SAME: (float nofpclass(nnorm) [[ARG0:%.*]], float [[ARG1:%.*]]) #[[ATTR1]] {
268 ; CHECK-NEXT: [[CALL:%.*]] = call float @llvm.copysign.f32(float nofpclass(nnorm) [[ARG0]], float [[ARG1]]) #[[ATTR2]]
269 ; CHECK-NEXT: ret float [[CALL]]
271 %call = call float @llvm.copysign.f32(float %arg0, float %arg1)
275 define float @ret_copysign_nopnorm_lhs(float nofpclass(pnorm) %arg0, float %arg1) {
276 ; CHECK-LABEL: define float @ret_copysign_nopnorm_lhs
277 ; CHECK-SAME: (float nofpclass(pnorm) [[ARG0:%.*]], float [[ARG1:%.*]]) #[[ATTR1]] {
278 ; CHECK-NEXT: [[CALL:%.*]] = call float @llvm.copysign.f32(float nofpclass(pnorm) [[ARG0]], float [[ARG1]]) #[[ATTR2]]
279 ; CHECK-NEXT: ret float [[CALL]]
281 %call = call float @llvm.copysign.f32(float %arg0, float %arg1)
285 define float @ret_copysign_nonorm_lhs(float nofpclass(norm) %arg0, float %arg1) {
286 ; CHECK-LABEL: define nofpclass(norm) float @ret_copysign_nonorm_lhs
287 ; CHECK-SAME: (float nofpclass(norm) [[ARG0:%.*]], float [[ARG1:%.*]]) #[[ATTR1]] {
288 ; CHECK-NEXT: [[CALL:%.*]] = call nofpclass(norm) float @llvm.copysign.f32(float nofpclass(norm) [[ARG0]], float [[ARG1]]) #[[ATTR2]]
289 ; CHECK-NEXT: ret float [[CALL]]
291 %call = call float @llvm.copysign.f32(float %arg0, float %arg1)
294 ;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line: