1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt < %s -S -passes=early-cse -earlycse-debug-hash | FileCheck %s
3 ; RUN: opt < %s -S -passes='early-cse<memssa>' | FileCheck %s
5 ; Test use of constrained floating point intrinsics with consistent
6 ; floating point environments. The default floating point environment
7 ; is tested along with some alternate environments. All tests should
10 define double @fadd_defaultenv(double %a, double %b) #0 {
11 ; CHECK-LABEL: @fadd_defaultenv(
12 ; CHECK-NEXT: [[TMP1:%.*]] = call double @llvm.experimental.constrained.fadd.f64(double [[A:%.*]], double [[B:%.*]], metadata !"round.tonearest", metadata !"fpexcept.ignore") #[[ATTR0:[0-9]+]]
13 ; CHECK-NEXT: [[TMP2:%.*]] = call double @foo.f64(double [[TMP1]], double [[TMP1]]) #[[ATTR0]]
14 ; CHECK-NEXT: ret double [[TMP1]]
16 %1 = call double @llvm.experimental.constrained.fadd.f64(double %a, double %b, metadata !"round.tonearest", metadata !"fpexcept.ignore") #0
17 %2 = call double @llvm.experimental.constrained.fadd.f64(double %a, double %b, metadata !"round.tonearest", metadata !"fpexcept.ignore") #0
18 %3 = call double @foo.f64(double %1, double %2) #0
22 define double @fadd_neginf(double %a, double %b) #0 {
23 ; CHECK-LABEL: @fadd_neginf(
24 ; CHECK-NEXT: [[TMP1:%.*]] = call double @llvm.experimental.constrained.fadd.f64(double [[A:%.*]], double [[B:%.*]], metadata !"round.downward", metadata !"fpexcept.ignore") #[[ATTR0]]
25 ; CHECK-NEXT: [[TMP2:%.*]] = call double @foo.f64(double [[TMP1]], double [[TMP1]]) #[[ATTR0]]
26 ; CHECK-NEXT: ret double [[TMP1]]
28 %1 = call double @llvm.experimental.constrained.fadd.f64(double %a, double %b, metadata !"round.downward", metadata !"fpexcept.ignore") #0
29 %2 = call double @llvm.experimental.constrained.fadd.f64(double %a, double %b, metadata !"round.downward", metadata !"fpexcept.ignore") #0
30 %3 = call double @foo.f64(double %1, double %2) #0
34 define double @fadd_maytrap(double %a, double %b) #0 {
35 ; CHECK-LABEL: @fadd_maytrap(
36 ; CHECK-NEXT: [[TMP1:%.*]] = call double @llvm.experimental.constrained.fadd.f64(double [[A:%.*]], double [[B:%.*]], metadata !"round.tonearest", metadata !"fpexcept.maytrap") #[[ATTR0]]
37 ; CHECK-NEXT: [[TMP2:%.*]] = call double @foo.f64(double [[TMP1]], double [[TMP1]]) #[[ATTR0]]
38 ; CHECK-NEXT: ret double [[TMP1]]
40 %1 = call double @llvm.experimental.constrained.fadd.f64(double %a, double %b, metadata !"round.tonearest", metadata !"fpexcept.maytrap") #0
41 %2 = call double @llvm.experimental.constrained.fadd.f64(double %a, double %b, metadata !"round.tonearest", metadata !"fpexcept.maytrap") #0
42 %3 = call double @foo.f64(double %1, double %2) #0
46 define double @fsub_defaultenv(double %a, double %b) #0 {
47 ; CHECK-LABEL: @fsub_defaultenv(
48 ; CHECK-NEXT: [[TMP1:%.*]] = call double @llvm.experimental.constrained.fsub.f64(double [[A:%.*]], double [[B:%.*]], metadata !"round.tonearest", metadata !"fpexcept.ignore") #[[ATTR0]]
49 ; CHECK-NEXT: [[TMP2:%.*]] = call double @foo.f64(double [[TMP1]], double [[TMP1]]) #[[ATTR0]]
50 ; CHECK-NEXT: ret double [[TMP1]]
52 %1 = call double @llvm.experimental.constrained.fsub.f64(double %a, double %b, metadata !"round.tonearest", metadata !"fpexcept.ignore") #0
53 %2 = call double @llvm.experimental.constrained.fsub.f64(double %a, double %b, metadata !"round.tonearest", metadata !"fpexcept.ignore") #0
54 %3 = call double @foo.f64(double %1, double %2) #0
58 define double @fsub_neginf(double %a, double %b) #0 {
59 ; CHECK-LABEL: @fsub_neginf(
60 ; CHECK-NEXT: [[TMP1:%.*]] = call double @llvm.experimental.constrained.fsub.f64(double [[A:%.*]], double [[B:%.*]], metadata !"round.downward", metadata !"fpexcept.ignore") #[[ATTR0]]
61 ; CHECK-NEXT: [[TMP2:%.*]] = call double @foo.f64(double [[TMP1]], double [[TMP1]]) #[[ATTR0]]
62 ; CHECK-NEXT: ret double [[TMP1]]
64 %1 = call double @llvm.experimental.constrained.fsub.f64(double %a, double %b, metadata !"round.downward", metadata !"fpexcept.ignore") #0
65 %2 = call double @llvm.experimental.constrained.fsub.f64(double %a, double %b, metadata !"round.downward", metadata !"fpexcept.ignore") #0
66 %3 = call double @foo.f64(double %1, double %2) #0
70 define double @fsub_maytrap(double %a, double %b) #0 {
71 ; CHECK-LABEL: @fsub_maytrap(
72 ; CHECK-NEXT: [[TMP1:%.*]] = call double @llvm.experimental.constrained.fsub.f64(double [[A:%.*]], double [[B:%.*]], metadata !"round.tonearest", metadata !"fpexcept.maytrap") #[[ATTR0]]
73 ; CHECK-NEXT: [[TMP2:%.*]] = call double @foo.f64(double [[TMP1]], double [[TMP1]]) #[[ATTR0]]
74 ; CHECK-NEXT: ret double [[TMP1]]
76 %1 = call double @llvm.experimental.constrained.fsub.f64(double %a, double %b, metadata !"round.tonearest", metadata !"fpexcept.maytrap") #0
77 %2 = call double @llvm.experimental.constrained.fsub.f64(double %a, double %b, metadata !"round.tonearest", metadata !"fpexcept.maytrap") #0
78 %3 = call double @foo.f64(double %1, double %2) #0
82 define double @fmul_defaultenv(double %a, double %b) #0 {
83 ; CHECK-LABEL: @fmul_defaultenv(
84 ; CHECK-NEXT: [[TMP1:%.*]] = call double @llvm.experimental.constrained.fmul.f64(double [[A:%.*]], double [[B:%.*]], metadata !"round.tonearest", metadata !"fpexcept.ignore") #[[ATTR0]]
85 ; CHECK-NEXT: [[TMP2:%.*]] = call double @foo.f64(double [[TMP1]], double [[TMP1]]) #[[ATTR0]]
86 ; CHECK-NEXT: ret double [[TMP1]]
88 %1 = call double @llvm.experimental.constrained.fmul.f64(double %a, double %b, metadata !"round.tonearest", metadata !"fpexcept.ignore") #0
89 %2 = call double @llvm.experimental.constrained.fmul.f64(double %a, double %b, metadata !"round.tonearest", metadata !"fpexcept.ignore") #0
90 %3 = call double @foo.f64(double %1, double %2) #0
94 define double @fmul_neginf(double %a, double %b) #0 {
95 ; CHECK-LABEL: @fmul_neginf(
96 ; CHECK-NEXT: [[TMP1:%.*]] = call double @llvm.experimental.constrained.fmul.f64(double [[A:%.*]], double [[B:%.*]], metadata !"round.downward", metadata !"fpexcept.ignore") #[[ATTR0]]
97 ; CHECK-NEXT: [[TMP2:%.*]] = call double @foo.f64(double [[TMP1]], double [[TMP1]]) #[[ATTR0]]
98 ; CHECK-NEXT: ret double [[TMP1]]
100 %1 = call double @llvm.experimental.constrained.fmul.f64(double %a, double %b, metadata !"round.downward", metadata !"fpexcept.ignore") #0
101 %2 = call double @llvm.experimental.constrained.fmul.f64(double %a, double %b, metadata !"round.downward", metadata !"fpexcept.ignore") #0
102 %3 = call double @foo.f64(double %1, double %2) #0
105 define double @fmul_maytrap(double %a, double %b) #0 {
106 ; CHECK-LABEL: @fmul_maytrap(
107 ; CHECK-NEXT: [[TMP1:%.*]] = call double @llvm.experimental.constrained.fmul.f64(double [[A:%.*]], double [[B:%.*]], metadata !"round.tonearest", metadata !"fpexcept.maytrap") #[[ATTR0]]
108 ; CHECK-NEXT: [[TMP2:%.*]] = call double @foo.f64(double [[TMP1]], double [[TMP1]]) #[[ATTR0]]
109 ; CHECK-NEXT: ret double [[TMP1]]
111 %1 = call double @llvm.experimental.constrained.fmul.f64(double %a, double %b, metadata !"round.tonearest", metadata !"fpexcept.maytrap") #0
112 %2 = call double @llvm.experimental.constrained.fmul.f64(double %a, double %b, metadata !"round.tonearest", metadata !"fpexcept.maytrap") #0
113 %3 = call double @foo.f64(double %1, double %2) #0
117 define double @fdiv_defaultenv(double %a, double %b) #0 {
118 ; CHECK-LABEL: @fdiv_defaultenv(
119 ; CHECK-NEXT: [[TMP1:%.*]] = call double @llvm.experimental.constrained.fdiv.f64(double [[A:%.*]], double [[B:%.*]], metadata !"round.tonearest", metadata !"fpexcept.ignore") #[[ATTR0]]
120 ; CHECK-NEXT: [[TMP2:%.*]] = call double @foo.f64(double [[TMP1]], double [[TMP1]]) #[[ATTR0]]
121 ; CHECK-NEXT: ret double [[TMP1]]
123 %1 = call double @llvm.experimental.constrained.fdiv.f64(double %a, double %b, metadata !"round.tonearest", metadata !"fpexcept.ignore") #0
124 %2 = call double @llvm.experimental.constrained.fdiv.f64(double %a, double %b, metadata !"round.tonearest", metadata !"fpexcept.ignore") #0
125 %3 = call double @foo.f64(double %1, double %2) #0
129 define double @fdiv_neginf(double %a, double %b) #0 {
130 ; CHECK-LABEL: @fdiv_neginf(
131 ; CHECK-NEXT: [[TMP1:%.*]] = call double @llvm.experimental.constrained.fdiv.f64(double [[A:%.*]], double [[B:%.*]], metadata !"round.downward", metadata !"fpexcept.ignore") #[[ATTR0]]
132 ; CHECK-NEXT: [[TMP2:%.*]] = call double @foo.f64(double [[TMP1]], double [[TMP1]]) #[[ATTR0]]
133 ; CHECK-NEXT: ret double [[TMP1]]
135 %1 = call double @llvm.experimental.constrained.fdiv.f64(double %a, double %b, metadata !"round.downward", metadata !"fpexcept.ignore") #0
136 %2 = call double @llvm.experimental.constrained.fdiv.f64(double %a, double %b, metadata !"round.downward", metadata !"fpexcept.ignore") #0
137 %3 = call double @foo.f64(double %1, double %2) #0
141 define double @fdiv_maytrap(double %a, double %b) #0 {
142 ; CHECK-LABEL: @fdiv_maytrap(
143 ; CHECK-NEXT: [[TMP1:%.*]] = call double @llvm.experimental.constrained.fdiv.f64(double [[A:%.*]], double [[B:%.*]], metadata !"round.tonearest", metadata !"fpexcept.maytrap") #[[ATTR0]]
144 ; CHECK-NEXT: [[TMP2:%.*]] = call double @foo.f64(double [[TMP1]], double [[TMP1]]) #[[ATTR0]]
145 ; CHECK-NEXT: ret double [[TMP1]]
147 %1 = call double @llvm.experimental.constrained.fdiv.f64(double %a, double %b, metadata !"round.tonearest", metadata !"fpexcept.maytrap") #0
148 %2 = call double @llvm.experimental.constrained.fdiv.f64(double %a, double %b, metadata !"round.tonearest", metadata !"fpexcept.maytrap") #0
149 %3 = call double @foo.f64(double %1, double %2) #0
153 define double @frem_defaultenv(double %a, double %b) #0 {
154 ; CHECK-LABEL: @frem_defaultenv(
155 ; CHECK-NEXT: [[TMP1:%.*]] = call double @llvm.experimental.constrained.frem.f64(double [[A:%.*]], double [[B:%.*]], metadata !"round.tonearest", metadata !"fpexcept.ignore") #[[ATTR0]]
156 ; CHECK-NEXT: [[TMP2:%.*]] = call double @foo.f64(double [[TMP1]], double [[TMP1]]) #[[ATTR0]]
157 ; CHECK-NEXT: ret double [[TMP1]]
159 %1 = call double @llvm.experimental.constrained.frem.f64(double %a, double %b, metadata !"round.tonearest", metadata !"fpexcept.ignore") #0
160 %2 = call double @llvm.experimental.constrained.frem.f64(double %a, double %b, metadata !"round.tonearest", metadata !"fpexcept.ignore") #0
161 %3 = call double @foo.f64(double %1, double %2) #0
165 define double @frem_neginf(double %a, double %b) #0 {
166 ; CHECK-LABEL: @frem_neginf(
167 ; CHECK-NEXT: [[TMP1:%.*]] = call double @llvm.experimental.constrained.frem.f64(double [[A:%.*]], double [[B:%.*]], metadata !"round.downward", metadata !"fpexcept.ignore") #[[ATTR0]]
168 ; CHECK-NEXT: [[TMP2:%.*]] = call double @foo.f64(double [[TMP1]], double [[TMP1]]) #[[ATTR0]]
169 ; CHECK-NEXT: ret double [[TMP1]]
171 %1 = call double @llvm.experimental.constrained.frem.f64(double %a, double %b, metadata !"round.downward", metadata !"fpexcept.ignore") #0
172 %2 = call double @llvm.experimental.constrained.frem.f64(double %a, double %b, metadata !"round.downward", metadata !"fpexcept.ignore") #0
173 %3 = call double @foo.f64(double %1, double %2) #0
177 define double @frem_maytrap(double %a, double %b) #0 {
178 ; CHECK-LABEL: @frem_maytrap(
179 ; CHECK-NEXT: [[TMP1:%.*]] = call double @llvm.experimental.constrained.frem.f64(double [[A:%.*]], double [[B:%.*]], metadata !"round.tonearest", metadata !"fpexcept.maytrap") #[[ATTR0]]
180 ; CHECK-NEXT: [[TMP2:%.*]] = call double @foo.f64(double [[TMP1]], double [[TMP1]]) #[[ATTR0]]
181 ; CHECK-NEXT: ret double [[TMP1]]
183 %1 = call double @llvm.experimental.constrained.frem.f64(double %a, double %b, metadata !"round.tonearest", metadata !"fpexcept.maytrap") #0
184 %2 = call double @llvm.experimental.constrained.frem.f64(double %a, double %b, metadata !"round.tonearest", metadata !"fpexcept.maytrap") #0
185 %3 = call double @foo.f64(double %1, double %2) #0
189 define i32 @fptoui_defaultenv(double %a) #0 {
190 ; CHECK-LABEL: @fptoui_defaultenv(
191 ; CHECK-NEXT: [[TMP1:%.*]] = call i32 @llvm.experimental.constrained.fptoui.i32.f64(double [[A:%.*]], metadata !"fpexcept.ignore") #[[ATTR0]]
192 ; CHECK-NEXT: [[TMP2:%.*]] = call i32 @bar.i32(i32 [[TMP1]], i32 [[TMP1]]) #[[ATTR0]]
193 ; CHECK-NEXT: ret i32 [[TMP1]]
195 %1 = call i32 @llvm.experimental.constrained.fptoui.i32.f64(double %a, metadata !"fpexcept.ignore") #0
196 %2 = call i32 @llvm.experimental.constrained.fptoui.i32.f64(double %a, metadata !"fpexcept.ignore") #0
197 %3 = call i32 @bar.i32(i32 %1, i32 %1) #0
201 define i32 @fptoui_maytrap(double %a) #0 {
202 ; CHECK-LABEL: @fptoui_maytrap(
203 ; CHECK-NEXT: [[TMP1:%.*]] = call i32 @llvm.experimental.constrained.fptoui.i32.f64(double [[A:%.*]], metadata !"fpexcept.maytrap") #[[ATTR0]]
204 ; CHECK-NEXT: [[TMP2:%.*]] = call i32 @bar.i32(i32 [[TMP1]], i32 [[TMP1]]) #[[ATTR0]]
205 ; CHECK-NEXT: ret i32 [[TMP1]]
207 %1 = call i32 @llvm.experimental.constrained.fptoui.i32.f64(double %a, metadata !"fpexcept.maytrap") #0
208 %2 = call i32 @llvm.experimental.constrained.fptoui.i32.f64(double %a, metadata !"fpexcept.maytrap") #0
209 %3 = call i32 @bar.i32(i32 %1, i32 %1) #0
213 define double @uitofp_defaultenv(i32 %a) #0 {
214 ; CHECK-LABEL: @uitofp_defaultenv(
215 ; CHECK-NEXT: [[TMP1:%.*]] = call double @llvm.experimental.constrained.uitofp.f64.i32(i32 [[A:%.*]], metadata !"round.tonearest", metadata !"fpexcept.ignore") #[[ATTR0]]
216 ; CHECK-NEXT: [[TMP2:%.*]] = call double @foo.f64(double [[TMP1]], double [[TMP1]]) #[[ATTR0]]
217 ; CHECK-NEXT: ret double [[TMP1]]
219 %1 = call double @llvm.experimental.constrained.uitofp.f64.i32(i32 %a, metadata !"round.tonearest", metadata !"fpexcept.ignore") #0
220 %2 = call double @llvm.experimental.constrained.uitofp.f64.i32(i32 %a, metadata !"round.tonearest", metadata !"fpexcept.ignore") #0
221 %3 = call double @foo.f64(double %1, double %1) #0
225 define double @uitofp_neginf(i32 %a) #0 {
226 ; CHECK-LABEL: @uitofp_neginf(
227 ; CHECK-NEXT: [[TMP1:%.*]] = call double @llvm.experimental.constrained.uitofp.f64.i32(i32 [[A:%.*]], metadata !"round.downward", metadata !"fpexcept.ignore") #[[ATTR0]]
228 ; CHECK-NEXT: [[TMP2:%.*]] = call double @foo.f64(double [[TMP1]], double [[TMP1]]) #[[ATTR0]]
229 ; CHECK-NEXT: ret double [[TMP1]]
231 %1 = call double @llvm.experimental.constrained.uitofp.f64.i32(i32 %a, metadata !"round.downward", metadata !"fpexcept.ignore") #0
232 %2 = call double @llvm.experimental.constrained.uitofp.f64.i32(i32 %a, metadata !"round.downward", metadata !"fpexcept.ignore") #0
233 %3 = call double @foo.f64(double %1, double %1) #0
237 define double @uitofp_maytrap(i32 %a) #0 {
238 ; CHECK-LABEL: @uitofp_maytrap(
239 ; CHECK-NEXT: [[TMP1:%.*]] = call double @llvm.experimental.constrained.uitofp.f64.i32(i32 [[A:%.*]], metadata !"round.tonearest", metadata !"fpexcept.maytrap") #[[ATTR0]]
240 ; CHECK-NEXT: [[TMP2:%.*]] = call double @foo.f64(double [[TMP1]], double [[TMP1]]) #[[ATTR0]]
241 ; CHECK-NEXT: ret double [[TMP1]]
243 %1 = call double @llvm.experimental.constrained.uitofp.f64.i32(i32 %a, metadata !"round.tonearest", metadata !"fpexcept.maytrap") #0
244 %2 = call double @llvm.experimental.constrained.uitofp.f64.i32(i32 %a, metadata !"round.tonearest", metadata !"fpexcept.maytrap") #0
245 %3 = call double @foo.f64(double %1, double %1) #0
249 define i32 @fptosi_defaultenv(double %a) #0 {
250 ; CHECK-LABEL: @fptosi_defaultenv(
251 ; CHECK-NEXT: [[TMP1:%.*]] = call i32 @llvm.experimental.constrained.fptosi.i32.f64(double [[A:%.*]], metadata !"fpexcept.ignore") #[[ATTR0]]
252 ; CHECK-NEXT: [[TMP2:%.*]] = call i32 @bar.i32(i32 [[TMP1]], i32 [[TMP1]]) #[[ATTR0]]
253 ; CHECK-NEXT: ret i32 [[TMP1]]
255 %1 = call i32 @llvm.experimental.constrained.fptosi.i32.f64(double %a, metadata !"fpexcept.ignore") #0
256 %2 = call i32 @llvm.experimental.constrained.fptosi.i32.f64(double %a, metadata !"fpexcept.ignore") #0
257 %3 = call i32 @bar.i32(i32 %1, i32 %1) #0
261 define i32 @fptosi_maytrap(double %a) #0 {
262 ; CHECK-LABEL: @fptosi_maytrap(
263 ; CHECK-NEXT: [[TMP1:%.*]] = call i32 @llvm.experimental.constrained.fptosi.i32.f64(double [[A:%.*]], metadata !"fpexcept.maytrap") #[[ATTR0]]
264 ; CHECK-NEXT: [[TMP2:%.*]] = call i32 @bar.i32(i32 [[TMP1]], i32 [[TMP1]]) #[[ATTR0]]
265 ; CHECK-NEXT: ret i32 [[TMP1]]
267 %1 = call i32 @llvm.experimental.constrained.fptosi.i32.f64(double %a, metadata !"fpexcept.maytrap") #0
268 %2 = call i32 @llvm.experimental.constrained.fptosi.i32.f64(double %a, metadata !"fpexcept.maytrap") #0
269 %3 = call i32 @bar.i32(i32 %1, i32 %1) #0
273 define double @sitofp_defaultenv(i32 %a) #0 {
274 ; CHECK-LABEL: @sitofp_defaultenv(
275 ; CHECK-NEXT: [[TMP1:%.*]] = call double @llvm.experimental.constrained.sitofp.f64.i32(i32 [[A:%.*]], metadata !"round.tonearest", metadata !"fpexcept.ignore") #[[ATTR0]]
276 ; CHECK-NEXT: [[TMP2:%.*]] = call double @foo.f64(double [[TMP1]], double [[TMP1]]) #[[ATTR0]]
277 ; CHECK-NEXT: ret double [[TMP1]]
279 %1 = call double @llvm.experimental.constrained.sitofp.f64.i32(i32 %a, metadata !"round.tonearest", metadata !"fpexcept.ignore") #0
280 %2 = call double @llvm.experimental.constrained.sitofp.f64.i32(i32 %a, metadata !"round.tonearest", metadata !"fpexcept.ignore") #0
281 %3 = call double @foo.f64(double %1, double %1) #0
285 define double @sitofp_neginf(i32 %a) #0 {
286 ; CHECK-LABEL: @sitofp_neginf(
287 ; CHECK-NEXT: [[TMP1:%.*]] = call double @llvm.experimental.constrained.sitofp.f64.i32(i32 [[A:%.*]], metadata !"round.downward", metadata !"fpexcept.ignore") #[[ATTR0]]
288 ; CHECK-NEXT: [[TMP2:%.*]] = call double @foo.f64(double [[TMP1]], double [[TMP1]]) #[[ATTR0]]
289 ; CHECK-NEXT: ret double [[TMP1]]
291 %1 = call double @llvm.experimental.constrained.sitofp.f64.i32(i32 %a, metadata !"round.downward", metadata !"fpexcept.ignore") #0
292 %2 = call double @llvm.experimental.constrained.sitofp.f64.i32(i32 %a, metadata !"round.downward", metadata !"fpexcept.ignore") #0
293 %3 = call double @foo.f64(double %1, double %1) #0
297 define double @sitofp_maytrap(i32 %a) #0 {
298 ; CHECK-LABEL: @sitofp_maytrap(
299 ; CHECK-NEXT: [[TMP1:%.*]] = call double @llvm.experimental.constrained.sitofp.f64.i32(i32 [[A:%.*]], metadata !"round.tonearest", metadata !"fpexcept.maytrap") #[[ATTR0]]
300 ; CHECK-NEXT: [[TMP2:%.*]] = call double @foo.f64(double [[TMP1]], double [[TMP1]]) #[[ATTR0]]
301 ; CHECK-NEXT: ret double [[TMP1]]
303 %1 = call double @llvm.experimental.constrained.sitofp.f64.i32(i32 %a, metadata !"round.tonearest", metadata !"fpexcept.maytrap") #0
304 %2 = call double @llvm.experimental.constrained.sitofp.f64.i32(i32 %a, metadata !"round.tonearest", metadata !"fpexcept.maytrap") #0
305 %3 = call double @foo.f64(double %1, double %1) #0
309 define i1 @fcmp_defaultenv(double %a, double %b) #0 {
310 ; CHECK-LABEL: @fcmp_defaultenv(
311 ; CHECK-NEXT: [[TMP1:%.*]] = call i1 @llvm.experimental.constrained.fcmp.f64(double [[A:%.*]], double [[B:%.*]], metadata !"oeq", metadata !"fpexcept.ignore") #[[ATTR0]]
312 ; CHECK-NEXT: [[TMP2:%.*]] = zext i1 [[TMP1]] to i32
313 ; CHECK-NEXT: [[TMP3:%.*]] = call i32 @bar.i32(i32 [[TMP2]], i32 [[TMP2]]) #[[ATTR0]]
314 ; CHECK-NEXT: ret i1 [[TMP1]]
316 %1 = call i1 @llvm.experimental.constrained.fcmp.i1.f64(double %a, double %b, metadata !"oeq", metadata !"fpexcept.ignore") #0
317 %2 = call i1 @llvm.experimental.constrained.fcmp.i1.f64(double %a, double %b, metadata !"oeq", metadata !"fpexcept.ignore") #0
318 %3 = zext i1 %1 to i32
319 %4 = zext i1 %2 to i32
320 %5 = call i32 @bar.i32(i32 %3, i32 %4) #0
324 define i1 @fcmp_maytrap(double %a, double %b) #0 {
325 ; CHECK-LABEL: @fcmp_maytrap(
326 ; CHECK-NEXT: [[TMP1:%.*]] = call i1 @llvm.experimental.constrained.fcmp.f64(double [[A:%.*]], double [[B:%.*]], metadata !"oeq", metadata !"fpexcept.maytrap") #[[ATTR0]]
327 ; CHECK-NEXT: [[TMP2:%.*]] = zext i1 [[TMP1]] to i32
328 ; CHECK-NEXT: [[TMP3:%.*]] = call i32 @bar.i32(i32 [[TMP2]], i32 [[TMP2]]) #[[ATTR0]]
329 ; CHECK-NEXT: ret i1 [[TMP1]]
331 %1 = call i1 @llvm.experimental.constrained.fcmp.i1.f64(double %a, double %b, metadata !"oeq", metadata !"fpexcept.maytrap") #0
332 %2 = call i1 @llvm.experimental.constrained.fcmp.i1.f64(double %a, double %b, metadata !"oeq", metadata !"fpexcept.maytrap") #0
333 %3 = zext i1 %1 to i32
334 %4 = zext i1 %2 to i32
335 %5 = call i32 @bar.i32(i32 %3, i32 %4) #0
339 define i1 @fcmps_defaultenv(double %a, double %b) #0 {
340 ; CHECK-LABEL: @fcmps_defaultenv(
341 ; CHECK-NEXT: [[TMP1:%.*]] = call i1 @llvm.experimental.constrained.fcmps.f64(double [[A:%.*]], double [[B:%.*]], metadata !"oeq", metadata !"fpexcept.ignore") #[[ATTR0]]
342 ; CHECK-NEXT: [[TMP2:%.*]] = zext i1 [[TMP1]] to i32
343 ; CHECK-NEXT: [[TMP3:%.*]] = call i32 @bar.i32(i32 [[TMP2]], i32 [[TMP2]]) #[[ATTR0]]
344 ; CHECK-NEXT: ret i1 [[TMP1]]
346 %1 = call i1 @llvm.experimental.constrained.fcmps.i1.f64(double %a, double %b, metadata !"oeq", metadata !"fpexcept.ignore") #0
347 %2 = call i1 @llvm.experimental.constrained.fcmps.i1.f64(double %a, double %b, metadata !"oeq", metadata !"fpexcept.ignore") #0
348 %3 = zext i1 %1 to i32
349 %4 = zext i1 %2 to i32
350 %5 = call i32 @bar.i32(i32 %3, i32 %4) #0
354 define i1 @fcmps_maytrap(double %a, double %b) #0 {
355 ; CHECK-LABEL: @fcmps_maytrap(
356 ; CHECK-NEXT: [[TMP1:%.*]] = call i1 @llvm.experimental.constrained.fcmps.f64(double [[A:%.*]], double [[B:%.*]], metadata !"oeq", metadata !"fpexcept.maytrap") #[[ATTR0]]
357 ; CHECK-NEXT: [[TMP2:%.*]] = zext i1 [[TMP1]] to i32
358 ; CHECK-NEXT: [[TMP3:%.*]] = call i32 @bar.i32(i32 [[TMP2]], i32 [[TMP2]]) #[[ATTR0]]
359 ; CHECK-NEXT: ret i1 [[TMP1]]
361 %1 = call i1 @llvm.experimental.constrained.fcmps.i1.f64(double %a, double %b, metadata !"oeq", metadata !"fpexcept.maytrap") #0
362 %2 = call i1 @llvm.experimental.constrained.fcmps.i1.f64(double %a, double %b, metadata !"oeq", metadata !"fpexcept.maytrap") #0
363 %3 = zext i1 %1 to i32
364 %4 = zext i1 %2 to i32
365 %5 = call i32 @bar.i32(i32 %3, i32 %4) #0
369 attributes #0 = { strictfp }
371 declare void @arbitraryfunc() #0
372 declare double @foo.f64(double, double) #0
373 declare i32 @bar.i32(i32, i32) #0
375 declare double @llvm.experimental.constrained.fadd.f64(double, double, metadata, metadata)
376 declare double @llvm.experimental.constrained.fsub.f64(double, double, metadata, metadata)
377 declare double @llvm.experimental.constrained.fmul.f64(double, double, metadata, metadata)
378 declare double @llvm.experimental.constrained.fdiv.f64(double, double, metadata, metadata)
379 declare double @llvm.experimental.constrained.frem.f64(double, double, metadata, metadata)
380 declare i32 @llvm.experimental.constrained.fptoui.i32.f64(double, metadata)
381 declare double @llvm.experimental.constrained.uitofp.f64.i32(i32, metadata, metadata)
382 declare i32 @llvm.experimental.constrained.fptosi.i32.f64(double, metadata)
383 declare double @llvm.experimental.constrained.sitofp.f64.i32(i32, metadata, metadata)
384 declare i1 @llvm.experimental.constrained.fcmp.i1.f64(double, double, metadata, metadata)
385 declare i1 @llvm.experimental.constrained.fcmps.i1.f64(double, double, metadata, metadata)