[llvm] d647e25 - InstSimplify: Add basic folding of llvm.is.fpclass intrinsic
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Mon Dec 12 19:16:15 PST 2022
Author: Matt Arsenault
Date: 2022-12-12T21:54:04-05:00
New Revision: d647e252b82f6b2cca291449ab9c18b441bb4f95
URL: https://github.com/llvm/llvm-project/commit/d647e252b82f6b2cca291449ab9c18b441bb4f95
DIFF: https://github.com/llvm/llvm-project/commit/d647e252b82f6b2cca291449ab9c18b441bb4f95.diff
LOG: InstSimplify: Add basic folding of llvm.is.fpclass intrinsic
Copied from the existing llvm.amdgcn.class handling; eventually I will
fold that to the generic intrinsic when legal. The tests should
probably move into an instsimplify only test.
Added:
Modified:
llvm/lib/Analysis/ConstantFolding.cpp
llvm/lib/Analysis/InstructionSimplify.cpp
llvm/test/CodeGen/AMDGPU/llvm.is.fpclass.f16.ll
llvm/test/Transforms/InstCombine/is_fpclass.ll
Removed:
################################################################################
diff --git a/llvm/lib/Analysis/ConstantFolding.cpp b/llvm/lib/Analysis/ConstantFolding.cpp
index f07113af84046..71f3c57b610f7 100644
--- a/llvm/lib/Analysis/ConstantFolding.cpp
+++ b/llvm/lib/Analysis/ConstantFolding.cpp
@@ -1617,6 +1617,7 @@ bool llvm::canConstantFoldCallTo(const CallBase *Call, const Function *F) {
// exceptions even for SNANs.
case Intrinsic::fabs:
case Intrinsic::copysign:
+ case Intrinsic::is_fpclass:
// Non-constrained variants of rounding operations means default FP
// environment, they can be folded in any case.
case Intrinsic::ceil:
@@ -2626,6 +2627,26 @@ static Constant *ConstantFoldScalarCall2(StringRef Name,
break;
}
} else if (auto *Op2C = dyn_cast<ConstantInt>(Operands[1])) {
+ switch (IntrinsicID) {
+ case Intrinsic::is_fpclass: {
+ uint32_t Mask = Op2C->getZExtValue();
+ bool Result =
+ ((Mask & fcSNan) && Op1V.isNaN() && Op1V.isSignaling()) ||
+ ((Mask & fcQNan) && Op1V.isNaN() && !Op1V.isSignaling()) ||
+ ((Mask & fcNegInf) && Op1V.isInfinity() && Op1V.isNegative()) ||
+ ((Mask & fcNegNormal) && Op1V.isNormal() && Op1V.isNegative()) ||
+ ((Mask & fcNegSubnormal) && Op1V.isDenormal() && Op1V.isNegative()) ||
+ ((Mask & fcNegZero) && Op1V.isZero() && Op1V.isNegative()) ||
+ ((Mask & fcPosZero) && Op1V.isZero() && !Op1V.isNegative()) ||
+ ((Mask & fcPosSubnormal) && Op1V.isDenormal() && !Op1V.isNegative()) ||
+ ((Mask & fcPosNormal) && Op1V.isNormal() && !Op1V.isNegative()) ||
+ ((Mask & fcPosInf) && Op1V.isInfinity() && !Op1V.isNegative());
+ return ConstantInt::get(Ty, Result);
+ }
+ default:
+ break;
+ }
+
if (!Ty->isHalfTy() && !Ty->isFloatTy() && !Ty->isDoubleTy())
return nullptr;
if (IntrinsicID == Intrinsic::powi && Ty->isHalfTy())
diff --git a/llvm/lib/Analysis/InstructionSimplify.cpp b/llvm/lib/Analysis/InstructionSimplify.cpp
index e830640783205..ba0c20f00276f 100644
--- a/llvm/lib/Analysis/InstructionSimplify.cpp
+++ b/llvm/lib/Analysis/InstructionSimplify.cpp
@@ -6147,6 +6147,20 @@ static Value *simplifyBinaryIntrinsic(Function *F, Value *Op0, Value *Op1,
match(Op1, m_FNeg(m_Specific(Op0))))
return Op1;
break;
+ case Intrinsic::is_fpclass: {
+ if (isa<PoisonValue>(Op0))
+ return PoisonValue::get(ReturnType);
+
+ uint64_t Mask = cast<ConstantInt>(Op1)->getZExtValue();
+ // If all tests are made, it doesn't matter what the value is.
+ if ((Mask & fcAllFlags) == fcAllFlags)
+ return ConstantInt::get(ReturnType, true);
+ if ((Mask & fcAllFlags) == 0)
+ return ConstantInt::get(ReturnType, false);
+ if (Q.isUndefValue(Op0))
+ return UndefValue::get(ReturnType);
+ break;
+ }
case Intrinsic::maxnum:
case Intrinsic::minnum:
case Intrinsic::maximum:
diff --git a/llvm/test/CodeGen/AMDGPU/llvm.is.fpclass.f16.ll b/llvm/test/CodeGen/AMDGPU/llvm.is.fpclass.f16.ll
index e074778e2dee9..54c351f8390c9 100644
--- a/llvm/test/CodeGen/AMDGPU/llvm.is.fpclass.f16.ll
+++ b/llvm/test/CodeGen/AMDGPU/llvm.is.fpclass.f16.ll
@@ -104,37 +104,33 @@ define i1 @zeromask_f16(half %x) nounwind {
; GFX8CHECK-LABEL: zeromask_f16:
; GFX8CHECK: ; %bb.0:
; GFX8CHECK-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
-; GFX8CHECK-NEXT: v_cmp_class_f16_e64 s[4:5], v0, 0
-; GFX8CHECK-NEXT: v_cndmask_b32_e64 v0, 0, 1, s[4:5]
+; GFX8CHECK-NEXT: v_mov_b32_e32 v0, 0
; GFX8CHECK-NEXT: s_setpc_b64 s[30:31]
;
; GFX9CHECK-LABEL: zeromask_f16:
; GFX9CHECK: ; %bb.0:
; GFX9CHECK-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
-; GFX9CHECK-NEXT: v_cmp_class_f16_e64 s[4:5], v0, 0
-; GFX9CHECK-NEXT: v_cndmask_b32_e64 v0, 0, 1, s[4:5]
+; GFX9CHECK-NEXT: v_mov_b32_e32 v0, 0
; GFX9CHECK-NEXT: s_setpc_b64 s[30:31]
;
; GFX10CHECK-LABEL: zeromask_f16:
; GFX10CHECK: ; %bb.0:
; GFX10CHECK-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; GFX10CHECK-NEXT: s_waitcnt_vscnt null, 0x0
-; GFX10CHECK-NEXT: v_cmp_class_f16_e64 s4, v0, 0
-; GFX10CHECK-NEXT: v_cndmask_b32_e64 v0, 0, 1, s4
+; GFX10CHECK-NEXT: v_mov_b32_e32 v0, 0
; GFX10CHECK-NEXT: s_setpc_b64 s[30:31]
;
; GFX11CHECK-LABEL: zeromask_f16:
; GFX11CHECK: ; %bb.0:
; GFX11CHECK-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; GFX11CHECK-NEXT: s_waitcnt_vscnt null, 0x0
-; GFX11CHECK-NEXT: v_cmp_class_f16_e64 s0, v0, 0
-; GFX11CHECK-NEXT: s_delay_alu instid0(VALU_DEP_1)
-; GFX11CHECK-NEXT: v_cndmask_b32_e64 v0, 0, 1, s0
+; GFX11CHECK-NEXT: v_mov_b32_e32 v0, 0
; GFX11CHECK-NEXT: s_setpc_b64 s[30:31]
%1 = call i1 @llvm.is.fpclass.f16(half %x, i32 0)
ret i1 %1
}
+; FIXME: DAG and GlobalISel return
diff erent values for i1 true
define i1 @allflags_f16(half %x) nounwind {
; GFX7SELDAG-LABEL: allflags_f16:
; GFX7SELDAG: ; %bb.0:
@@ -151,34 +147,27 @@ define i1 @allflags_f16(half %x) nounwind {
; GFX8CHECK-LABEL: allflags_f16:
; GFX8CHECK: ; %bb.0:
; GFX8CHECK-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
-; GFX8CHECK-NEXT: v_mov_b32_e32 v1, 0x3ff
-; GFX8CHECK-NEXT: v_cmp_class_f16_e32 vcc, v0, v1
-; GFX8CHECK-NEXT: v_cndmask_b32_e64 v0, 0, 1, vcc
+; GFX8CHECK-NEXT: v_mov_b32_e32 v0, {{(-)?}}1
; GFX8CHECK-NEXT: s_setpc_b64 s[30:31]
;
; GFX9CHECK-LABEL: allflags_f16:
; GFX9CHECK: ; %bb.0:
; GFX9CHECK-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
-; GFX9CHECK-NEXT: v_mov_b32_e32 v1, 0x3ff
-; GFX9CHECK-NEXT: v_cmp_class_f16_e32 vcc, v0, v1
-; GFX9CHECK-NEXT: v_cndmask_b32_e64 v0, 0, 1, vcc
+; GFX9CHECK-NEXT: v_mov_b32_e32 v0, {{(-)?}}1
; GFX9CHECK-NEXT: s_setpc_b64 s[30:31]
;
; GFX10CHECK-LABEL: allflags_f16:
; GFX10CHECK: ; %bb.0:
; GFX10CHECK-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; GFX10CHECK-NEXT: s_waitcnt_vscnt null, 0x0
-; GFX10CHECK-NEXT: v_cmp_class_f16_e64 s4, v0, 0x3ff
-; GFX10CHECK-NEXT: v_cndmask_b32_e64 v0, 0, 1, s4
+; GFX10CHECK-NEXT: v_mov_b32_e32 v0, {{(-)?}}1
; GFX10CHECK-NEXT: s_setpc_b64 s[30:31]
;
; GFX11CHECK-LABEL: allflags_f16:
; GFX11CHECK: ; %bb.0:
; GFX11CHECK-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; GFX11CHECK-NEXT: s_waitcnt_vscnt null, 0x0
-; GFX11CHECK-NEXT: v_cmp_class_f16_e64 s0, v0, 0x3ff
-; GFX11CHECK-NEXT: s_delay_alu instid0(VALU_DEP_1)
-; GFX11CHECK-NEXT: v_cndmask_b32_e64 v0, 0, 1, s0
+; GFX11CHECK-NEXT: v_mov_b32_e32 v0, {{(-)?}}1
; GFX11CHECK-NEXT: s_setpc_b64 s[30:31]
%1 = call i1 @llvm.is.fpclass.f16(half %x, i32 1023) ; 0x3ff
ret i1 %1
diff --git a/llvm/test/Transforms/InstCombine/is_fpclass.ll b/llvm/test/Transforms/InstCombine/is_fpclass.ll
index 39653fb872725..eda819560802f 100644
--- a/llvm/test/Transforms/InstCombine/is_fpclass.ll
+++ b/llvm/test/Transforms/InstCombine/is_fpclass.ll
@@ -13,8 +13,7 @@
define i1 @test_class_no_mask_f32(float %x) {
; CHECK-LABEL: @test_class_no_mask_f32(
-; CHECK-NEXT: [[VAL:%.*]] = call i1 @llvm.is.fpclass.f32(float [[X:%.*]], i32 0)
-; CHECK-NEXT: ret i1 [[VAL]]
+; CHECK-NEXT: ret i1 false
;
%val = call i1 @llvm.is.fpclass.f32(float %x, i32 0)
ret i1 %val
@@ -22,8 +21,7 @@ define i1 @test_class_no_mask_f32(float %x) {
define i1 @test_class_full_mask_f32(float %x) {
; CHECK-LABEL: @test_class_full_mask_f32(
-; CHECK-NEXT: [[VAL:%.*]] = call i1 @llvm.is.fpclass.f32(float [[X:%.*]], i32 1023)
-; CHECK-NEXT: ret i1 [[VAL]]
+; CHECK-NEXT: ret i1 true
;
%val = call i1 @llvm.is.fpclass.f32(float %x, i32 1023)
ret i1 %val
@@ -31,8 +29,7 @@ define i1 @test_class_full_mask_f32(float %x) {
define i1 @test_class_undef_no_mask_f32() {
; CHECK-LABEL: @test_class_undef_no_mask_f32(
-; CHECK-NEXT: [[VAL:%.*]] = call i1 @llvm.is.fpclass.f32(float undef, i32 0)
-; CHECK-NEXT: ret i1 [[VAL]]
+; CHECK-NEXT: ret i1 false
;
%val = call i1 @llvm.is.fpclass.f32(float undef, i32 0)
ret i1 %val
@@ -40,8 +37,7 @@ define i1 @test_class_undef_no_mask_f32() {
define i1 @test_class_undef_full_mask_f32() {
; CHECK-LABEL: @test_class_undef_full_mask_f32(
-; CHECK-NEXT: [[VAL:%.*]] = call i1 @llvm.is.fpclass.f32(float undef, i32 1023)
-; CHECK-NEXT: ret i1 [[VAL]]
+; CHECK-NEXT: ret i1 true
;
%val = call i1 @llvm.is.fpclass.f32(float undef, i32 1023)
ret i1 %val
@@ -49,8 +45,7 @@ define i1 @test_class_undef_full_mask_f32() {
define i1 @test_class_poison_no_mask_f32() {
; CHECK-LABEL: @test_class_poison_no_mask_f32(
-; CHECK-NEXT: [[VAL:%.*]] = call i1 @llvm.is.fpclass.f32(float poison, i32 0)
-; CHECK-NEXT: ret i1 [[VAL]]
+; CHECK-NEXT: ret i1 poison
;
%val = call i1 @llvm.is.fpclass.f32(float poison, i32 0)
ret i1 %val
@@ -58,8 +53,7 @@ define i1 @test_class_poison_no_mask_f32() {
define i1 @test_class_poison_full_mask_f32() {
; CHECK-LABEL: @test_class_poison_full_mask_f32(
-; CHECK-NEXT: [[VAL:%.*]] = call i1 @llvm.is.fpclass.f32(float poison, i32 1023)
-; CHECK-NEXT: ret i1 [[VAL]]
+; CHECK-NEXT: ret i1 poison
;
%val = call i1 @llvm.is.fpclass.f32(float poison, i32 1023)
ret i1 %val
@@ -67,8 +61,7 @@ define i1 @test_class_poison_full_mask_f32() {
define i1 @test_class_undef_val_f32() {
; CHECK-LABEL: @test_class_undef_val_f32(
-; CHECK-NEXT: [[VAL:%.*]] = call i1 @llvm.is.fpclass.f32(float undef, i32 4)
-; CHECK-NEXT: ret i1 [[VAL]]
+; CHECK-NEXT: ret i1 undef
;
%val = call i1 @llvm.is.fpclass.f32(float undef, i32 4)
ret i1 %val
@@ -76,8 +69,7 @@ define i1 @test_class_undef_val_f32() {
define i1 @test_class_poison_val_f32() {
; CHECK-LABEL: @test_class_poison_val_f32(
-; CHECK-NEXT: [[VAL:%.*]] = call i1 @llvm.is.fpclass.f32(float poison, i32 4)
-; CHECK-NEXT: ret i1 [[VAL]]
+; CHECK-NEXT: ret i1 poison
;
%val = call i1 @llvm.is.fpclass.f32(float poison, i32 4)
ret i1 %val
@@ -133,8 +125,7 @@ define i1 @test_class_is_p0_n0_f32_strict(float %x) {
define i1 @test_constant_class_snan_test_snan_f64() {
; CHECK-LABEL: @test_constant_class_snan_test_snan_f64(
-; CHECK-NEXT: [[VAL:%.*]] = call i1 @llvm.is.fpclass.f64(double 0x7FF0000000000001, i32 1)
-; CHECK-NEXT: ret i1 [[VAL]]
+; CHECK-NEXT: ret i1 true
;
%val = call i1 @llvm.is.fpclass.f64(double 0x7FF0000000000001, i32 1)
ret i1 %val
@@ -142,8 +133,7 @@ define i1 @test_constant_class_snan_test_snan_f64() {
define i1 @test_constant_class_qnan_test_qnan_f64() {
; CHECK-LABEL: @test_constant_class_qnan_test_qnan_f64(
-; CHECK-NEXT: [[VAL:%.*]] = call i1 @llvm.is.fpclass.f64(double 0x7FF8000000000000, i32 2)
-; CHECK-NEXT: ret i1 [[VAL]]
+; CHECK-NEXT: ret i1 true
;
%val = call i1 @llvm.is.fpclass.f64(double 0x7FF8000000000000, i32 2)
ret i1 %val
@@ -151,8 +141,7 @@ define i1 @test_constant_class_qnan_test_qnan_f64() {
define i1 @test_constant_class_qnan_test_snan_f64() {
; CHECK-LABEL: @test_constant_class_qnan_test_snan_f64(
-; CHECK-NEXT: [[VAL:%.*]] = call i1 @llvm.is.fpclass.f64(double 0x7FF8000000000000, i32 1)
-; CHECK-NEXT: ret i1 [[VAL]]
+; CHECK-NEXT: ret i1 false
;
%val = call i1 @llvm.is.fpclass.f64(double 0x7FF8000000000000, i32 1)
ret i1 %val
@@ -160,8 +149,7 @@ define i1 @test_constant_class_qnan_test_snan_f64() {
define i1 @test_constant_class_ninf_test_ninf_f64() {
; CHECK-LABEL: @test_constant_class_ninf_test_ninf_f64(
-; CHECK-NEXT: [[VAL:%.*]] = call i1 @llvm.is.fpclass.f64(double 0xFFF0000000000000, i32 4)
-; CHECK-NEXT: ret i1 [[VAL]]
+; CHECK-NEXT: ret i1 true
;
%val = call i1 @llvm.is.fpclass.f64(double 0xFFF0000000000000, i32 4)
ret i1 %val
@@ -169,8 +157,7 @@ define i1 @test_constant_class_ninf_test_ninf_f64() {
define i1 @test_constant_class_pinf_test_ninf_f64() {
; CHECK-LABEL: @test_constant_class_pinf_test_ninf_f64(
-; CHECK-NEXT: [[VAL:%.*]] = call i1 @llvm.is.fpclass.f64(double 0x7FF0000000000000, i32 4)
-; CHECK-NEXT: ret i1 [[VAL]]
+; CHECK-NEXT: ret i1 false
;
%val = call i1 @llvm.is.fpclass.f64(double 0x7FF0000000000000, i32 4)
ret i1 %val
@@ -178,8 +165,7 @@ define i1 @test_constant_class_pinf_test_ninf_f64() {
define i1 @test_constant_class_qnan_test_ninf_f64() {
; CHECK-LABEL: @test_constant_class_qnan_test_ninf_f64(
-; CHECK-NEXT: [[VAL:%.*]] = call i1 @llvm.is.fpclass.f64(double 0x7FF8000000000000, i32 4)
-; CHECK-NEXT: ret i1 [[VAL]]
+; CHECK-NEXT: ret i1 false
;
%val = call i1 @llvm.is.fpclass.f64(double 0x7FF8000000000000, i32 4)
ret i1 %val
@@ -187,8 +173,7 @@ define i1 @test_constant_class_qnan_test_ninf_f64() {
define i1 @test_constant_class_snan_test_ninf_f64() {
; CHECK-LABEL: @test_constant_class_snan_test_ninf_f64(
-; CHECK-NEXT: [[VAL:%.*]] = call i1 @llvm.is.fpclass.f64(double 0x7FF0000000000001, i32 4)
-; CHECK-NEXT: ret i1 [[VAL]]
+; CHECK-NEXT: ret i1 false
;
%val = call i1 @llvm.is.fpclass.f64(double 0x7FF0000000000001, i32 4)
ret i1 %val
@@ -196,8 +181,7 @@ define i1 @test_constant_class_snan_test_ninf_f64() {
define i1 @test_constant_class_nnormal_test_nnormal_f64() {
; CHECK-LABEL: @test_constant_class_nnormal_test_nnormal_f64(
-; CHECK-NEXT: [[VAL:%.*]] = call i1 @llvm.is.fpclass.f64(double -1.000000e+00, i32 8)
-; CHECK-NEXT: ret i1 [[VAL]]
+; CHECK-NEXT: ret i1 true
;
%val = call i1 @llvm.is.fpclass.f64(double -1.0, i32 8)
ret i1 %val
@@ -205,8 +189,7 @@ define i1 @test_constant_class_nnormal_test_nnormal_f64() {
define i1 @test_constant_class_pnormal_test_nnormal_f64() {
; CHECK-LABEL: @test_constant_class_pnormal_test_nnormal_f64(
-; CHECK-NEXT: [[VAL:%.*]] = call i1 @llvm.is.fpclass.f64(double 1.000000e+00, i32 8)
-; CHECK-NEXT: ret i1 [[VAL]]
+; CHECK-NEXT: ret i1 false
;
%val = call i1 @llvm.is.fpclass.f64(double 1.0, i32 8)
ret i1 %val
@@ -214,8 +197,7 @@ define i1 @test_constant_class_pnormal_test_nnormal_f64() {
define i1 @test_constant_class_nsubnormal_test_nsubnormal_f64() {
; CHECK-LABEL: @test_constant_class_nsubnormal_test_nsubnormal_f64(
-; CHECK-NEXT: [[VAL:%.*]] = call i1 @llvm.is.fpclass.f64(double 0x800FFFFFFFFFFFFF, i32 16)
-; CHECK-NEXT: ret i1 [[VAL]]
+; CHECK-NEXT: ret i1 true
;
%val = call i1 @llvm.is.fpclass.f64(double 0x800fffffffffffff, i32 16)
ret i1 %val
@@ -223,8 +205,7 @@ define i1 @test_constant_class_nsubnormal_test_nsubnormal_f64() {
define i1 @test_constant_class_psubnormal_test_nsubnormal_f64() {
; CHECK-LABEL: @test_constant_class_psubnormal_test_nsubnormal_f64(
-; CHECK-NEXT: [[VAL:%.*]] = call i1 @llvm.is.fpclass.f64(double 0xFFFFFFFFFFFFF, i32 16)
-; CHECK-NEXT: ret i1 [[VAL]]
+; CHECK-NEXT: ret i1 false
;
%val = call i1 @llvm.is.fpclass.f64(double 0x000fffffffffffff, i32 16)
ret i1 %val
@@ -232,8 +213,7 @@ define i1 @test_constant_class_psubnormal_test_nsubnormal_f64() {
define i1 @test_constant_class_nzero_test_nzero_f64() {
; CHECK-LABEL: @test_constant_class_nzero_test_nzero_f64(
-; CHECK-NEXT: [[VAL:%.*]] = call i1 @llvm.is.fpclass.f64(double -0.000000e+00, i32 32)
-; CHECK-NEXT: ret i1 [[VAL]]
+; CHECK-NEXT: ret i1 true
;
%val = call i1 @llvm.is.fpclass.f64(double -0.0, i32 32)
ret i1 %val
@@ -241,8 +221,7 @@ define i1 @test_constant_class_nzero_test_nzero_f64() {
define i1 @test_constant_class_pzero_test_nzero_f64() {
; CHECK-LABEL: @test_constant_class_pzero_test_nzero_f64(
-; CHECK-NEXT: [[VAL:%.*]] = call i1 @llvm.is.fpclass.f64(double 0.000000e+00, i32 32)
-; CHECK-NEXT: ret i1 [[VAL]]
+; CHECK-NEXT: ret i1 false
;
%val = call i1 @llvm.is.fpclass.f64(double 0.0, i32 32)
ret i1 %val
@@ -250,8 +229,7 @@ define i1 @test_constant_class_pzero_test_nzero_f64() {
define i1 @test_constant_class_pzero_test_pzero_f64() {
; CHECK-LABEL: @test_constant_class_pzero_test_pzero_f64(
-; CHECK-NEXT: [[VAL:%.*]] = call i1 @llvm.is.fpclass.f64(double 0.000000e+00, i32 64)
-; CHECK-NEXT: ret i1 [[VAL]]
+; CHECK-NEXT: ret i1 true
;
%val = call i1 @llvm.is.fpclass.f64(double 0.0, i32 64)
ret i1 %val
@@ -259,8 +237,7 @@ define i1 @test_constant_class_pzero_test_pzero_f64() {
define i1 @test_constant_class_nzero_test_pzero_f64() {
; CHECK-LABEL: @test_constant_class_nzero_test_pzero_f64(
-; CHECK-NEXT: [[VAL:%.*]] = call i1 @llvm.is.fpclass.f64(double -0.000000e+00, i32 64)
-; CHECK-NEXT: ret i1 [[VAL]]
+; CHECK-NEXT: ret i1 false
;
%val = call i1 @llvm.is.fpclass.f64(double -0.0, i32 64)
ret i1 %val
@@ -268,8 +245,7 @@ define i1 @test_constant_class_nzero_test_pzero_f64() {
define i1 @test_constant_class_psubnormal_test_psubnormal_f64() {
; CHECK-LABEL: @test_constant_class_psubnormal_test_psubnormal_f64(
-; CHECK-NEXT: [[VAL:%.*]] = call i1 @llvm.is.fpclass.f64(double 0xFFFFFFFFFFFFF, i32 128)
-; CHECK-NEXT: ret i1 [[VAL]]
+; CHECK-NEXT: ret i1 true
;
%val = call i1 @llvm.is.fpclass.f64(double 0x000fffffffffffff, i32 128)
ret i1 %val
@@ -277,8 +253,7 @@ define i1 @test_constant_class_psubnormal_test_psubnormal_f64() {
define i1 @test_constant_class_nsubnormal_test_psubnormal_f64() {
; CHECK-LABEL: @test_constant_class_nsubnormal_test_psubnormal_f64(
-; CHECK-NEXT: [[VAL:%.*]] = call i1 @llvm.is.fpclass.f64(double 0x800FFFFFFFFFFFFF, i32 128)
-; CHECK-NEXT: ret i1 [[VAL]]
+; CHECK-NEXT: ret i1 false
;
%val = call i1 @llvm.is.fpclass.f64(double 0x800fffffffffffff, i32 128)
ret i1 %val
@@ -286,8 +261,7 @@ define i1 @test_constant_class_nsubnormal_test_psubnormal_f64() {
define i1 @test_constant_class_pnormal_test_pnormal_f64() {
; CHECK-LABEL: @test_constant_class_pnormal_test_pnormal_f64(
-; CHECK-NEXT: [[VAL:%.*]] = call i1 @llvm.is.fpclass.f64(double 1.000000e+00, i32 256)
-; CHECK-NEXT: ret i1 [[VAL]]
+; CHECK-NEXT: ret i1 true
;
%val = call i1 @llvm.is.fpclass.f64(double 1.0, i32 256)
ret i1 %val
@@ -295,8 +269,7 @@ define i1 @test_constant_class_pnormal_test_pnormal_f64() {
define i1 @test_constant_class_nnormal_test_pnormal_f64() {
; CHECK-LABEL: @test_constant_class_nnormal_test_pnormal_f64(
-; CHECK-NEXT: [[VAL:%.*]] = call i1 @llvm.is.fpclass.f64(double -1.000000e+00, i32 256)
-; CHECK-NEXT: ret i1 [[VAL]]
+; CHECK-NEXT: ret i1 false
;
%val = call i1 @llvm.is.fpclass.f64(double -1.0, i32 256)
ret i1 %val
@@ -304,8 +277,7 @@ define i1 @test_constant_class_nnormal_test_pnormal_f64() {
define i1 @test_constant_class_pinf_test_pinf_f64() {
; CHECK-LABEL: @test_constant_class_pinf_test_pinf_f64(
-; CHECK-NEXT: [[VAL:%.*]] = call i1 @llvm.is.fpclass.f64(double 0x7FF0000000000000, i32 512)
-; CHECK-NEXT: ret i1 [[VAL]]
+; CHECK-NEXT: ret i1 true
;
%val = call i1 @llvm.is.fpclass.f64(double 0x7FF0000000000000, i32 512)
ret i1 %val
@@ -313,8 +285,7 @@ define i1 @test_constant_class_pinf_test_pinf_f64() {
define i1 @test_constant_class_ninf_test_pinf_f64() {
; CHECK-LABEL: @test_constant_class_ninf_test_pinf_f64(
-; CHECK-NEXT: [[VAL:%.*]] = call i1 @llvm.is.fpclass.f64(double 0xFFF0000000000000, i32 512)
-; CHECK-NEXT: ret i1 [[VAL]]
+; CHECK-NEXT: ret i1 false
;
%val = call i1 @llvm.is.fpclass.f64(double 0xFFF0000000000000, i32 512)
ret i1 %val
@@ -322,8 +293,7 @@ define i1 @test_constant_class_ninf_test_pinf_f64() {
define i1 @test_constant_class_qnan_test_pinf_f64() {
; CHECK-LABEL: @test_constant_class_qnan_test_pinf_f64(
-; CHECK-NEXT: [[VAL:%.*]] = call i1 @llvm.is.fpclass.f64(double 0x7FF8000000000000, i32 512)
-; CHECK-NEXT: ret i1 [[VAL]]
+; CHECK-NEXT: ret i1 false
;
%val = call i1 @llvm.is.fpclass.f64(double 0x7FF8000000000000, i32 512)
ret i1 %val
@@ -331,8 +301,7 @@ define i1 @test_constant_class_qnan_test_pinf_f64() {
define i1 @test_constant_class_snan_test_pinf_f64() {
; CHECK-LABEL: @test_constant_class_snan_test_pinf_f64(
-; CHECK-NEXT: [[VAL:%.*]] = call i1 @llvm.is.fpclass.f64(double 0x7FF0000000000001, i32 512)
-; CHECK-NEXT: ret i1 [[VAL]]
+; CHECK-NEXT: ret i1 false
;
%val = call i1 @llvm.is.fpclass.f64(double 0x7FF0000000000001, i32 512)
ret i1 %val
More information about the llvm-commits
mailing list