@@ -411,12 +411,14 @@ struct SDNodeFlags {
411411 NoFPExcept = 1 << 12 ,
412412 // Instructions with attached 'unpredictable' metadata on IR level.
413413 Unpredictable = 1 << 13 ,
414+ // Compare instructions which may carry the samesign flag.
415+ SameSign = 1 << 14 ,
414416
415417 // NOTE: Please update LargestValue in LLVM_DECLARE_ENUM_AS_BITMASK below
416418 // the class definition when adding new flags.
417419
418420 PoisonGeneratingFlags = NoUnsignedWrap | NoSignedWrap | Exact | Disjoint |
419- NonNeg | NoNaNs | NoInfs,
421+ NonNeg | NoNaNs | NoInfs | SameSign ,
420422 };
421423
422424 // / Default constructor turns off all optimization flags.
@@ -438,6 +440,7 @@ struct SDNodeFlags {
438440 void setNoSignedWrap (bool b) { setFlag<NoSignedWrap>(b); }
439441 void setExact (bool b) { setFlag<Exact>(b); }
440442 void setDisjoint (bool b) { setFlag<Disjoint>(b); }
443+ void setSameSign (bool b) { setFlag<SameSign>(b); }
441444 void setNonNeg (bool b) { setFlag<NonNeg>(b); }
442445 void setNoNaNs (bool b) { setFlag<NoNaNs>(b); }
443446 void setNoInfs (bool b) { setFlag<NoInfs>(b); }
@@ -454,6 +457,7 @@ struct SDNodeFlags {
454457 bool hasNoSignedWrap () const { return Flags & NoSignedWrap; }
455458 bool hasExact () const { return Flags & Exact; }
456459 bool hasDisjoint () const { return Flags & Disjoint; }
460+ bool hasSameSign () const { return Flags & SameSign; }
457461 bool hasNonNeg () const { return Flags & NonNeg; }
458462 bool hasNoNaNs () const { return Flags & NoNaNs; }
459463 bool hasNoInfs () const { return Flags & NoInfs; }
@@ -473,7 +477,7 @@ struct SDNodeFlags {
473477};
474478
475479LLVM_DECLARE_ENUM_AS_BITMASK (decltype (SDNodeFlags::None),
476- SDNodeFlags::Unpredictable );
480+ SDNodeFlags::SameSign );
477481
478482inline SDNodeFlags operator |(SDNodeFlags LHS, SDNodeFlags RHS) {
479483 LHS |= RHS;
0 commit comments