MLIR  20.0.0git
Public Member Functions | Static Public Member Functions | List of all members
mlir::dataflow::ConstantValue Class Reference

This lattice value represents a known constant value of a lattice. More...

#include "mlir/Analysis/DataFlow/ConstantPropagationAnalysis.h"

Public Member Functions

 ConstantValue ()=default
 Construct a constant value as uninitialized. More...
 
 ConstantValue (Attribute constant, Dialect *dialect)
 Construct a constant value with a known constant. More...
 
Attribute getConstantValue () const
 Get the constant value. Returns null if no value was determined. More...
 
DialectgetConstantDialect () const
 Get the dialect instance that can be used to materialize the constant. More...
 
bool operator== (const ConstantValue &rhs) const
 Compare the constant values. More...
 
void print (raw_ostream &os) const
 Print the constant value. More...
 
bool isUninitialized () const
 Whether the state is uninitialized. More...
 

Static Public Member Functions

static ConstantValue getUninitialized ()
 The state where the constant value is uninitialized. More...
 
static ConstantValue getUnknownConstant ()
 The state where the constant value is unknown. More...
 
static ConstantValue join (const ConstantValue &lhs, const ConstantValue &rhs)
 The union with another constant value is null if they are different, and the same if they are the same. More...
 

Detailed Description

This lattice value represents a known constant value of a lattice.

Definition at line 30 of file ConstantPropagationAnalysis.h.

Constructor & Destructor Documentation

◆ ConstantValue() [1/2]

mlir::dataflow::ConstantValue::ConstantValue ( )
explicitdefault

Construct a constant value as uninitialized.

◆ ConstantValue() [2/2]

mlir::dataflow::ConstantValue::ConstantValue ( Attribute  constant,
Dialect dialect 
)
inlineexplicit

Construct a constant value with a known constant.

Definition at line 36 of file ConstantPropagationAnalysis.h.

Member Function Documentation

◆ getConstantDialect()

Dialect* mlir::dataflow::ConstantValue::getConstantDialect ( ) const
inline

Get the dialect instance that can be used to materialize the constant.

Definition at line 46 of file ConstantPropagationAnalysis.h.

References isUninitialized().

Referenced by replaceWithConstant().

◆ getConstantValue()

Attribute mlir::dataflow::ConstantValue::getConstantValue ( ) const
inline

Get the constant value. Returns null if no value was determined.

Definition at line 40 of file ConstantPropagationAnalysis.h.

References isUninitialized().

Referenced by print(), and replaceWithConstant().

◆ getUninitialized()

static ConstantValue mlir::dataflow::ConstantValue::getUninitialized ( )
inlinestatic

The state where the constant value is uninitialized.

This happens when the state hasn't been set during the analysis.

Definition at line 61 of file ConstantPropagationAnalysis.h.

◆ getUnknownConstant()

static ConstantValue mlir::dataflow::ConstantValue::getUnknownConstant ( )
inlinestatic

The state where the constant value is unknown.

Definition at line 67 of file ConstantPropagationAnalysis.h.

Referenced by join(), mlir::dataflow::IntegerValueRangeLattice::onUpdate(), and mlir::dataflow::SparseConstantPropagation::setToEntryState().

◆ isUninitialized()

bool mlir::dataflow::ConstantValue::isUninitialized ( ) const
inline

Whether the state is uninitialized.

Definition at line 64 of file ConstantPropagationAnalysis.h.

Referenced by getConstantDialect(), getConstantValue(), join(), and print().

◆ join()

static ConstantValue mlir::dataflow::ConstantValue::join ( const ConstantValue lhs,
const ConstantValue rhs 
)
inlinestatic

The union with another constant value is null if they are different, and the same if they are the same.

Definition at line 73 of file ConstantPropagationAnalysis.h.

References getUnknownConstant(), and isUninitialized().

◆ operator==()

bool mlir::dataflow::ConstantValue::operator== ( const ConstantValue rhs) const
inline

Compare the constant values.

Definition at line 52 of file ConstantPropagationAnalysis.h.

◆ print()

void ConstantValue::print ( raw_ostream &  os) const

Print the constant value.

Definition at line 30 of file ConstantPropagationAnalysis.cpp.

References getConstantValue(), isUninitialized(), and mlir::Attribute::print().


The documentation for this class was generated from the following files: