File tree 2 files changed +10
-15
lines changed
test/Transforms/InstSimplify
2 files changed +10
-15
lines changed Original file line number Diff line number Diff line change @@ -157,17 +157,6 @@ struct match_any_zero {
157
157
// / floating point constants, this will match negative zero and positive zero
158
158
inline match_any_zero m_AnyZero () { return match_any_zero (); }
159
159
160
- struct match_nan {
161
- template <typename ITy> bool match (ITy *V) {
162
- if (const auto *C = dyn_cast<Constant>(V))
163
- return C->isNaN ();
164
- return false ;
165
- }
166
- };
167
-
168
- // / Match an arbitrary NaN constant. This includes quiet and signalling nans.
169
- inline match_nan m_NaN () { return match_nan (); }
170
-
171
160
struct apint_match {
172
161
const APInt *&Res;
173
162
@@ -422,6 +411,14 @@ inline cstfp_pred_ty<is_neg_zero> m_NegZero() {
422
411
return cstfp_pred_ty<is_neg_zero>();
423
412
}
424
413
414
+ struct is_nan {
415
+ bool isValue (const APFloat &C) { return C.isNaN (); }
416
+ };
417
+ // Match an arbitrary NaN constant. This includes quiet and signalling nans.
418
+ inline cstfp_pred_ty<is_nan> m_NaN () {
419
+ return cstfp_pred_ty<is_nan>();
420
+ }
421
+
425
422
// /////////////////////////////////////////////////////////////////////////////
426
423
427
424
template <typename Class> struct bind_ty {
Original file line number Diff line number Diff line change @@ -356,17 +356,15 @@ define <2 x i1> @orderedCompareWithNaNVector(<2 x double> %A) {
356
356
357
357
define <2 x i1 > @orderedCompareWithNaNVector_undef_elt (<2 x double > %A ) {
358
358
; CHECK-LABEL: @orderedCompareWithNaNVector_undef_elt(
359
- ; CHECK-NEXT: [[CMP:%.*]] = fcmp olt <2 x double> [[A:%.*]], <double 0xFFFFFFFFFFFFFFFF, double undef>
360
- ; CHECK-NEXT: ret <2 x i1> [[CMP]]
359
+ ; CHECK-NEXT: ret <2 x i1> zeroinitializer
361
360
;
362
361
%cmp = fcmp olt <2 x double > %A , <double 0xFFFFFFFFFFFFFFFF , double undef >
363
362
ret <2 x i1 > %cmp
364
363
}
365
364
366
365
define <2 x i1 > @unorderedCompareWithNaNVector_undef_elt (<2 x double > %A ) {
367
366
; CHECK-LABEL: @unorderedCompareWithNaNVector_undef_elt(
368
- ; CHECK-NEXT: [[CMP:%.*]] = fcmp ult <2 x double> [[A:%.*]], <double undef, double 0xFFFFFFFFFFFFFFFF>
369
- ; CHECK-NEXT: ret <2 x i1> [[CMP]]
367
+ ; CHECK-NEXT: ret <2 x i1> <i1 true, i1 true>
370
368
;
371
369
%cmp = fcmp ult <2 x double > %A , <double undef , double 0xFFFFFFFFFFFFFFFF >
372
370
ret <2 x i1 > %cmp
You can’t perform that action at this time.
0 commit comments