[llvm] [NFC][InstSimplify] Refactor fminmax-folds.ll test (PR #160504)
via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 24 04:18:21 PDT 2025
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-llvm-transforms
Author: Lewis Crawford (LewisCrawford)
<details>
<summary>Changes</summary>
Refactor all the tests in `fminmax-folds.ll` so that they are grouped by optimization, rather than by intrinsic.
Instead of calling 1 intrinsic per function, each function now tests all 6 variants of the intrinsic. Results are stored to named pointers to maintain readability in this more compact form. This makes it much easier to compare the outputs from each intrinsic, rather than having them scattered in different functions in different parts of the file. It is also much more compact, so despite adding >50% more tests, the file is ~500 lines shorter.
The tests added include:
* Adding `maximumnum` and `minimumnum` everywhere (currently not optimized, but added as a baseline for future optimizations in #<!-- -->139581).
* Adding separate tests for SNaN and QNaN (as a baseline for correctness improvements in #<!-- -->139581 )
* Adding tests for scalable vectors
* Increasing the variety of types used in various tests by using more f16, f64, and vector types in tests.
The only coverage removed is for tests with undef (only poison is now tested for).
Overall, this refactor should increase coverage, improve readability with more comments and clear section headers, and make the tests much more compact and easier to review in #<!-- -->139581 by providing a clear baseline for each intrinsic's current behaviour.
---
Patch is 104.02 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/160504.diff
1 Files Affected:
- (modified) llvm/test/Transforms/InstSimplify/fminmax-folds.ll (+850-1384)
``````````diff
diff --git a/llvm/test/Transforms/InstSimplify/fminmax-folds.ll b/llvm/test/Transforms/InstSimplify/fminmax-folds.ll
index fff6cfd8a3b4b..26b51146057e9 100644
--- a/llvm/test/Transforms/InstSimplify/fminmax-folds.ll
+++ b/llvm/test/Transforms/InstSimplify/fminmax-folds.ll
@@ -1,1388 +1,854 @@
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt < %s -passes=instsimplify -S | FileCheck %s
-declare half @llvm.minimum.f16(half, half)
-declare half @llvm.maximum.f16(half, half)
-
-declare float @llvm.minnum.f32(float, float)
-declare float @llvm.maxnum.f32(float, float)
-declare float @llvm.minimum.f32(float, float)
-declare float @llvm.maximum.f32(float, float)
-declare <2 x float> @llvm.minnum.v2f32(<2 x float>, <2 x float>)
-declare <2 x float> @llvm.maxnum.v2f32(<2 x float>, <2 x float>)
-declare <2 x float> @llvm.minimum.v2f32(<2 x float>, <2 x float>)
-declare <2 x float> @llvm.maximum.v2f32(<2 x float>, <2 x float>)
-
-declare double @llvm.minnum.f64(double, double)
-declare double @llvm.maxnum.f64(double, double)
-declare <2 x double> @llvm.minnum.v2f64(<2 x double>, <2 x double>)
-declare <2 x double> @llvm.maxnum.v2f64(<2 x double>, <2 x double>)
-declare double @llvm.minimum.f64(double, double)
-declare double @llvm.maximum.f64(double, double)
-declare <2 x double> @llvm.minimum.v2f64(<2 x double>, <2 x double>)
-declare <2 x double> @llvm.maximum.v2f64(<2 x double>, <2 x double>)
-
-define float @test_minnum_const_nan(float %x) {
-; CHECK-LABEL: @test_minnum_const_nan(
-; CHECK-NEXT: ret float [[X:%.*]]
-;
- %r = call float @llvm.minnum.f32(float %x, float 0x7fff000000000000)
- ret float %r
-}
-
-define float @test_maxnum_const_nan(float %x) {
-; CHECK-LABEL: @test_maxnum_const_nan(
-; CHECK-NEXT: ret float [[X:%.*]]
-;
- %r = call float @llvm.maxnum.f32(float %x, float 0x7fff000000000000)
- ret float %r
-}
-
-define float @test_maximum_const_nan(float %x) {
-; CHECK-LABEL: @test_maximum_const_nan(
-; CHECK-NEXT: ret float 0x7FFF000000000000
-;
- %r = call float @llvm.maximum.f32(float %x, float 0x7fff000000000000)
- ret float %r
-}
-
-define float @test_minimum_const_nan(float %x) {
-; CHECK-LABEL: @test_minimum_const_nan(
-; CHECK-NEXT: ret float 0x7FFF000000000000
-;
- %r = call float @llvm.minimum.f32(float %x, float 0x7fff000000000000)
- ret float %r
-}
-
-define float @test_minnum_const_inf(float %x) {
-; CHECK-LABEL: @test_minnum_const_inf(
-; CHECK-NEXT: [[R:%.*]] = call float @llvm.minnum.f32(float [[X:%.*]], float 0x7FF0000000000000)
-; CHECK-NEXT: ret float [[R]]
-;
- %r = call float @llvm.minnum.f32(float %x, float 0x7ff0000000000000)
- ret float %r
-}
-
-define float @test_maxnum_const_inf(float %x) {
-; CHECK-LABEL: @test_maxnum_const_inf(
-; CHECK-NEXT: ret float 0x7FF0000000000000
-;
- %r = call float @llvm.maxnum.f32(float %x, float 0x7ff0000000000000)
- ret float %r
-}
-
-define float @test_maximum_const_inf(float %x) {
-; CHECK-LABEL: @test_maximum_const_inf(
-; CHECK-NEXT: [[R:%.*]] = call float @llvm.maximum.f32(float [[X:%.*]], float 0x7FF0000000000000)
-; CHECK-NEXT: ret float [[R]]
-;
- %r = call float @llvm.maximum.f32(float %x, float 0x7ff0000000000000)
- ret float %r
-}
-
-define float @test_minimum_const_inf(float %x) {
-; CHECK-LABEL: @test_minimum_const_inf(
-; CHECK-NEXT: ret float [[X:%.*]]
-;
- %r = call float @llvm.minimum.f32(float %x, float 0x7ff0000000000000)
- ret float %r
-}
-
-define float @test_minnum_const_neg_inf(float %x) {
-; CHECK-LABEL: @test_minnum_const_neg_inf(
-; CHECK-NEXT: ret float 0xFFF0000000000000
-;
- %r = call float @llvm.minnum.f32(float %x, float 0xfff0000000000000)
- ret float %r
-}
-
-define float @test_maxnum_const_neg_inf(float %x) {
-; CHECK-LABEL: @test_maxnum_const_neg_inf(
-; CHECK-NEXT: [[R:%.*]] = call float @llvm.maxnum.f32(float [[X:%.*]], float 0xFFF0000000000000)
-; CHECK-NEXT: ret float [[R]]
-;
- %r = call float @llvm.maxnum.f32(float %x, float 0xfff0000000000000)
- ret float %r
-}
-
-define float @test_maximum_const_neg_inf(float %x) {
-; CHECK-LABEL: @test_maximum_const_neg_inf(
-; CHECK-NEXT: ret float [[X:%.*]]
-;
- %r = call float @llvm.maximum.f32(float %x, float 0xfff0000000000000)
- ret float %r
-}
-
-define float @test_minimum_const_neg_inf(float %x) {
-; CHECK-LABEL: @test_minimum_const_neg_inf(
-; CHECK-NEXT: [[R:%.*]] = call float @llvm.minimum.f32(float [[X:%.*]], float 0xFFF0000000000000)
-; CHECK-NEXT: ret float [[R]]
-;
- %r = call float @llvm.minimum.f32(float %x, float 0xfff0000000000000)
- ret float %r
-}
-
-define float @test_minnum_const_inf_nnan(float %x) {
-; CHECK-LABEL: @test_minnum_const_inf_nnan(
-; CHECK-NEXT: ret float [[X:%.*]]
-;
- %r = call nnan float @llvm.minnum.f32(float %x, float 0x7ff0000000000000)
- ret float %r
-}
-
-define float @test_maxnum_const_inf_nnan(float %x) {
-; CHECK-LABEL: @test_maxnum_const_inf_nnan(
-; CHECK-NEXT: ret float 0x7FF0000000000000
-;
- %r = call nnan float @llvm.maxnum.f32(float %x, float 0x7ff0000000000000)
- ret float %r
-}
-
-define float @test_maximum_const_inf_nnan(float %x) {
-; CHECK-LABEL: @test_maximum_const_inf_nnan(
-; CHECK-NEXT: ret float 0x7FF0000000000000
-;
- %r = call nnan float @llvm.maximum.f32(float %x, float 0x7ff0000000000000)
- ret float %r
-}
-
-define float @test_minimum_const_inf_nnan(float %x) {
-; CHECK-LABEL: @test_minimum_const_inf_nnan(
-; CHECK-NEXT: ret float [[X:%.*]]
-;
- %r = call nnan float @llvm.minimum.f32(float %x, float 0x7ff0000000000000)
- ret float %r
-}
-
-define float @test_minnum_const_inf_nnan_comm(float %x) {
-; CHECK-LABEL: @test_minnum_const_inf_nnan_comm(
-; CHECK-NEXT: ret float [[X:%.*]]
-;
- %r = call nnan float @llvm.minnum.f32(float 0x7ff0000000000000, float %x)
- ret float %r
-}
-
-define float @test_maxnum_const_inf_nnan_comm(float %x) {
-; CHECK-LABEL: @test_maxnum_const_inf_nnan_comm(
-; CHECK-NEXT: ret float 0x7FF0000000000000
-;
- %r = call nnan float @llvm.maxnum.f32(float 0x7ff0000000000000, float %x)
- ret float %r
-}
-
-define float @test_maximum_const_inf_nnan_comm(float %x) {
-; CHECK-LABEL: @test_maximum_const_inf_nnan_comm(
-; CHECK-NEXT: ret float 0x7FF0000000000000
-;
- %r = call nnan float @llvm.maximum.f32(float 0x7ff0000000000000, float %x)
- ret float %r
-}
-
-define float @test_minimum_const_inf_nnan_comm(float %x) {
-; CHECK-LABEL: @test_minimum_const_inf_nnan_comm(
-; CHECK-NEXT: ret float [[X:%.*]]
-;
- %r = call nnan float @llvm.minimum.f32(float 0x7ff0000000000000, float %x)
- ret float %r
-}
-
-define <2 x float> @test_minnum_const_inf_nnan_comm_vec(<2 x float> %x) {
-; CHECK-LABEL: @test_minnum_const_inf_nnan_comm_vec(
-; CHECK-NEXT: ret <2 x float> [[X:%.*]]
-;
- %r = call nnan <2 x float> @llvm.minnum.v2f32(<2 x float> <float 0x7ff0000000000000, float 0x7ff0000000000000>, <2 x float> %x)
- ret <2 x float> %r
-}
-
-define <2 x float> @test_maxnum_const_inf_nnan_comm_vec(<2 x float> %x) {
-; CHECK-LABEL: @test_maxnum_const_inf_nnan_comm_vec(
-; CHECK-NEXT: ret <2 x float> splat (float 0x7FF0000000000000)
-;
- %r = call nnan <2 x float> @llvm.maxnum.v2f32(<2 x float> <float 0x7ff0000000000000, float 0x7ff0000000000000>, <2 x float> %x)
- ret <2 x float> %r
-}
-
-define <2 x float> @test_maximum_const_inf_nnan_comm_vec(<2 x float> %x) {
-; CHECK-LABEL: @test_maximum_const_inf_nnan_comm_vec(
-; CHECK-NEXT: ret <2 x float> splat (float 0x7FF0000000000000)
-;
- %r = call nnan <2 x float> @llvm.maximum.v2f32(<2 x float> <float 0x7ff0000000000000, float 0x7ff0000000000000>, <2 x float> %x)
- ret <2 x float> %r
-}
-
-define <2 x float> @test_minimum_const_inf_nnan_comm_vec(<2 x float> %x) {
-; CHECK-LABEL: @test_minimum_const_inf_nnan_comm_vec(
-; CHECK-NEXT: ret <2 x float> [[X:%.*]]
-;
- %r = call nnan <2 x float> @llvm.minimum.v2f32(<2 x float> <float 0x7ff0000000000000, float 0x7ff0000000000000>, <2 x float> %x)
- ret <2 x float> %r
-}
-
-define float @test_minnum_const_neg_inf_nnan(float %x) {
-; CHECK-LABEL: @test_minnum_const_neg_inf_nnan(
-; CHECK-NEXT: ret float 0xFFF0000000000000
-;
- %r = call nnan float @llvm.minnum.f32(float %x, float 0xfff0000000000000)
- ret float %r
-}
-
-define float @test_maxnum_const_neg_inf_nnan(float %x) {
-; CHECK-LABEL: @test_maxnum_const_neg_inf_nnan(
-; CHECK-NEXT: ret float [[X:%.*]]
-;
- %r = call nnan float @llvm.maxnum.f32(float %x, float 0xfff0000000000000)
- ret float %r
-}
-
-define float @test_maximum_const_neg_inf_nnan(float %x) {
-; CHECK-LABEL: @test_maximum_const_neg_inf_nnan(
-; CHECK-NEXT: ret float [[X:%.*]]
-;
- %r = call nnan float @llvm.maximum.f32(float %x, float 0xfff0000000000000)
- ret float %r
-}
-
-define float @test_minimum_const_neg_inf_nnan(float %x) {
-; CHECK-LABEL: @test_minimum_const_neg_inf_nnan(
-; CHECK-NEXT: ret float 0xFFF0000000000000
-;
- %r = call nnan float @llvm.minimum.f32(float %x, float 0xfff0000000000000)
- ret float %r
-}
-
-define float @test_minnum_const_max(float %x) {
-; CHECK-LABEL: @test_minnum_const_max(
-; CHECK-NEXT: [[R:%.*]] = call float @llvm.minnum.f32(float [[X:%.*]], float 0x47EFFFFFE0000000)
-; CHECK-NEXT: ret float [[R]]
-;
- %r = call float @llvm.minnum.f32(float %x, float 0x47efffffe0000000)
- ret float %r
-}
-
-define float @test_maxnum_const_max(float %x) {
-; CHECK-LABEL: @test_maxnum_const_max(
-; CHECK-NEXT: [[R:%.*]] = call float @llvm.maxnum.f32(float [[X:%.*]], float 0x47EFFFFFE0000000)
-; CHECK-NEXT: ret float [[R]]
-;
- %r = call float @llvm.maxnum.f32(float %x, float 0x47efffffe0000000)
- ret float %r
-}
-
-define float @test_maximum_const_max(float %x) {
-; CHECK-LABEL: @test_maximum_const_max(
-; CHECK-NEXT: [[R:%.*]] = call float @llvm.maximum.f32(float [[X:%.*]], float 0x47EFFFFFE0000000)
-; CHECK-NEXT: ret float [[R]]
-;
- %r = call float @llvm.maximum.f32(float %x, float 0x47efffffe0000000)
- ret float %r
-}
-
-define float @test_minimum_const_max(float %x) {
-; CHECK-LABEL: @test_minimum_const_max(
-; CHECK-NEXT: [[R:%.*]] = call float @llvm.minimum.f32(float [[X:%.*]], float 0x47EFFFFFE0000000)
-; CHECK-NEXT: ret float [[R]]
-;
- %r = call float @llvm.minimum.f32(float %x, float 0x47efffffe0000000)
- ret float %r
-}
-
-define float @test_minnum_const_neg_max(float %x) {
-; CHECK-LABEL: @test_minnum_const_neg_max(
-; CHECK-NEXT: [[R:%.*]] = call float @llvm.minnum.f32(float [[X:%.*]], float 0xC7EFFFFFE0000000)
-; CHECK-NEXT: ret float [[R]]
-;
- %r = call float @llvm.minnum.f32(float %x, float 0xc7efffffe0000000)
- ret float %r
-}
-
-define float @test_maxnum_const_neg_max(float %x) {
-; CHECK-LABEL: @test_maxnum_const_neg_max(
-; CHECK-NEXT: [[R:%.*]] = call float @llvm.maxnum.f32(float [[X:%.*]], float 0xC7EFFFFFE0000000)
-; CHECK-NEXT: ret float [[R]]
-;
- %r = call float @llvm.maxnum.f32(float %x, float 0xc7efffffe0000000)
- ret float %r
-}
-
-define float @test_maximum_const_neg_max(float %x) {
-; CHECK-LABEL: @test_maximum_const_neg_max(
-; CHECK-NEXT: [[R:%.*]] = call float @llvm.maximum.f32(float [[X:%.*]], float 0xC7EFFFFFE0000000)
-; CHECK-NEXT: ret float [[R]]
-;
- %r = call float @llvm.maximum.f32(float %x, float 0xc7efffffe0000000)
- ret float %r
-}
-
-define float @test_minimum_const_neg_max(float %x) {
-; CHECK-LABEL: @test_minimum_const_neg_max(
-; CHECK-NEXT: [[R:%.*]] = call float @llvm.minimum.f32(float [[X:%.*]], float 0xC7EFFFFFE0000000)
-; CHECK-NEXT: ret float [[R]]
-;
- %r = call float @llvm.minimum.f32(float %x, float 0xc7efffffe0000000)
- ret float %r
-}
-
-define float @test_minnum_const_max_ninf(float %x) {
-; CHECK-LABEL: @test_minnum_const_max_ninf(
-; CHECK-NEXT: [[R:%.*]] = call ninf float @llvm.minnum.f32(float [[X:%.*]], float 0x47EFFFFFE0000000)
-; CHECK-NEXT: ret float [[R]]
-;
- %r = call ninf float @llvm.minnum.f32(float %x, float 0x47efffffe0000000)
- ret float %r
-}
-
-define float @test_maxnum_const_max_ninf(float %x) {
-; CHECK-LABEL: @test_maxnum_const_max_ninf(
-; CHECK-NEXT: ret float 0x47EFFFFFE0000000
-;
- %r = call ninf float @llvm.maxnum.f32(float %x, float 0x47efffffe0000000)
- ret float %r
-}
-
-define float @test_maximum_const_max_ninf(float %x) {
-; CHECK-LABEL: @test_maximum_const_max_ninf(
-; CHECK-NEXT: [[R:%.*]] = call ninf float @llvm.maximum.f32(float [[X:%.*]], float 0x47EFFFFFE0000000)
-; CHECK-NEXT: ret float [[R]]
-;
- %r = call ninf float @llvm.maximum.f32(float %x, float 0x47efffffe0000000)
- ret float %r
-}
-
-define float @test_minimum_const_max_ninf(float %x) {
-; CHECK-LABEL: @test_minimum_const_max_ninf(
-; CHECK-NEXT: ret float [[X:%.*]]
-;
- %r = call ninf float @llvm.minimum.f32(float %x, float 0x47efffffe0000000)
- ret float %r
-}
-
-define float @test_minnum_const_neg_max_ninf(float %x) {
-; CHECK-LABEL: @test_minnum_const_neg_max_ninf(
-; CHECK-NEXT: ret float 0xC7EFFFFFE0000000
-;
- %r = call ninf float @llvm.minnum.f32(float %x, float 0xc7efffffe0000000)
- ret float %r
-}
-
-define float @test_maxnum_const_neg_max_ninf(float %x) {
-; CHECK-LABEL: @test_maxnum_const_neg_max_ninf(
-; CHECK-NEXT: [[R:%.*]] = call ninf float @llvm.maxnum.f32(float [[X:%.*]], float 0xC7EFFFFFE0000000)
-; CHECK-NEXT: ret float [[R]]
-;
- %r = call ninf float @llvm.maxnum.f32(float %x, float 0xc7efffffe0000000)
- ret float %r
-}
-
-define float @test_maximum_const_neg_max_ninf(float %x) {
-; CHECK-LABEL: @test_maximum_const_neg_max_ninf(
-; CHECK-NEXT: ret float [[X:%.*]]
-;
- %r = call ninf float @llvm.maximum.f32(float %x, float 0xc7efffffe0000000)
- ret float %r
-}
-
-define float @test_minimum_const_neg_max_ninf(float %x) {
-; CHECK-LABEL: @test_minimum_const_neg_max_ninf(
-; CHECK-NEXT: [[R:%.*]] = call ninf float @llvm.minimum.f32(float [[X:%.*]], float 0xC7EFFFFFE0000000)
-; CHECK-NEXT: ret float [[R]]
-;
- %r = call ninf float @llvm.minimum.f32(float %x, float 0xc7efffffe0000000)
- ret float %r
-}
-
-define float @test_minnum_const_max_nnan_ninf(float %x) {
-; CHECK-LABEL: @test_minnum_const_max_nnan_ninf(
-; CHECK-NEXT: ret float [[X:%.*]]
-;
- %r = call nnan ninf float @llvm.minnum.f32(float %x, float 0x47efffffe0000000)
- ret float %r
-}
-
-define float @test_maxnum_const_max_nnan_ninf(float %x) {
-; CHECK-LABEL: @test_maxnum_const_max_nnan_ninf(
-; CHECK-NEXT: ret float 0x47EFFFFFE0000000
-;
- %r = call nnan ninf float @llvm.maxnum.f32(float %x, float 0x47efffffe0000000)
- ret float %r
-}
-
-define float @test_maximum_const_max_nnan_ninf(float %x) {
-; CHECK-LABEL: @test_maximum_const_max_nnan_ninf(
-; CHECK-NEXT: ret float 0x47EFFFFFE0000000
-;
- %r = call nnan ninf float @llvm.maximum.f32(float %x, float 0x47efffffe0000000)
- ret float %r
-}
-
-define float @test_minimum_const_max_nnan_ninf(float %x) {
-; CHECK-LABEL: @test_minimum_const_max_nnan_ninf(
-; CHECK-NEXT: ret float [[X:%.*]]
-;
- %r = call nnan ninf float @llvm.minimum.f32(float %x, float 0x47efffffe0000000)
- ret float %r
-}
-
-define float @test_minnum_const_neg_max_nnan_ninf(float %x) {
-; CHECK-LABEL: @test_minnum_const_neg_max_nnan_ninf(
-; CHECK-NEXT: ret float 0xC7EFFFFFE0000000
-;
- %r = call nnan ninf float @llvm.minnum.f32(float %x, float 0xc7efffffe0000000)
- ret float %r
-}
-
-define float @test_maxnum_const_neg_max_nnan_ninf(float %x) {
-; CHECK-LABEL: @test_maxnum_const_neg_max_nnan_ninf(
-; CHECK-NEXT: ret float [[X:%.*]]
-;
- %r = call nnan ninf float @llvm.maxnum.f32(float %x, float 0xc7efffffe0000000)
- ret float %r
-}
-
-define float @test_maximum_const_neg_max_nnan_ninf(float %x) {
-; CHECK-LABEL: @test_maximum_const_neg_max_nnan_ninf(
-; CHECK-NEXT: ret float [[X:%.*]]
-;
- %r = call nnan ninf float @llvm.maximum.f32(float %x, float 0xc7efffffe0000000)
- ret float %r
-}
-
-define float @test_minimum_const_neg_max_nnan_ninf(float %x) {
-; CHECK-LABEL: @test_minimum_const_neg_max_nnan_ninf(
-; CHECK-NEXT: ret float 0xC7EFFFFFE0000000
-;
- %r = call nnan ninf float @llvm.minimum.f32(float %x, float 0xc7efffffe0000000)
- ret float %r
-}
-
-; From the LangRef for minnum/maxnum:
-; "If either operand is a NaN, returns the other non-NaN operand."
-
-define double @maxnum_nan_op0(double %x) {
-; CHECK-LABEL: @maxnum_nan_op0(
-; CHECK-NEXT: ret double [[X:%.*]]
-;
- %r = call double @llvm.maxnum.f64(double 0x7ff8000000000000, double %x)
- ret double %r
-}
-
-define double @maxnum_nan_op1(double %x) {
-; CHECK-LABEL: @maxnum_nan_op1(
-; CHECK-NEXT: ret double [[X:%.*]]
-;
- %r = call double @llvm.maxnum.f64(double %x, double 0x7ff800000000dead)
- ret double %r
-}
-
-define double @minnum_nan_op0(double %x) {
-; CHECK-LABEL: @minnum_nan_op0(
-; CHECK-NEXT: ret double [[X:%.*]]
-;
- %r = call double @llvm.minnum.f64(double 0x7ff8000dead00000, double %x)
- ret double %r
-}
-
-define double @minnum_nan_op1(double %x) {
-; CHECK-LABEL: @minnum_nan_op1(
-; CHECK-NEXT: ret double [[X:%.*]]
-;
- %r = call double @llvm.minnum.f64(double %x, double 0x7ff800dead00dead)
- ret double %r
-}
-
-define <2 x double> @maxnum_nan_op0_vec(<2 x double> %x) {
-; CHECK-LABEL: @maxnum_nan_op0_vec(
-; CHECK-NEXT: ret <2 x double> [[X:%.*]]
-;
- %r = call <2 x double> @llvm.maxnum.v2f64(<2 x double> <double 0x7ff8000000000000, double poison>, <2 x double> %x)
- ret <2 x double> %r
-}
-
-define <2 x double> @maxnum_nan_op1_vec(<2 x double> %x) {
-; CHECK-LABEL: @maxnum_nan_op1_vec(
-; CHECK-NEXT: ret <2 x double> [[X:%.*]]
-;
- %r = call <2 x double> @llvm.maxnum.v2f64(<2 x double> %x, <2 x double> <double 0x7ff800000000dead, double 0x7ff8ffffffffffff>)
- ret <2 x double> %r
-}
-
-define <2 x double> @minnum_nan_op0_vec(<2 x double> %x) {
-; CHECK-LABEL: @minnum_nan_op0_vec(
-; CHECK-NEXT: ret <2 x double> [[X:%.*]]
-;
- %r = call <2 x double> @llvm.minnum.v2f64(<2 x double> <double poison, double 0x7ff8000dead00000>, <2 x double> %x)
- ret <2 x double> %r
-}
-
-define <2 x double> @minnum_nan_op1_vec(<2 x double> %x) {
-; CHECK-LABEL: @minnum_nan_op1_vec(
-; CHECK-NEXT: ret <2 x double> [[X:%.*]]
-;
- %r = call <2 x double> @llvm.minnum.v2f64(<2 x double> %x, <2 x double> <double 0x7ff800dead00dead, double 0x7ff800dead00dead>)
- ret <2 x double> %r
-}
-
-define float @maxnum_undef_op1(float %x) {
-; CHECK-LABEL: @maxnum_undef_op1(
-; CHECK-NEXT: ret float [[X:%.*]]
-;
- %val = call float @llvm.maxnum.f32(float %x, float undef)
- ret float %val
-}
-
-define float @maxnum_poison_op1(float %x) {
-; CHECK-LABEL: @maxnum_poison_op1(
-; CHECK-NEXT: ret float [[X:%.*]]
-;
- %val = call float @llvm.maxnum.f32(float %x, float poison)
- ret float %val
-}
-
-define float @maxnum_undef_op0(float %x) {
-; CHECK-LABEL: @maxnum_undef_op0(
-; CHECK-NEXT: ret float [[X:%.*]]
-;
- %val = call float @llvm.maxnum.f32(float undef, float %x)
- ret float %val
-}
-
-define float @maxnum_poison_op0(float %x) {
-; CHECK-LABEL: @maxnum_poison_op0(
-; CHECK-NEXT: ret float [[X:%.*]]
-;
- %val = call float @llvm.maxnum.f32(float poison, float %x)
- ret float %val
-}
-
-define float @minnum_undef_op1(float %x) {
-; CHECK-LABEL: @minnum_undef_op1(
-; CHECK-NEXT: ret float [[X:%.*]]
-;
- %val = call float @llvm.minnum.f32(float %x, float undef)
- ret float %val
-}
-
-define float @minnum_poison_op1(float %x) {
-; CHECK-LABEL: @minnum_poison_op1(
-; CHECK-NEXT: ret float [[X:%.*]]
-;
- %val = call float @llvm.minnum.f32(float %x, float poison)
- ret float %val
-}
-
-define float @minnum_undef_op0(float %x) {
-; CHECK-LABEL: @minnum_undef_op0(
-; CHECK-NEXT: ret float [[X:%.*]]
-;
- %val = call float @llvm.minnum.f32(float undef, float %x)
- ret float %val
-}
-
-define float @minnum_poison_op0(float %x) {
-; CHECK-LABEL: @minnum_poison_op0(
-; CHECK-NEXT: ret float [[X:%.*]]
-;
- %val = call float @llvm.minnum.f32(float poison, float %x)
- ret float %val
-}
-
-define float @minnum_undef_undef(float %x) {
-; CHECK-LABEL: @minnum_undef_undef(
-; CHECK-NEXT: ret float undef
-;
- %val = call float @llvm.minnum.f32(float undef, float undef)
- ret float %val
-}
-
-define float @minnum_poison_undef(float %x) {
-; CHECK-LABEL: @minnum_poison_undef(
-; CHECK-NEXT: ret float undef
-;
- %val = call float @llvm.minnum.f32(float poison, float undef)
- ret float %val
-}
-
-define float @minnum_undef_poison(float %x) {
-; CHECK-LABEL: @minnum_undef_poison(
-; CHECK-NEXT: ret float poison
-;
- %val = call float @llvm.minnum.f32(float undef, flo...
[truncated]
``````````
</details>
https://github.com/llvm/llvm-project/pull/160504
More information about the llvm-commits
mailing list