@@ -410,12 +410,14 @@ struct SDNodeFlags {
410410 NoFPExcept = 1 << 12 ,
411411 // Instructions with attached 'unpredictable' metadata on IR level.
412412 Unpredictable = 1 << 13 ,
413+ // Compare instructions which may carry the samesign flag.
414+ SameSign = 1 << 14 ,
413415
414416 // NOTE: Please update LargestValue in LLVM_DECLARE_ENUM_AS_BITMASK below
415417 // the class definition when adding new flags.
416418
417419 PoisonGeneratingFlags = NoUnsignedWrap | NoSignedWrap | Exact | Disjoint |
418- NonNeg | NoNaNs | NoInfs,
420+ NonNeg | NoNaNs | NoInfs | SameSign ,
419421 };
420422
421423 // / Default constructor turns off all optimization flags.
@@ -437,6 +439,7 @@ struct SDNodeFlags {
437439 void setNoSignedWrap (bool b) { setFlag<NoSignedWrap>(b); }
438440 void setExact (bool b) { setFlag<Exact>(b); }
439441 void setDisjoint (bool b) { setFlag<Disjoint>(b); }
442+ void setSameSign (bool b) { setFlag<SameSign>(b); }
440443 void setNonNeg (bool b) { setFlag<NonNeg>(b); }
441444 void setNoNaNs (bool b) { setFlag<NoNaNs>(b); }
442445 void setNoInfs (bool b) { setFlag<NoInfs>(b); }
@@ -453,6 +456,7 @@ struct SDNodeFlags {
453456 bool hasNoSignedWrap () const { return Flags & NoSignedWrap; }
454457 bool hasExact () const { return Flags & Exact; }
455458 bool hasDisjoint () const { return Flags & Disjoint; }
459+ bool hasSameSign () const { return Flags & SameSign; }
456460 bool hasNonNeg () const { return Flags & NonNeg; }
457461 bool hasNoNaNs () const { return Flags & NoNaNs; }
458462 bool hasNoInfs () const { return Flags & NoInfs; }
@@ -474,7 +478,7 @@ struct SDNodeFlags {
474478};
475479
476480LLVM_DECLARE_ENUM_AS_BITMASK (decltype (SDNodeFlags::None),
477- SDNodeFlags::Unpredictable );
481+ SDNodeFlags::SameSign );
478482
479483// / Represents one node in the SelectionDAG.
480484// /
0 commit comments