MLIR
20.0.0git
|
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... | |
Dialect * | getConstantDialect () 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... | |
This lattice value represents a known constant value of a lattice.
Definition at line 30 of file ConstantPropagationAnalysis.h.
|
explicitdefault |
Construct a constant value as uninitialized.
|
inlineexplicit |
Construct a constant value with a known constant.
Definition at line 36 of file ConstantPropagationAnalysis.h.
|
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().
|
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().
|
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.
|
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().
|
inline |
Whether the state is uninitialized.
Definition at line 64 of file ConstantPropagationAnalysis.h.
Referenced by getConstantDialect(), getConstantValue(), join(), and print().
|
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().
|
inline |
Compare the constant values.
Definition at line 52 of file ConstantPropagationAnalysis.h.
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().