Skip to content

Commit a646e87

Browse files
committed
Revert "InstCombine: Fold is.fpclass(x, fcInf) to fabs+fcmp"
This reverts commit 2b58244.
1 parent 1dc715a commit a646e87

File tree

7 files changed

+72
-125
lines changed

7 files changed

+72
-125
lines changed

clang/test/CodeGen/isfpclass.c

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,8 @@
44
// CHECK-LABEL: define dso_local i1 @check_isfpclass_finite
55
// CHECK-SAME: (float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR0:[0-9]+]] {
66
// CHECK-NEXT: entry:
7-
// CHECK-NEXT: [[TMP0:%.*]] = tail call float @llvm.fabs.f32(float [[X]])
8-
// CHECK-NEXT: [[TMP1:%.*]] = fcmp one float [[TMP0]], 0x7FF0000000000000
9-
// CHECK-NEXT: ret i1 [[TMP1]]
7+
// CHECK-NEXT: [[TMP0:%.*]] = tail call i1 @llvm.is.fpclass.f32(float [[X]], i32 504)
8+
// CHECK-NEXT: ret i1 [[TMP0]]
109
//
1110
_Bool check_isfpclass_finite(float x) {
1211
return __builtin_isfpclass(x, 504 /*Finite*/);
@@ -15,7 +14,7 @@ _Bool check_isfpclass_finite(float x) {
1514
// CHECK-LABEL: define dso_local i1 @check_isfpclass_finite_strict
1615
// CHECK-SAME: (float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR2:[0-9]+]] {
1716
// CHECK-NEXT: entry:
18-
// CHECK-NEXT: [[TMP0:%.*]] = tail call i1 @llvm.is.fpclass.f32(float [[X]], i32 504) #[[ATTR6:[0-9]+]]
17+
// CHECK-NEXT: [[TMP0:%.*]] = tail call i1 @llvm.is.fpclass.f32(float [[X]], i32 504) #[[ATTR5:[0-9]+]]
1918
// CHECK-NEXT: ret i1 [[TMP0]]
2019
//
2120
_Bool check_isfpclass_finite_strict(float x) {
@@ -36,7 +35,7 @@ _Bool check_isfpclass_nan_f32(float x) {
3635
// CHECK-LABEL: define dso_local i1 @check_isfpclass_nan_f32_strict
3736
// CHECK-SAME: (float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR2]] {
3837
// CHECK-NEXT: entry:
39-
// CHECK-NEXT: [[TMP0:%.*]] = tail call i1 @llvm.is.fpclass.f32(float [[X]], i32 3) #[[ATTR6]]
38+
// CHECK-NEXT: [[TMP0:%.*]] = tail call i1 @llvm.is.fpclass.f32(float [[X]], i32 3) #[[ATTR5]]
4039
// CHECK-NEXT: ret i1 [[TMP0]]
4140
//
4241
_Bool check_isfpclass_nan_f32_strict(float x) {
@@ -57,7 +56,7 @@ _Bool check_isfpclass_snan_f64(double x) {
5756
// CHECK-LABEL: define dso_local i1 @check_isfpclass_snan_f64_strict
5857
// CHECK-SAME: (double noundef [[X:%.*]]) local_unnamed_addr #[[ATTR2]] {
5958
// CHECK-NEXT: entry:
60-
// CHECK-NEXT: [[TMP0:%.*]] = tail call i1 @llvm.is.fpclass.f64(double [[X]], i32 1) #[[ATTR6]]
59+
// CHECK-NEXT: [[TMP0:%.*]] = tail call i1 @llvm.is.fpclass.f64(double [[X]], i32 1) #[[ATTR5]]
6160
// CHECK-NEXT: ret i1 [[TMP0]]
6261
//
6362
_Bool check_isfpclass_snan_f64_strict(double x) {
@@ -78,7 +77,7 @@ _Bool check_isfpclass_zero_f16(_Float16 x) {
7877
// CHECK-LABEL: define dso_local i1 @check_isfpclass_zero_f16_strict
7978
// CHECK-SAME: (half noundef [[X:%.*]]) local_unnamed_addr #[[ATTR2]] {
8079
// CHECK-NEXT: entry:
81-
// CHECK-NEXT: [[TMP0:%.*]] = tail call i1 @llvm.is.fpclass.f16(half [[X]], i32 96) #[[ATTR6]]
80+
// CHECK-NEXT: [[TMP0:%.*]] = tail call i1 @llvm.is.fpclass.f16(half [[X]], i32 96) #[[ATTR5]]
8281
// CHECK-NEXT: ret i1 [[TMP0]]
8382
//
8483
_Bool check_isfpclass_zero_f16_strict(_Float16 x) {
@@ -89,7 +88,7 @@ _Bool check_isfpclass_zero_f16_strict(_Float16 x) {
8988
// CHECK-LABEL: define dso_local i1 @check_isnan
9089
// CHECK-SAME: (float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR2]] {
9190
// CHECK-NEXT: entry:
92-
// CHECK-NEXT: [[TMP0:%.*]] = tail call i1 @llvm.is.fpclass.f32(float [[X]], i32 3) #[[ATTR6]]
91+
// CHECK-NEXT: [[TMP0:%.*]] = tail call i1 @llvm.is.fpclass.f32(float [[X]], i32 3) #[[ATTR5]]
9392
// CHECK-NEXT: ret i1 [[TMP0]]
9493
//
9594
_Bool check_isnan(float x) {
@@ -100,7 +99,7 @@ _Bool check_isnan(float x) {
10099
// CHECK-LABEL: define dso_local i1 @check_isinf
101100
// CHECK-SAME: (float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR2]] {
102101
// CHECK-NEXT: entry:
103-
// CHECK-NEXT: [[TMP0:%.*]] = tail call i1 @llvm.is.fpclass.f32(float [[X]], i32 516) #[[ATTR6]]
102+
// CHECK-NEXT: [[TMP0:%.*]] = tail call i1 @llvm.is.fpclass.f32(float [[X]], i32 516) #[[ATTR5]]
104103
// CHECK-NEXT: ret i1 [[TMP0]]
105104
//
106105
_Bool check_isinf(float x) {
@@ -111,7 +110,7 @@ _Bool check_isinf(float x) {
111110
// CHECK-LABEL: define dso_local i1 @check_isfinite
112111
// CHECK-SAME: (float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR2]] {
113112
// CHECK-NEXT: entry:
114-
// CHECK-NEXT: [[TMP0:%.*]] = tail call i1 @llvm.is.fpclass.f32(float [[X]], i32 504) #[[ATTR6]]
113+
// CHECK-NEXT: [[TMP0:%.*]] = tail call i1 @llvm.is.fpclass.f32(float [[X]], i32 504) #[[ATTR5]]
115114
// CHECK-NEXT: ret i1 [[TMP0]]
116115
//
117116
_Bool check_isfinite(float x) {
@@ -122,7 +121,7 @@ _Bool check_isfinite(float x) {
122121
// CHECK-LABEL: define dso_local i1 @check_isnormal
123122
// CHECK-SAME: (float noundef [[X:%.*]]) local_unnamed_addr #[[ATTR2]] {
124123
// CHECK-NEXT: entry:
125-
// CHECK-NEXT: [[TMP0:%.*]] = tail call i1 @llvm.is.fpclass.f32(float [[X]], i32 264) #[[ATTR6]]
124+
// CHECK-NEXT: [[TMP0:%.*]] = tail call i1 @llvm.is.fpclass.f32(float [[X]], i32 264) #[[ATTR5]]
126125
// CHECK-NEXT: ret i1 [[TMP0]]
127126
//
128127
_Bool check_isnormal(float x) {
@@ -150,7 +149,7 @@ int4 check_isfpclass_nan_v4f32(float4 x) {
150149
// CHECK-LABEL: define dso_local <4 x i32> @check_isfpclass_nan_strict_v4f32
151150
// CHECK-SAME: (<4 x float> noundef [[X:%.*]]) local_unnamed_addr #[[ATTR2]] {
152151
// CHECK-NEXT: entry:
153-
// CHECK-NEXT: [[TMP0:%.*]] = tail call <4 x i1> @llvm.is.fpclass.v4f32(<4 x float> [[X]], i32 3) #[[ATTR6]]
152+
// CHECK-NEXT: [[TMP0:%.*]] = tail call <4 x i1> @llvm.is.fpclass.v4f32(<4 x float> [[X]], i32 3) #[[ATTR5]]
154153
// CHECK-NEXT: [[TMP1:%.*]] = zext <4 x i1> [[TMP0]] to <4 x i32>
155154
// CHECK-NEXT: ret <4 x i32> [[TMP1]]
156155
//

clang/test/Headers/__clang_hip_math.hip

Lines changed: 16 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1461,9 +1461,8 @@ extern "C" __device__ int test_ilogb(double x) {
14611461

14621462
// DEFAULT-LABEL: @test___finitef(
14631463
// DEFAULT-NEXT: entry:
1464-
// DEFAULT-NEXT: [[TMP0:%.*]] = tail call float @llvm.fabs.f32(float [[X:%.*]])
1465-
// DEFAULT-NEXT: [[TMP1:%.*]] = fcmp one float [[TMP0]], 0x7FF0000000000000
1466-
// DEFAULT-NEXT: [[CONV:%.*]] = zext i1 [[TMP1]] to i32
1464+
// DEFAULT-NEXT: [[TMP0:%.*]] = tail call noundef i1 @llvm.is.fpclass.f32(float [[X:%.*]], i32 504)
1465+
// DEFAULT-NEXT: [[CONV:%.*]] = zext i1 [[TMP0]] to i32
14671466
// DEFAULT-NEXT: ret i32 [[CONV]]
14681467
//
14691468
// FINITEONLY-LABEL: @test___finitef(
@@ -1472,9 +1471,8 @@ extern "C" __device__ int test_ilogb(double x) {
14721471
//
14731472
// APPROX-LABEL: @test___finitef(
14741473
// APPROX-NEXT: entry:
1475-
// APPROX-NEXT: [[TMP0:%.*]] = tail call float @llvm.fabs.f32(float [[X:%.*]])
1476-
// APPROX-NEXT: [[TMP1:%.*]] = fcmp one float [[TMP0]], 0x7FF0000000000000
1477-
// APPROX-NEXT: [[CONV:%.*]] = zext i1 [[TMP1]] to i32
1474+
// APPROX-NEXT: [[TMP0:%.*]] = tail call noundef i1 @llvm.is.fpclass.f32(float [[X:%.*]], i32 504)
1475+
// APPROX-NEXT: [[CONV:%.*]] = zext i1 [[TMP0]] to i32
14781476
// APPROX-NEXT: ret i32 [[CONV]]
14791477
//
14801478
extern "C" __device__ BOOL_TYPE test___finitef(float x) {
@@ -1483,9 +1481,8 @@ extern "C" __device__ BOOL_TYPE test___finitef(float x) {
14831481

14841482
// DEFAULT-LABEL: @test___finite(
14851483
// DEFAULT-NEXT: entry:
1486-
// DEFAULT-NEXT: [[TMP0:%.*]] = tail call double @llvm.fabs.f64(double [[X:%.*]])
1487-
// DEFAULT-NEXT: [[TMP1:%.*]] = fcmp one double [[TMP0]], 0x7FF0000000000000
1488-
// DEFAULT-NEXT: [[CONV:%.*]] = zext i1 [[TMP1]] to i32
1484+
// DEFAULT-NEXT: [[TMP0:%.*]] = tail call noundef i1 @llvm.is.fpclass.f64(double [[X:%.*]], i32 504)
1485+
// DEFAULT-NEXT: [[CONV:%.*]] = zext i1 [[TMP0]] to i32
14891486
// DEFAULT-NEXT: ret i32 [[CONV]]
14901487
//
14911488
// FINITEONLY-LABEL: @test___finite(
@@ -1494,9 +1491,8 @@ extern "C" __device__ BOOL_TYPE test___finitef(float x) {
14941491
//
14951492
// APPROX-LABEL: @test___finite(
14961493
// APPROX-NEXT: entry:
1497-
// APPROX-NEXT: [[TMP0:%.*]] = tail call double @llvm.fabs.f64(double [[X:%.*]])
1498-
// APPROX-NEXT: [[TMP1:%.*]] = fcmp one double [[TMP0]], 0x7FF0000000000000
1499-
// APPROX-NEXT: [[CONV:%.*]] = zext i1 [[TMP1]] to i32
1494+
// APPROX-NEXT: [[TMP0:%.*]] = tail call noundef i1 @llvm.is.fpclass.f64(double [[X:%.*]], i32 504)
1495+
// APPROX-NEXT: [[CONV:%.*]] = zext i1 [[TMP0]] to i32
15001496
// APPROX-NEXT: ret i32 [[CONV]]
15011497
//
15021498
extern "C" __device__ BOOL_TYPE test___finite(double x) {
@@ -1505,9 +1501,8 @@ extern "C" __device__ BOOL_TYPE test___finite(double x) {
15051501

15061502
// DEFAULT-LABEL: @test___isinff(
15071503
// DEFAULT-NEXT: entry:
1508-
// DEFAULT-NEXT: [[TMP0:%.*]] = tail call float @llvm.fabs.f32(float [[X:%.*]])
1509-
// DEFAULT-NEXT: [[TMP1:%.*]] = fcmp oeq float [[TMP0]], 0x7FF0000000000000
1510-
// DEFAULT-NEXT: [[CONV:%.*]] = zext i1 [[TMP1]] to i32
1504+
// DEFAULT-NEXT: [[TMP0:%.*]] = tail call noundef i1 @llvm.is.fpclass.f32(float [[X:%.*]], i32 516)
1505+
// DEFAULT-NEXT: [[CONV:%.*]] = zext i1 [[TMP0]] to i32
15111506
// DEFAULT-NEXT: ret i32 [[CONV]]
15121507
//
15131508
// FINITEONLY-LABEL: @test___isinff(
@@ -1516,9 +1511,8 @@ extern "C" __device__ BOOL_TYPE test___finite(double x) {
15161511
//
15171512
// APPROX-LABEL: @test___isinff(
15181513
// APPROX-NEXT: entry:
1519-
// APPROX-NEXT: [[TMP0:%.*]] = tail call float @llvm.fabs.f32(float [[X:%.*]])
1520-
// APPROX-NEXT: [[TMP1:%.*]] = fcmp oeq float [[TMP0]], 0x7FF0000000000000
1521-
// APPROX-NEXT: [[CONV:%.*]] = zext i1 [[TMP1]] to i32
1514+
// APPROX-NEXT: [[TMP0:%.*]] = tail call noundef i1 @llvm.is.fpclass.f32(float [[X:%.*]], i32 516)
1515+
// APPROX-NEXT: [[CONV:%.*]] = zext i1 [[TMP0]] to i32
15221516
// APPROX-NEXT: ret i32 [[CONV]]
15231517
//
15241518
extern "C" __device__ BOOL_TYPE test___isinff(float x) {
@@ -1527,9 +1521,8 @@ extern "C" __device__ BOOL_TYPE test___isinff(float x) {
15271521

15281522
// DEFAULT-LABEL: @test___isinf(
15291523
// DEFAULT-NEXT: entry:
1530-
// DEFAULT-NEXT: [[TMP0:%.*]] = tail call double @llvm.fabs.f64(double [[X:%.*]])
1531-
// DEFAULT-NEXT: [[TMP1:%.*]] = fcmp oeq double [[TMP0]], 0x7FF0000000000000
1532-
// DEFAULT-NEXT: [[CONV:%.*]] = zext i1 [[TMP1]] to i32
1524+
// DEFAULT-NEXT: [[TMP0:%.*]] = tail call noundef i1 @llvm.is.fpclass.f64(double [[X:%.*]], i32 516)
1525+
// DEFAULT-NEXT: [[CONV:%.*]] = zext i1 [[TMP0]] to i32
15331526
// DEFAULT-NEXT: ret i32 [[CONV]]
15341527
//
15351528
// FINITEONLY-LABEL: @test___isinf(
@@ -1538,9 +1531,8 @@ extern "C" __device__ BOOL_TYPE test___isinff(float x) {
15381531
//
15391532
// APPROX-LABEL: @test___isinf(
15401533
// APPROX-NEXT: entry:
1541-
// APPROX-NEXT: [[TMP0:%.*]] = tail call double @llvm.fabs.f64(double [[X:%.*]])
1542-
// APPROX-NEXT: [[TMP1:%.*]] = fcmp oeq double [[TMP0]], 0x7FF0000000000000
1543-
// APPROX-NEXT: [[CONV:%.*]] = zext i1 [[TMP1]] to i32
1534+
// APPROX-NEXT: [[TMP0:%.*]] = tail call noundef i1 @llvm.is.fpclass.f64(double [[X:%.*]], i32 516)
1535+
// APPROX-NEXT: [[CONV:%.*]] = zext i1 [[TMP0]] to i32
15441536
// APPROX-NEXT: ret i32 [[CONV]]
15451537
//
15461538
extern "C" __device__ BOOL_TYPE test___isinf(double x) {

llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -931,24 +931,6 @@ Instruction *InstCombinerImpl::foldIntrinsicIsFPClass(IntrinsicInst &II) {
931931
return replaceOperand(II, 0, FAbsSrc);
932932
}
933933

934-
if ((OrderedMask == fcInf || OrderedInvertedMask == fcInf) &&
935-
(IsOrdered || IsUnordered) && !IsStrict) {
936-
// is.fpclass(x, fcInf) -> fcmp oeq fabs(x), +inf
937-
// is.fpclass(x, ~fcInf) -> fcmp one fabs(x), +inf
938-
// is.fpclass(x, fcInf|fcNan) -> fcmp ueq fabs(x), +inf
939-
// is.fpclass(x, ~(fcInf|fcNan)) -> fcmp une fabs(x), +inf
940-
Constant *Inf = ConstantFP::getInfinity(Src0->getType());
941-
FCmpInst::Predicate Pred =
942-
IsUnordered ? FCmpInst::FCMP_UEQ : FCmpInst::FCMP_OEQ;
943-
if (OrderedInvertedMask == fcInf)
944-
Pred = IsUnordered ? FCmpInst::FCMP_UNE : FCmpInst::FCMP_ONE;
945-
946-
Value *Fabs = Builder.CreateUnaryIntrinsic(Intrinsic::fabs, Src0);
947-
Value *CmpInf = Builder.CreateFCmp(Pred, Fabs, Inf);
948-
CmpInf->takeName(&II);
949-
return replaceInstUsesWith(II, CmpInf);
950-
}
951-
952934
if ((OrderedMask == fcPosInf || OrderedMask == fcNegInf) &&
953935
(IsOrdered || IsUnordered) && !IsStrict) {
954936
// is.fpclass(x, fcPosInf) -> fcmp oeq x, +inf

llvm/test/Transforms/InstCombine/and-fcmp.ll

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4794,8 +4794,7 @@ define i1 @clang_builtin_isnormal_inf_check_ord(half %x) {
47944794

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

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

48364834
define i1 @clang_builtin_isnormal_inf_check_oeq(half %x) {
48374835
; CHECK-LABEL: @clang_builtin_isnormal_inf_check_oeq(
4838-
; CHECK-NEXT: [[TMP1:%.*]] = call half @llvm.fabs.f16(half [[X:%.*]])
4839-
; CHECK-NEXT: [[AND:%.*]] = fcmp oeq half [[TMP1]], 0xH7C00
4836+
; CHECK-NEXT: [[AND:%.*]] = call i1 @llvm.is.fpclass.f16(half [[X:%.*]], i32 516)
48404837
; CHECK-NEXT: ret i1 [[AND]]
48414838
;
48424839
%fabs.x = call half @llvm.fabs.f16(half %x)

llvm/test/Transforms/InstCombine/combine-is.fpclass-and-fcmp.ll

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,7 @@ define i1 @fcmp_isfinite_and_class_subnormal(half %x) {
135135

136136
define i1 @fcmp_isfinite_or_class_subnormal(half %x) {
137137
; CHECK-LABEL: @fcmp_isfinite_or_class_subnormal(
138-
; CHECK-NEXT: [[TMP1:%.*]] = call half @llvm.fabs.f16(half [[X:%.*]])
139-
; CHECK-NEXT: [[SUBNORMAL_CLASS:%.*]] = fcmp one half [[TMP1]], 0xH7C00
138+
; CHECK-NEXT: [[SUBNORMAL_CLASS:%.*]] = call i1 @llvm.is.fpclass.f16(half [[X:%.*]], i32 504)
140139
; CHECK-NEXT: ret i1 [[SUBNORMAL_CLASS]]
141140
;
142141
%fabs = call half @llvm.fabs.f16(half %x)
@@ -149,9 +148,8 @@ define i1 @fcmp_isfinite_or_class_subnormal(half %x) {
149148
; -> isfinite
150149
define i1 @fcmp_issubnormal_or_class_finite(half %x) {
151150
; CHECK-LABEL: @fcmp_issubnormal_or_class_finite(
152-
; CHECK-NEXT: [[TMP1:%.*]] = call half @llvm.fabs.f16(half [[X:%.*]])
153-
; CHECK-NEXT: [[OR:%.*]] = fcmp one half [[TMP1]], 0xH7C00
154-
; CHECK-NEXT: ret i1 [[OR]]
151+
; CHECK-NEXT: [[IS_FINITE_CLASS:%.*]] = call i1 @llvm.is.fpclass.f16(half [[X:%.*]], i32 504)
152+
; CHECK-NEXT: ret i1 [[IS_FINITE_CLASS]]
155153
;
156154
%fabs = call half @llvm.fabs.f16(half %x)
157155
%is.subnormal = fcmp olt half %fabs, 0xH0400
@@ -163,9 +161,8 @@ define i1 @fcmp_issubnormal_or_class_finite(half %x) {
163161
; -> isfinite
164162
define i1 @class_finite_or_fcmp_issubnormal(half %x) {
165163
; CHECK-LABEL: @class_finite_or_fcmp_issubnormal(
166-
; CHECK-NEXT: [[TMP1:%.*]] = call half @llvm.fabs.f16(half [[X:%.*]])
167-
; CHECK-NEXT: [[OR:%.*]] = fcmp one half [[TMP1]], 0xH7C00
168-
; CHECK-NEXT: ret i1 [[OR]]
164+
; CHECK-NEXT: [[IS_FINITE_CLASS:%.*]] = call i1 @llvm.is.fpclass.f16(half [[X:%.*]], i32 504)
165+
; CHECK-NEXT: ret i1 [[IS_FINITE_CLASS]]
169166
;
170167
%fabs = call half @llvm.fabs.f16(half %x)
171168
%is.subnormal = fcmp olt half %fabs, 0xH0400
@@ -177,8 +174,8 @@ define i1 @class_finite_or_fcmp_issubnormal(half %x) {
177174
; -> issubnormal
178175
define i1 @fcmp_issubnormal_and_class_finite(half %x) {
179176
; CHECK-LABEL: @fcmp_issubnormal_and_class_finite(
180-
; CHECK-NEXT: [[AND:%.*]] = call i1 @llvm.is.fpclass.f16(half [[X:%.*]], i32 240)
181-
; CHECK-NEXT: ret i1 [[AND]]
177+
; CHECK-NEXT: [[IS_FINITE_CLASS:%.*]] = call i1 @llvm.is.fpclass.f16(half [[X:%.*]], i32 240)
178+
; CHECK-NEXT: ret i1 [[IS_FINITE_CLASS]]
182179
;
183180
%fabs = call half @llvm.fabs.f16(half %x)
184181
%is.subnormal = fcmp olt half %fabs, 0xH0400
@@ -189,8 +186,8 @@ define i1 @fcmp_issubnormal_and_class_finite(half %x) {
189186

190187
define i1 @class_inf_or_fcmp_issubnormal(half %x) {
191188
; CHECK-LABEL: @class_inf_or_fcmp_issubnormal(
192-
; CHECK-NEXT: [[OR:%.*]] = call i1 @llvm.is.fpclass.f16(half [[X:%.*]], i32 756)
193-
; CHECK-NEXT: ret i1 [[OR]]
189+
; CHECK-NEXT: [[IS_INF_CLASS:%.*]] = call i1 @llvm.is.fpclass.f16(half [[X:%.*]], i32 756)
190+
; CHECK-NEXT: ret i1 [[IS_INF_CLASS]]
194191
;
195192
%fabs = call half @llvm.fabs.f16(half %x)
196193
%is.subnormal = fcmp olt half %fabs, 0xH0400
@@ -202,9 +199,8 @@ define i1 @class_inf_or_fcmp_issubnormal(half %x) {
202199
; -> isfinite
203200
define <2 x i1> @class_finite_or_fcmp_issubnormal_vector(<2 x half> %x) {
204201
; CHECK-LABEL: @class_finite_or_fcmp_issubnormal_vector(
205-
; CHECK-NEXT: [[TMP1:%.*]] = call <2 x half> @llvm.fabs.v2f16(<2 x half> [[X:%.*]])
206-
; CHECK-NEXT: [[OR:%.*]] = fcmp one <2 x half> [[TMP1]], <half 0xH7C00, half 0xH7C00>
207-
; CHECK-NEXT: ret <2 x i1> [[OR]]
202+
; CHECK-NEXT: [[IS_FINITE_CLASS:%.*]] = call <2 x i1> @llvm.is.fpclass.v2f16(<2 x half> [[X:%.*]], i32 504)
203+
; CHECK-NEXT: ret <2 x i1> [[IS_FINITE_CLASS]]
208204
;
209205
%fabs = call <2 x half> @llvm.fabs.v2f16(<2 x half> %x)
210206
%is.subnormal = fcmp olt <2 x half> %fabs, <half 0xH0400, half 0xH0400>

0 commit comments

Comments
 (0)