@@ -397,7 +397,7 @@ struct SDNodeFlags {
397397 Exact = 1 << 2 ,
398398 Disjoint = 1 << 3 ,
399399 NonNeg = 1 << 4 ,
400- NoNaNs = 1 << 5 ,
400+ // 1 << 5 was used as NoNaNs
401401 NoInfs = 1 << 6 ,
402402 NoSignedZeros = 1 << 7 ,
403403 AllowReciprocal = 1 << 8 ,
@@ -416,21 +416,27 @@ struct SDNodeFlags {
416416 // Compare instructions which may carry the samesign flag.
417417 SameSign = 1 << 14 ,
418418
419+ NoSNaNs = 1 << 15 ,
420+ NoQNaNs = 1 << 16 ,
421+
419422 // NOTE: Please update LargestValue in LLVM_DECLARE_ENUM_AS_BITMASK below
420423 // the class definition when adding new flags.
421424
422425 PoisonGeneratingFlags = NoUnsignedWrap | NoSignedWrap | Exact | Disjoint |
423426 NonNeg | NoNaNs | NoInfs | SameSign,
424- FastMathFlags = NoNaNs | NoInfs | NoSignedZeros | AllowReciprocal |
425- AllowContract | ApproximateFuncs | AllowReassociation,
427+ FastMathFlags = NoSNaNs | NoQNaNs | NoInfs | NoSignedZeros |
428+ AllowReciprocal | AllowContract | ApproximateFuncs |
429+ AllowReassociation,
430+ >>>>>>> 3a271aeff00e (SelectionDAG: Support nofpclass (nan/qnan/snan))
426431 };
427432
428433 // / Default constructor turns off all optimization flags.
429434 SDNodeFlags (unsigned Flags = SDNodeFlags::None) : Flags(Flags) {}
430435
431436 // / Propagate the fast-math-flags from an IR FPMathOperator.
432437 void copyFMF (const FPMathOperator &FPMO) {
433- setNoNaNs (FPMO.hasNoNaNs ());
438+ setNoSNaNs (FPMO.hasNoNaNs ());
439+ setNoQNaNs (FPMO.hasNoNaNs ());
434440 setNoInfs (FPMO.hasNoInfs ());
435441 setNoSignedZeros (FPMO.hasNoSignedZeros ());
436442 setAllowReciprocal (FPMO.hasAllowReciprocal ());
@@ -446,7 +452,12 @@ struct SDNodeFlags {
446452 void setDisjoint (bool b) { setFlag<Disjoint>(b); }
447453 void setSameSign (bool b) { setFlag<SameSign>(b); }
448454 void setNonNeg (bool b) { setFlag<NonNeg>(b); }
449- void setNoNaNs (bool b) { setFlag<NoNaNs>(b); }
455+ void setNoNaNs (bool b) {
456+ setFlag<NoSNaNs>(b);
457+ setFlag<NoQNaNs>(b);
458+ }
459+ void setNoSNaNs (bool b) { setFlag<NoSNaNs>(b); }
460+ void setNoQNaNs (bool b) { setFlag<NoQNaNs>(b); }
450461 void setNoInfs (bool b) { setFlag<NoInfs>(b); }
451462 void setNoSignedZeros (bool b) { setFlag<NoSignedZeros>(b); }
452463 void setAllowReciprocal (bool b) { setFlag<AllowReciprocal>(b); }
@@ -463,7 +474,9 @@ struct SDNodeFlags {
463474 bool hasDisjoint () const { return Flags & Disjoint; }
464475 bool hasSameSign () const { return Flags & SameSign; }
465476 bool hasNonNeg () const { return Flags & NonNeg; }
466- bool hasNoNaNs () const { return Flags & NoNaNs; }
477+ bool hasNoNaNs () const { return (Flags & NoSNaNs) && (Flags & NoQNaNs); }
478+ bool hasNoSNaNs () const { return Flags & NoSNaNs; }
479+ bool hasNoQNaNs () const { return Flags & NoQNaNs; }
467480 bool hasNoInfs () const { return Flags & NoInfs; }
468481 bool hasNoSignedZeros () const { return Flags & NoSignedZeros; }
469482 bool hasAllowReciprocal () const { return Flags & AllowReciprocal; }
0 commit comments