@@ -260,3 +260,149 @@ body: |
260
260
%zext:_(<2 x s64>) = G_ZEXT %and(<2 x s1>)
261
261
$q0 = COPY %zext
262
262
...
263
+ ---
264
+ # fcmp (x, y) || fcmp (x, y) -> fcmp(x, y)
265
+ name : test_fcmp_or_fcmp_with_x_y
266
+ body : |
267
+ bb.1:
268
+ liveins: $x0, $x1
269
+ ; CHECK-LABEL: name: test_fcmp_or_fcmp_with_x_y
270
+ ; CHECK: liveins: $x0, $x1
271
+ ; CHECK-NEXT: {{ $}}
272
+ ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x0
273
+ ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x1
274
+ ; CHECK-NEXT: [[FCMP:%[0-9]+]]:_(s1) = G_FCMP floatpred(ueq), [[COPY]](s64), [[COPY1]]
275
+ ; CHECK-NEXT: %zext:_(s64) = G_ZEXT [[FCMP]](s1)
276
+ ; CHECK-NEXT: $x0 = COPY %zext(s64)
277
+ %0:_(s64) = COPY $x0
278
+ %1:_(s64) = COPY $x1
279
+ %cmp1:_(s1) = G_FCMP floatpred(oeq), %0(s64), %1
280
+ %cmp2:_(s1) = G_FCMP floatpred(uno), %0(s64), %1
281
+ %or:_(s1) = G_OR %cmp1, %cmp2
282
+ %zext:_(s64) = G_ZEXT %or(s1)
283
+ $x0 = COPY %zext
284
+ ...
285
+ ---
286
+ # fcmp (5, y) || fcmp (y, 5) -> fcmp(x, y)
287
+ name : test_fcmp_or_fcmp_with_5_y
288
+ body : |
289
+ bb.1:
290
+ liveins: $x0, $x1
291
+ ; CHECK-LABEL: name: test_fcmp_or_fcmp_with_5_y
292
+ ; CHECK: liveins: $x0, $x1
293
+ ; CHECK-NEXT: {{ $}}
294
+ ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x0
295
+ ; CHECK-NEXT: [[C:%[0-9]+]]:_(s64) = G_FCONSTANT double 5.000000e+00
296
+ ; CHECK-NEXT: [[FCMP:%[0-9]+]]:_(s1) = G_FCMP floatpred(une), [[COPY]](s64), [[C]]
297
+ ; CHECK-NEXT: %zext:_(s64) = G_ZEXT [[FCMP]](s1)
298
+ ; CHECK-NEXT: $x0 = COPY %zext(s64)
299
+ %0:_(s64) = COPY $x0
300
+ %1:_(s64) = COPY $x1
301
+ %2:_(s64) = G_FCONSTANT double 5.0
302
+ %cmp1:_(s1) = G_FCMP floatpred(one), %0(s64), %2
303
+ %cmp2:_(s1) = G_FCMP floatpred(uno), %0(s64), %2
304
+ %or:_(s1) = G_OR %cmp1, %cmp2
305
+ %zext:_(s64) = G_ZEXT %or(s1)
306
+ $x0 = COPY %zext
307
+ ...
308
+ ---
309
+ # fcmp (x, y) || fcmp (y, x) -> fcmp(x, y)
310
+ name : test_fcmp_or_fcmp_with_anti
311
+ body : |
312
+ bb.1:
313
+ liveins: $x0, $x1
314
+ ; CHECK-LABEL: name: test_fcmp_or_fcmp_with_anti
315
+ ; CHECK: liveins: $x0, $x1
316
+ ; CHECK-NEXT: {{ $}}
317
+ ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x0
318
+ ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x1
319
+ ; CHECK-NEXT: [[FCMP:%[0-9]+]]:_(s1) = G_FCMP floatpred(une), [[COPY1]](s64), [[COPY]]
320
+ ; CHECK-NEXT: %zext:_(s64) = G_ZEXT [[FCMP]](s1)
321
+ ; CHECK-NEXT: $x0 = COPY %zext(s64)
322
+ %0:_(s64) = COPY $x0
323
+ %1:_(s64) = COPY $x1
324
+ %cmp1:_(s1) = G_FCMP floatpred(one), %1(s64), %0
325
+ %cmp2:_(s1) = G_FCMP floatpred(uno), %0(s64), %1
326
+ %or:_(s1) = G_OR %cmp1, %cmp2
327
+ %zext:_(s64) = G_ZEXT %or(s1)
328
+ $x0 = COPY %zext
329
+ ...
330
+ ---
331
+ # fcmp (x, y) && fcmp (x, y) -> fcmp(x, y)
332
+ name : test_fcmp_and_fcmp_with_x_y
333
+ body : |
334
+ bb.1:
335
+ liveins: $x0, $x1
336
+ ; CHECK-LABEL: name: test_fcmp_and_fcmp_with_x_y
337
+ ; CHECK: liveins: $x0, $x1
338
+ ; CHECK-NEXT: {{ $}}
339
+ ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x0
340
+ ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x1
341
+ ; CHECK-NEXT: [[FCMP:%[0-9]+]]:_(s1) = G_FCMP floatpred(uno), [[COPY1]](s64), [[COPY]]
342
+ ; CHECK-NEXT: %zext:_(s64) = G_ZEXT [[FCMP]](s1)
343
+ ; CHECK-NEXT: $x0 = COPY %zext(s64)
344
+ %0:_(s64) = COPY $x0
345
+ %1:_(s64) = COPY $x1
346
+ %cmp1:_(s1) = G_FCMP floatpred(une), %1(s64), %0
347
+ %cmp2:_(s1) = G_FCMP floatpred(uno), %0(s64), %1
348
+ %and:_(s1) = G_AND %cmp1, %cmp2
349
+ %zext:_(s64) = G_ZEXT %and(s1)
350
+ $x0 = COPY %zext
351
+ ...
352
+ ---
353
+ # fcmp (x, y) && fcmp (x, y) -> fcmp(x, y)
354
+ name : test_fcmp_and_fcmp_with_x_y_multi_use
355
+ body : |
356
+ bb.1:
357
+ liveins: $x0, $x1
358
+ ; CHECK-LABEL: name: test_fcmp_and_fcmp_with_x_y_multi_use
359
+ ; CHECK: liveins: $x0, $x1
360
+ ; CHECK-NEXT: {{ $}}
361
+ ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x0
362
+ ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x1
363
+ ; CHECK-NEXT: %cmp1:_(s1) = G_FCMP floatpred(ogt), [[COPY1]](s64), [[COPY]]
364
+ ; CHECK-NEXT: %cmp2:_(s1) = G_FCMP floatpred(ugt), [[COPY]](s64), [[COPY1]]
365
+ ; CHECK-NEXT: %and:_(s1) = G_AND %cmp1, %cmp2
366
+ ; CHECK-NEXT: %zext:_(s64) = G_ZEXT %and(s1)
367
+ ; CHECK-NEXT: %zext2:_(s64) = G_ZEXT %and(s1)
368
+ ; CHECK-NEXT: $x0 = COPY %zext(s64)
369
+ ; CHECK-NEXT: $x2 = COPY %zext2(s64)
370
+ %0:_(s64) = COPY $x0
371
+ %1:_(s64) = COPY $x1
372
+ %cmp1:_(s1) = G_FCMP floatpred(ogt), %1(s64), %0
373
+ %cmp2:_(s1) = G_FCMP floatpred(ugt), %0(s64), %1
374
+ %and:_(s1) = G_AND %cmp1, %cmp2
375
+ %zext:_(s64) = G_ZEXT %and(s1)
376
+ %zext2:_(s64) = G_ZEXT %and(s1)
377
+ $x0 = COPY %zext
378
+ $x2 = COPY %zext2
379
+ ...
380
+ ---
381
+ # fcmp (x, y) && fcmp (x, y) -> fcmp(x, y)
382
+ name : test_fcmp_and_fcmp_with_vectors
383
+ body : |
384
+ bb.1:
385
+ liveins: $x0, $x1
386
+ ; CHECK-LABEL: name: test_fcmp_and_fcmp_with_vectors
387
+ ; CHECK: liveins: $x0, $x1
388
+ ; CHECK-NEXT: {{ $}}
389
+ ; CHECK-NEXT: [[C:%[0-9]+]]:_(s1) = G_CONSTANT i1 false
390
+ ; CHECK-NEXT: [[BUILD_VECTOR:%[0-9]+]]:_(<2 x s1>) = G_BUILD_VECTOR [[C]](s1), [[C]](s1)
391
+ ; CHECK-NEXT: %zext:_(<2 x s64>) = G_ZEXT [[BUILD_VECTOR]](<2 x s1>)
392
+ ; CHECK-NEXT: $q0 = COPY %zext(<2 x s64>)
393
+ %0:_(s64) = COPY $x0
394
+ %1:_(s64) = COPY $x1
395
+ %2:_(s64) = COPY $x2
396
+ %3:_(s64) = COPY $x3
397
+ %4:_(s64) = COPY $x4
398
+ %5:_(s64) = COPY $x5
399
+ %6:_(s64) = COPY $x6
400
+ %7:_(s64) = COPY $x7
401
+ %v8:_(<2 x s64>) = G_BUILD_VECTOR %0(s64), %1(s64)
402
+ %v9:_(<2 x s64>) = G_BUILD_VECTOR %2(s64), %3(s64)
403
+ %cmp1:_(<2 x s1>) = G_FCMP floatpred(oeq), %v8(<2 x s64>), %v9
404
+ %cmp2:_(<2 x s1>) = G_FCMP floatpred(olt), %v8(<2 x s64>), %v9
405
+ %and:_(<2 x s1>) = G_AND %cmp1, %cmp2
406
+ %zext:_(<2 x s64>) = G_ZEXT %and(<2 x s1>)
407
+ $q0 = COPY %zext
408
+ ...
0 commit comments