Skip to content

Revert "InstCombine: Fold is.fpclass(x, fcInf) to fabs+fcmp" #76338

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 11 additions & 12 deletions clang/test/CodeGen/isfpclass.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@
// CHECK-LABEL: define dso_local i1 @check_isfpclass_finite
// CHECK-SAME: (float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR0:[0-9]+]] {
// CHECK-NEXT: entry:
// CHECK-NEXT: [[TMP0:%.*]] = tail call float @llvm.fabs.f32(float [[X]])
// CHECK-NEXT: [[TMP1:%.*]] = fcmp one float [[TMP0]], 0x7FF0000000000000
// CHECK-NEXT: ret i1 [[TMP1]]
// CHECK-NEXT: [[TMP0:%.*]] = tail call i1 @llvm.is.fpclass.f32(float [[X]], i32 504)
// CHECK-NEXT: ret i1 [[TMP0]]
//
_Bool check_isfpclass_finite(float x) {
return __builtin_isfpclass(x, 504 /*Finite*/);
Expand All @@ -15,7 +14,7 @@ _Bool check_isfpclass_finite(float x) {
// CHECK-LABEL: define dso_local i1 @check_isfpclass_finite_strict
// CHECK-SAME: (float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR2:[0-9]+]] {
// CHECK-NEXT: entry:
// CHECK-NEXT: [[TMP0:%.*]] = tail call i1 @llvm.is.fpclass.f32(float [[X]], i32 504) #[[ATTR6:[0-9]+]]
// CHECK-NEXT: [[TMP0:%.*]] = tail call i1 @llvm.is.fpclass.f32(float [[X]], i32 504) #[[ATTR5:[0-9]+]]
// CHECK-NEXT: ret i1 [[TMP0]]
//
_Bool check_isfpclass_finite_strict(float x) {
Expand All @@ -36,7 +35,7 @@ _Bool check_isfpclass_nan_f32(float x) {
// CHECK-LABEL: define dso_local i1 @check_isfpclass_nan_f32_strict
// CHECK-SAME: (float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR2]] {
// CHECK-NEXT: entry:
// CHECK-NEXT: [[TMP0:%.*]] = tail call i1 @llvm.is.fpclass.f32(float [[X]], i32 3) #[[ATTR6]]
// CHECK-NEXT: [[TMP0:%.*]] = tail call i1 @llvm.is.fpclass.f32(float [[X]], i32 3) #[[ATTR5]]
// CHECK-NEXT: ret i1 [[TMP0]]
//
_Bool check_isfpclass_nan_f32_strict(float x) {
Expand All @@ -57,7 +56,7 @@ _Bool check_isfpclass_snan_f64(double x) {
// CHECK-LABEL: define dso_local i1 @check_isfpclass_snan_f64_strict
// CHECK-SAME: (double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR2]] {
// CHECK-NEXT: entry:
// CHECK-NEXT: [[TMP0:%.*]] = tail call i1 @llvm.is.fpclass.f64(double [[X]], i32 1) #[[ATTR6]]
// CHECK-NEXT: [[TMP0:%.*]] = tail call i1 @llvm.is.fpclass.f64(double [[X]], i32 1) #[[ATTR5]]
// CHECK-NEXT: ret i1 [[TMP0]]
//
_Bool check_isfpclass_snan_f64_strict(double x) {
Expand All @@ -78,7 +77,7 @@ _Bool check_isfpclass_zero_f16(_Float16 x) {
// CHECK-LABEL: define dso_local i1 @check_isfpclass_zero_f16_strict
// CHECK-SAME: (half noundef [[X:%.*]]) local_unnamed_addr #[[ATTR2]] {
// CHECK-NEXT: entry:
// CHECK-NEXT: [[TMP0:%.*]] = tail call i1 @llvm.is.fpclass.f16(half [[X]], i32 96) #[[ATTR6]]
// CHECK-NEXT: [[TMP0:%.*]] = tail call i1 @llvm.is.fpclass.f16(half [[X]], i32 96) #[[ATTR5]]
// CHECK-NEXT: ret i1 [[TMP0]]
//
_Bool check_isfpclass_zero_f16_strict(_Float16 x) {
Expand All @@ -89,7 +88,7 @@ _Bool check_isfpclass_zero_f16_strict(_Float16 x) {
// CHECK-LABEL: define dso_local i1 @check_isnan
// CHECK-SAME: (float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR2]] {
// CHECK-NEXT: entry:
// CHECK-NEXT: [[TMP0:%.*]] = tail call i1 @llvm.is.fpclass.f32(float [[X]], i32 3) #[[ATTR6]]
// CHECK-NEXT: [[TMP0:%.*]] = tail call i1 @llvm.is.fpclass.f32(float [[X]], i32 3) #[[ATTR5]]
// CHECK-NEXT: ret i1 [[TMP0]]
//
_Bool check_isnan(float x) {
Expand All @@ -100,7 +99,7 @@ _Bool check_isnan(float x) {
// CHECK-LABEL: define dso_local i1 @check_isinf
// CHECK-SAME: (float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR2]] {
// CHECK-NEXT: entry:
// CHECK-NEXT: [[TMP0:%.*]] = tail call i1 @llvm.is.fpclass.f32(float [[X]], i32 516) #[[ATTR6]]
// CHECK-NEXT: [[TMP0:%.*]] = tail call i1 @llvm.is.fpclass.f32(float [[X]], i32 516) #[[ATTR5]]
// CHECK-NEXT: ret i1 [[TMP0]]
//
_Bool check_isinf(float x) {
Expand All @@ -111,7 +110,7 @@ _Bool check_isinf(float x) {
// CHECK-LABEL: define dso_local i1 @check_isfinite
// CHECK-SAME: (float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR2]] {
// CHECK-NEXT: entry:
// CHECK-NEXT: [[TMP0:%.*]] = tail call i1 @llvm.is.fpclass.f32(float [[X]], i32 504) #[[ATTR6]]
// CHECK-NEXT: [[TMP0:%.*]] = tail call i1 @llvm.is.fpclass.f32(float [[X]], i32 504) #[[ATTR5]]
// CHECK-NEXT: ret i1 [[TMP0]]
//
_Bool check_isfinite(float x) {
Expand All @@ -122,7 +121,7 @@ _Bool check_isfinite(float x) {
// CHECK-LABEL: define dso_local i1 @check_isnormal
// CHECK-SAME: (float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR2]] {
// CHECK-NEXT: entry:
// CHECK-NEXT: [[TMP0:%.*]] = tail call i1 @llvm.is.fpclass.f32(float [[X]], i32 264) #[[ATTR6]]
// CHECK-NEXT: [[TMP0:%.*]] = tail call i1 @llvm.is.fpclass.f32(float [[X]], i32 264) #[[ATTR5]]
// CHECK-NEXT: ret i1 [[TMP0]]
//
_Bool check_isnormal(float x) {
Expand Down Expand Up @@ -150,7 +149,7 @@ int4 check_isfpclass_nan_v4f32(float4 x) {
// CHECK-LABEL: define dso_local <4 x i32> @check_isfpclass_nan_strict_v4f32
// CHECK-SAME: (<4 x float> noundef [[X:%.*]]) local_unnamed_addr #[[ATTR2]] {
// CHECK-NEXT: entry:
// CHECK-NEXT: [[TMP0:%.*]] = tail call <4 x i1> @llvm.is.fpclass.v4f32(<4 x float> [[X]], i32 3) #[[ATTR6]]
// CHECK-NEXT: [[TMP0:%.*]] = tail call <4 x i1> @llvm.is.fpclass.v4f32(<4 x float> [[X]], i32 3) #[[ATTR5]]
// CHECK-NEXT: [[TMP1:%.*]] = zext <4 x i1> [[TMP0]] to <4 x i32>
// CHECK-NEXT: ret <4 x i32> [[TMP1]]
//
Expand Down
40 changes: 16 additions & 24 deletions clang/test/Headers/__clang_hip_math.hip
Original file line number Diff line number Diff line change
Expand Up @@ -1461,9 +1461,8 @@ extern "C" __device__ int test_ilogb(double x) {

// DEFAULT-LABEL: @test___finitef(
// DEFAULT-NEXT: entry:
// DEFAULT-NEXT: [[TMP0:%.*]] = tail call float @llvm.fabs.f32(float [[X:%.*]])
// DEFAULT-NEXT: [[TMP1:%.*]] = fcmp one float [[TMP0]], 0x7FF0000000000000
// DEFAULT-NEXT: [[CONV:%.*]] = zext i1 [[TMP1]] to i32
// DEFAULT-NEXT: [[TMP0:%.*]] = tail call noundef i1 @llvm.is.fpclass.f32(float [[X:%.*]], i32 504)
// DEFAULT-NEXT: [[CONV:%.*]] = zext i1 [[TMP0]] to i32
// DEFAULT-NEXT: ret i32 [[CONV]]
//
// FINITEONLY-LABEL: @test___finitef(
Expand All @@ -1472,9 +1471,8 @@ extern "C" __device__ int test_ilogb(double x) {
//
// APPROX-LABEL: @test___finitef(
// APPROX-NEXT: entry:
// APPROX-NEXT: [[TMP0:%.*]] = tail call float @llvm.fabs.f32(float [[X:%.*]])
// APPROX-NEXT: [[TMP1:%.*]] = fcmp one float [[TMP0]], 0x7FF0000000000000
// APPROX-NEXT: [[CONV:%.*]] = zext i1 [[TMP1]] to i32
// APPROX-NEXT: [[TMP0:%.*]] = tail call noundef i1 @llvm.is.fpclass.f32(float [[X:%.*]], i32 504)
// APPROX-NEXT: [[CONV:%.*]] = zext i1 [[TMP0]] to i32
// APPROX-NEXT: ret i32 [[CONV]]
//
extern "C" __device__ BOOL_TYPE test___finitef(float x) {
Expand All @@ -1483,9 +1481,8 @@ extern "C" __device__ BOOL_TYPE test___finitef(float x) {

// DEFAULT-LABEL: @test___finite(
// DEFAULT-NEXT: entry:
// DEFAULT-NEXT: [[TMP0:%.*]] = tail call double @llvm.fabs.f64(double [[X:%.*]])
// DEFAULT-NEXT: [[TMP1:%.*]] = fcmp one double [[TMP0]], 0x7FF0000000000000
// DEFAULT-NEXT: [[CONV:%.*]] = zext i1 [[TMP1]] to i32
// DEFAULT-NEXT: [[TMP0:%.*]] = tail call noundef i1 @llvm.is.fpclass.f64(double [[X:%.*]], i32 504)
// DEFAULT-NEXT: [[CONV:%.*]] = zext i1 [[TMP0]] to i32
// DEFAULT-NEXT: ret i32 [[CONV]]
//
// FINITEONLY-LABEL: @test___finite(
Expand All @@ -1494,9 +1491,8 @@ extern "C" __device__ BOOL_TYPE test___finitef(float x) {
//
// APPROX-LABEL: @test___finite(
// APPROX-NEXT: entry:
// APPROX-NEXT: [[TMP0:%.*]] = tail call double @llvm.fabs.f64(double [[X:%.*]])
// APPROX-NEXT: [[TMP1:%.*]] = fcmp one double [[TMP0]], 0x7FF0000000000000
// APPROX-NEXT: [[CONV:%.*]] = zext i1 [[TMP1]] to i32
// APPROX-NEXT: [[TMP0:%.*]] = tail call noundef i1 @llvm.is.fpclass.f64(double [[X:%.*]], i32 504)
// APPROX-NEXT: [[CONV:%.*]] = zext i1 [[TMP0]] to i32
// APPROX-NEXT: ret i32 [[CONV]]
//
extern "C" __device__ BOOL_TYPE test___finite(double x) {
Expand All @@ -1505,9 +1501,8 @@ extern "C" __device__ BOOL_TYPE test___finite(double x) {

// DEFAULT-LABEL: @test___isinff(
// DEFAULT-NEXT: entry:
// DEFAULT-NEXT: [[TMP0:%.*]] = tail call float @llvm.fabs.f32(float [[X:%.*]])
// DEFAULT-NEXT: [[TMP1:%.*]] = fcmp oeq float [[TMP0]], 0x7FF0000000000000
// DEFAULT-NEXT: [[CONV:%.*]] = zext i1 [[TMP1]] to i32
// DEFAULT-NEXT: [[TMP0:%.*]] = tail call noundef i1 @llvm.is.fpclass.f32(float [[X:%.*]], i32 516)
// DEFAULT-NEXT: [[CONV:%.*]] = zext i1 [[TMP0]] to i32
// DEFAULT-NEXT: ret i32 [[CONV]]
//
// FINITEONLY-LABEL: @test___isinff(
Expand All @@ -1516,9 +1511,8 @@ extern "C" __device__ BOOL_TYPE test___finite(double x) {
//
// APPROX-LABEL: @test___isinff(
// APPROX-NEXT: entry:
// APPROX-NEXT: [[TMP0:%.*]] = tail call float @llvm.fabs.f32(float [[X:%.*]])
// APPROX-NEXT: [[TMP1:%.*]] = fcmp oeq float [[TMP0]], 0x7FF0000000000000
// APPROX-NEXT: [[CONV:%.*]] = zext i1 [[TMP1]] to i32
// APPROX-NEXT: [[TMP0:%.*]] = tail call noundef i1 @llvm.is.fpclass.f32(float [[X:%.*]], i32 516)
// APPROX-NEXT: [[CONV:%.*]] = zext i1 [[TMP0]] to i32
// APPROX-NEXT: ret i32 [[CONV]]
//
extern "C" __device__ BOOL_TYPE test___isinff(float x) {
Expand All @@ -1527,9 +1521,8 @@ extern "C" __device__ BOOL_TYPE test___isinff(float x) {

// DEFAULT-LABEL: @test___isinf(
// DEFAULT-NEXT: entry:
// DEFAULT-NEXT: [[TMP0:%.*]] = tail call double @llvm.fabs.f64(double [[X:%.*]])
// DEFAULT-NEXT: [[TMP1:%.*]] = fcmp oeq double [[TMP0]], 0x7FF0000000000000
// DEFAULT-NEXT: [[CONV:%.*]] = zext i1 [[TMP1]] to i32
// DEFAULT-NEXT: [[TMP0:%.*]] = tail call noundef i1 @llvm.is.fpclass.f64(double [[X:%.*]], i32 516)
// DEFAULT-NEXT: [[CONV:%.*]] = zext i1 [[TMP0]] to i32
// DEFAULT-NEXT: ret i32 [[CONV]]
//
// FINITEONLY-LABEL: @test___isinf(
Expand All @@ -1538,9 +1531,8 @@ extern "C" __device__ BOOL_TYPE test___isinff(float x) {
//
// APPROX-LABEL: @test___isinf(
// APPROX-NEXT: entry:
// APPROX-NEXT: [[TMP0:%.*]] = tail call double @llvm.fabs.f64(double [[X:%.*]])
// APPROX-NEXT: [[TMP1:%.*]] = fcmp oeq double [[TMP0]], 0x7FF0000000000000
// APPROX-NEXT: [[CONV:%.*]] = zext i1 [[TMP1]] to i32
// APPROX-NEXT: [[TMP0:%.*]] = tail call noundef i1 @llvm.is.fpclass.f64(double [[X:%.*]], i32 516)
// APPROX-NEXT: [[CONV:%.*]] = zext i1 [[TMP0]] to i32
// APPROX-NEXT: ret i32 [[CONV]]
//
extern "C" __device__ BOOL_TYPE test___isinf(double x) {
Expand Down
18 changes: 0 additions & 18 deletions llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -931,24 +931,6 @@ Instruction *InstCombinerImpl::foldIntrinsicIsFPClass(IntrinsicInst &II) {
return replaceOperand(II, 0, FAbsSrc);
}

if ((OrderedMask == fcInf || OrderedInvertedMask == fcInf) &&
(IsOrdered || IsUnordered) && !IsStrict) {
// is.fpclass(x, fcInf) -> fcmp oeq fabs(x), +inf
// is.fpclass(x, ~fcInf) -> fcmp one fabs(x), +inf
// is.fpclass(x, fcInf|fcNan) -> fcmp ueq fabs(x), +inf
// is.fpclass(x, ~(fcInf|fcNan)) -> fcmp une fabs(x), +inf
Constant *Inf = ConstantFP::getInfinity(Src0->getType());
FCmpInst::Predicate Pred =
IsUnordered ? FCmpInst::FCMP_UEQ : FCmpInst::FCMP_OEQ;
if (OrderedInvertedMask == fcInf)
Pred = IsUnordered ? FCmpInst::FCMP_UNE : FCmpInst::FCMP_ONE;

Value *Fabs = Builder.CreateUnaryIntrinsic(Intrinsic::fabs, Src0);
Value *CmpInf = Builder.CreateFCmp(Pred, Fabs, Inf);
CmpInf->takeName(&II);
return replaceInstUsesWith(II, CmpInf);
}

if ((OrderedMask == fcPosInf || OrderedMask == fcNegInf) &&
(IsOrdered || IsUnordered) && !IsStrict) {
// is.fpclass(x, fcPosInf) -> fcmp oeq x, +inf
Expand Down
9 changes: 3 additions & 6 deletions llvm/test/Transforms/InstCombine/and-fcmp.ll
Original file line number Diff line number Diff line change
Expand Up @@ -4794,8 +4794,7 @@ define i1 @clang_builtin_isnormal_inf_check_ord(half %x) {

define i1 @clang_builtin_isnormal_inf_check_oge(half %x) {
; CHECK-LABEL: @clang_builtin_isnormal_inf_check_oge(
; CHECK-NEXT: [[TMP1:%.*]] = call half @llvm.fabs.f16(half [[X:%.*]])
; CHECK-NEXT: [[AND:%.*]] = fcmp oeq half [[TMP1]], 0xH7C00
; CHECK-NEXT: [[AND:%.*]] = call i1 @llvm.is.fpclass.f16(half [[X:%.*]], i32 516)
; CHECK-NEXT: ret i1 [[AND]]
;
%fabs.x = call half @llvm.fabs.f16(half %x)
Expand All @@ -4807,8 +4806,7 @@ define i1 @clang_builtin_isnormal_inf_check_oge(half %x) {

define i1 @clang_builtin_isnormal_inf_check_olt(half %x) {
; CHECK-LABEL: @clang_builtin_isnormal_inf_check_olt(
; CHECK-NEXT: [[TMP1:%.*]] = call half @llvm.fabs.f16(half [[X:%.*]])
; CHECK-NEXT: [[AND:%.*]] = fcmp one half [[TMP1]], 0xH7C00
; CHECK-NEXT: [[AND:%.*]] = call i1 @llvm.is.fpclass.f16(half [[X:%.*]], i32 504)
; CHECK-NEXT: ret i1 [[AND]]
;
%fabs.x = call half @llvm.fabs.f16(half %x)
Expand All @@ -4835,8 +4833,7 @@ define i1 @clang_builtin_isnormal_inf_check_ole(half %x) {

define i1 @clang_builtin_isnormal_inf_check_oeq(half %x) {
; CHECK-LABEL: @clang_builtin_isnormal_inf_check_oeq(
; CHECK-NEXT: [[TMP1:%.*]] = call half @llvm.fabs.f16(half [[X:%.*]])
; CHECK-NEXT: [[AND:%.*]] = fcmp oeq half [[TMP1]], 0xH7C00
; CHECK-NEXT: [[AND:%.*]] = call i1 @llvm.is.fpclass.f16(half [[X:%.*]], i32 516)
; CHECK-NEXT: ret i1 [[AND]]
;
%fabs.x = call half @llvm.fabs.f16(half %x)
Expand Down
26 changes: 11 additions & 15 deletions llvm/test/Transforms/InstCombine/combine-is.fpclass-and-fcmp.ll
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,7 @@ define i1 @fcmp_isfinite_and_class_subnormal(half %x) {

define i1 @fcmp_isfinite_or_class_subnormal(half %x) {
; CHECK-LABEL: @fcmp_isfinite_or_class_subnormal(
; CHECK-NEXT: [[TMP1:%.*]] = call half @llvm.fabs.f16(half [[X:%.*]])
; CHECK-NEXT: [[SUBNORMAL_CLASS:%.*]] = fcmp one half [[TMP1]], 0xH7C00
; CHECK-NEXT: [[SUBNORMAL_CLASS:%.*]] = call i1 @llvm.is.fpclass.f16(half [[X:%.*]], i32 504)
; CHECK-NEXT: ret i1 [[SUBNORMAL_CLASS]]
;
%fabs = call half @llvm.fabs.f16(half %x)
Expand All @@ -149,9 +148,8 @@ define i1 @fcmp_isfinite_or_class_subnormal(half %x) {
; -> isfinite
define i1 @fcmp_issubnormal_or_class_finite(half %x) {
; CHECK-LABEL: @fcmp_issubnormal_or_class_finite(
; CHECK-NEXT: [[TMP1:%.*]] = call half @llvm.fabs.f16(half [[X:%.*]])
; CHECK-NEXT: [[OR:%.*]] = fcmp one half [[TMP1]], 0xH7C00
; CHECK-NEXT: ret i1 [[OR]]
; CHECK-NEXT: [[IS_FINITE_CLASS:%.*]] = call i1 @llvm.is.fpclass.f16(half [[X:%.*]], i32 504)
; CHECK-NEXT: ret i1 [[IS_FINITE_CLASS]]
;
%fabs = call half @llvm.fabs.f16(half %x)
%is.subnormal = fcmp olt half %fabs, 0xH0400
Expand All @@ -163,9 +161,8 @@ define i1 @fcmp_issubnormal_or_class_finite(half %x) {
; -> isfinite
define i1 @class_finite_or_fcmp_issubnormal(half %x) {
; CHECK-LABEL: @class_finite_or_fcmp_issubnormal(
; CHECK-NEXT: [[TMP1:%.*]] = call half @llvm.fabs.f16(half [[X:%.*]])
; CHECK-NEXT: [[OR:%.*]] = fcmp one half [[TMP1]], 0xH7C00
; CHECK-NEXT: ret i1 [[OR]]
; CHECK-NEXT: [[IS_FINITE_CLASS:%.*]] = call i1 @llvm.is.fpclass.f16(half [[X:%.*]], i32 504)
; CHECK-NEXT: ret i1 [[IS_FINITE_CLASS]]
;
%fabs = call half @llvm.fabs.f16(half %x)
%is.subnormal = fcmp olt half %fabs, 0xH0400
Expand All @@ -177,8 +174,8 @@ define i1 @class_finite_or_fcmp_issubnormal(half %x) {
; -> issubnormal
define i1 @fcmp_issubnormal_and_class_finite(half %x) {
; CHECK-LABEL: @fcmp_issubnormal_and_class_finite(
; CHECK-NEXT: [[AND:%.*]] = call i1 @llvm.is.fpclass.f16(half [[X:%.*]], i32 240)
; CHECK-NEXT: ret i1 [[AND]]
; CHECK-NEXT: [[IS_FINITE_CLASS:%.*]] = call i1 @llvm.is.fpclass.f16(half [[X:%.*]], i32 240)
; CHECK-NEXT: ret i1 [[IS_FINITE_CLASS]]
;
%fabs = call half @llvm.fabs.f16(half %x)
%is.subnormal = fcmp olt half %fabs, 0xH0400
Expand All @@ -189,8 +186,8 @@ define i1 @fcmp_issubnormal_and_class_finite(half %x) {

define i1 @class_inf_or_fcmp_issubnormal(half %x) {
; CHECK-LABEL: @class_inf_or_fcmp_issubnormal(
; CHECK-NEXT: [[OR:%.*]] = call i1 @llvm.is.fpclass.f16(half [[X:%.*]], i32 756)
; CHECK-NEXT: ret i1 [[OR]]
; CHECK-NEXT: [[IS_INF_CLASS:%.*]] = call i1 @llvm.is.fpclass.f16(half [[X:%.*]], i32 756)
; CHECK-NEXT: ret i1 [[IS_INF_CLASS]]
;
%fabs = call half @llvm.fabs.f16(half %x)
%is.subnormal = fcmp olt half %fabs, 0xH0400
Expand All @@ -202,9 +199,8 @@ define i1 @class_inf_or_fcmp_issubnormal(half %x) {
; -> isfinite
define <2 x i1> @class_finite_or_fcmp_issubnormal_vector(<2 x half> %x) {
; CHECK-LABEL: @class_finite_or_fcmp_issubnormal_vector(
; CHECK-NEXT: [[TMP1:%.*]] = call <2 x half> @llvm.fabs.v2f16(<2 x half> [[X:%.*]])
; CHECK-NEXT: [[OR:%.*]] = fcmp one <2 x half> [[TMP1]], <half 0xH7C00, half 0xH7C00>
; CHECK-NEXT: ret <2 x i1> [[OR]]
; CHECK-NEXT: [[IS_FINITE_CLASS:%.*]] = call <2 x i1> @llvm.is.fpclass.v2f16(<2 x half> [[X:%.*]], i32 504)
; CHECK-NEXT: ret <2 x i1> [[IS_FINITE_CLASS]]
;
%fabs = call <2 x half> @llvm.fabs.v2f16(<2 x half> %x)
%is.subnormal = fcmp olt <2 x half> %fabs, <half 0xH0400, half 0xH0400>
Expand Down
Loading