LLVM: lib/Analysis/ValueLattice.cpp Source File (original) (raw)

1

2

3

4

5

6

7

8

12

13namespace llvm {

18

20 return nullptr;

21

22

23

25 return nullptr;

26

30

32

39 }

40

41

42

44 return nullptr;

45

47 const auto &OtherCR = Other.getConstantRange();

48 if (CR.icmp(Pred, OtherCR))

52

53 return nullptr;

54}

55

62

63

64

65

66

67

68

69

70

71

72

73

74

75

76

77ValueLatticeElement

80 return *this;

81 if (Other.isUnknown())

83

84

87 if (Other.isOverdefined())

88 return *this;

89

90

92 return *this;

95

96

98

99 return *this;

100 }

101

102

105

106

109 Other.isConstantRangeIncludingUndef());

110}

111

114 return OS << "unknown";

116 return OS << "undef";

118 return OS << "overdefined";

119

121 return OS << "notconstant<" << *Val.getNotConstant() << ">";

122

124 return OS << "constantrange incl. undef <"

127

131 return OS << "constant<" << *Val.getConstant() << ">";

132}

133}

MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL

Predicate

This enumeration lists the possible predicates for CmpInst subclasses.

Predicate getInversePredicate() const

For example, EQ -> NE, UGT -> ULE, SLT -> SGE, OEQ -> UNE, UGT -> OLE, OLT -> UGE,...

static LLVM_ABI ConstantInt * getTrue(LLVMContext &Context)

static LLVM_ABI ConstantInt * getFalse(LLVMContext &Context)

This class represents a range of values.

const APInt & getLower() const

Return the lower value for this range.

bool isSingleElement() const

Return true if this set contains exactly one member.

const APInt & getUpper() const

Return the upper value for this range.

LLVM_ABI ConstantRange intersectWith(const ConstantRange &CR, PreferredRangeType Type=Smallest) const

Return the range that results from the intersection of this range with another range.

This is an important base class in LLVM.

A parsed version of the target data layout string in and methods for querying it.

static bool isEquality(Predicate P)

Return true if this predicate is either EQ or NE.

The instances of the Type class are immutable: once they are created, they are never changed.

This class represents lattice values for constants.

static ValueLatticeElement getRange(ConstantRange CR, bool MayIncludeUndef=false)

bool isOverdefined() const

LLVM_ABI Constant * getCompare(CmpInst::Predicate Pred, Type *Ty, const ValueLatticeElement &Other, const DataLayout &DL) const

true, false or undef constants, or nullptr if the comparison cannot be evaluated.

Definition ValueLattice.cpp:15

bool isConstantRangeIncludingUndef() const

bool isNotConstant() const

const ConstantRange & getConstantRange(bool UndefAllowed=true) const

Returns the constant range for this value.

bool isConstantRange(bool UndefAllowed=true) const

Returns true if this value is a constant range.

Constant * getNotConstant() const

LLVM_ABI ValueLatticeElement intersect(const ValueLatticeElement &Other) const

Combine two sets of facts about the same value into a single set of facts.

Definition ValueLattice.cpp:78

Constant * getConstant() const

This class implements an extremely fast bulk output stream that can only output to a stream.

This is an optimization pass for GlobalISel generic memory operations.

LLVM_ABI Constant * ConstantFoldCompareInstOperands(unsigned Predicate, Constant *LHS, Constant *RHS, const DataLayout &DL, const TargetLibraryInfo *TLI=nullptr, const Instruction *I=nullptr)

Attempt to constant fold a compare instruction (icmp/fcmp) with the specified operands.

raw_ostream & operator<<(raw_ostream &OS, const APFixedPoint &FX)

static bool hasSingleValue(const ValueLatticeElement &Val)

Definition ValueLattice.cpp:56