class ValueLatticeElement

Declaration

class ValueLatticeElement { /* full declaration omitted */ };

Description

This class represents lattice values for constants. FIXME: This is basically just for bringup, this can be made a lot more rich in the future.

Declared at: llvm/include/llvm/Analysis/ValueLattice.h:29

Member Variables

private llvm::ValueLatticeElement::ValueLatticeElementTy Tag
private unsigned int NumRangeExtensions
Number of times a constant range has been extended with widening enabled.
private anonymous struct / union

Method Overview

Methods

ValueLatticeElement()

Declared at: llvm/include/llvm/Analysis/ValueLattice.h:148

ValueLatticeElement(
    const llvm::ValueLatticeElement& Other)

Declared at: llvm/include/llvm/Analysis/ValueLattice.h:152

Parameters

const llvm::ValueLatticeElement& Other

ValueLatticeElement(
    llvm::ValueLatticeElement&& Other)

Declared at: llvm/include/llvm/Analysis/ValueLattice.h:171

Parameters

llvm::ValueLatticeElement&& Other

Optional<llvm::APInt> asConstantInteger() const

Declared at: llvm/include/llvm/Analysis/ValueLattice.h:278

void destroy()

Description

Destroy contents of lattice value, without destructing the object.

Declared at: llvm/include/llvm/Analysis/ValueLattice.h:94

static llvm::ValueLatticeElement get(
    llvm::Constant* C)

Declared at: llvm/include/llvm/Analysis/ValueLattice.h:203

Parameters

llvm::Constant* C

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

Description

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

Declared at: llvm/include/llvm/Analysis/ValueLattice.h:454

Parameters

CmpInst::Predicate Pred
llvm::Type* Ty
const llvm::ValueLatticeElement& Other

llvm::Constant* getConstant() const

Declared at: llvm/include/llvm/Analysis/ValueLattice.h:258

const llvm::ConstantRange& getConstantRange(
    bool UndefAllowed = true) const

Description

Returns the constant range for this value. Use \p UndefAllowed to exclude non-singleton constant ranges that may also be undef. Note that this function also returns a range if the range may include undef, but only contains a single element. In that case, it can be replaced by a constant.

Declared at: llvm/include/llvm/Analysis/ValueLattice.h:272

Parameters

bool UndefAllowed = true

static llvm::ValueLatticeElement getNot(
    llvm::Constant* C)

Declared at: llvm/include/llvm/Analysis/ValueLattice.h:211

Parameters

llvm::Constant* C

llvm::Constant* getNotConstant() const

Declared at: llvm/include/llvm/Analysis/ValueLattice.h:263

unsigned int getNumRangeExtensions() const

Declared at: llvm/include/llvm/Analysis/ValueLattice.h:487

static llvm::ValueLatticeElement getOverdefined()

Declared at: llvm/include/llvm/Analysis/ValueLattice.h:234

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

Declared at: llvm/include/llvm/Analysis/ValueLattice.h:217

Parameters

llvm::ConstantRange CR
bool MayIncludeUndef = false

bool isConstant() const

Declared at: llvm/include/llvm/Analysis/ValueLattice.h:243

bool isConstantRange(
    bool UndefAllowed = true) const

Description

Returns true if this value is a constant range. Use \p UndefAllowed to exclude non-singleton constant ranges that may also be undef. Note that this function also returns true if the range may include undef, but only contains a single element. In that case, it can be replaced by a constant.

Declared at: llvm/include/llvm/Analysis/ValueLattice.h:252

Parameters

bool UndefAllowed = true

bool isConstantRangeIncludingUndef() const

Declared at: llvm/include/llvm/Analysis/ValueLattice.h:245

bool isNotConstant() const

Declared at: llvm/include/llvm/Analysis/ValueLattice.h:244

bool isOverdefined() const

Declared at: llvm/include/llvm/Analysis/ValueLattice.h:256

bool isUndef() const

Declared at: llvm/include/llvm/Analysis/ValueLattice.h:240

bool isUnknown() const

Declared at: llvm/include/llvm/Analysis/ValueLattice.h:241

bool isUnknownOrUndef() const

Declared at: llvm/include/llvm/Analysis/ValueLattice.h:242

bool markConstant(llvm::Constant* V,
                  bool MayIncludeUndef = false)

Declared at: llvm/include/llvm/Analysis/ValueLattice.h:304

Parameters

llvm::Constant* V
bool MayIncludeUndef = false

bool markConstantRange(
    llvm::ConstantRange NewR,
    llvm::ValueLatticeElement::MergeOptions Opts =
        llvm::ValueLatticeElement::MergeOptions())

Description

Mark the object as constant range with \p NewR. If the object is already a constant range, nothing changes if the existing range is equal to \p NewR and the tag. Otherwise \p NewR must be a superset of the existing range or the object must be undef. The tag is set to constant_range_including_undef if either the existing value or the new range may include undef.

Declared at: llvm/include/llvm/Analysis/ValueLattice.h:350

Parameters

llvm::ConstantRange NewR
llvm::ValueLatticeElement::MergeOptions Opts = llvm::ValueLatticeElement::MergeOptions()

bool markNotConstant(llvm::Constant* V)

Declared at: llvm/include/llvm/Analysis/ValueLattice.h:324

Parameters

llvm::Constant* V

bool markOverdefined()

Declared at: llvm/include/llvm/Analysis/ValueLattice.h:287

bool markUndef()

Declared at: llvm/include/llvm/Analysis/ValueLattice.h:295

bool mergeIn(
    const llvm::ValueLatticeElement& RHS,
    llvm::ValueLatticeElement::MergeOptions Opts =
        llvm::ValueLatticeElement::MergeOptions())

Description

Updates this object to approximate both this object and RHS. Returns true if this object has been changed.

Declared at: llvm/include/llvm/Analysis/ValueLattice.h:388

Parameters

const llvm::ValueLatticeElement& RHS
llvm::ValueLatticeElement::MergeOptions Opts = llvm::ValueLatticeElement::MergeOptions()

void setNumRangeExtensions(unsigned int N)

Declared at: llvm/include/llvm/Analysis/ValueLattice.h:488

Parameters

unsigned int N

~ValueLatticeElement()

Declared at: llvm/include/llvm/Analysis/ValueLattice.h:150