LLVM 24.0.0git
GVNPassImpl::AvailableValue Struct Reference

Represents a particular available value that we know how to materialize. More...

Public Types

enum class  ValType {
  SimpleVal , LoadVal , MemIntrin , UndefVal ,
  SelectVal
}

Public Member Functions

bool isSimpleValue () const
bool isCoercedLoadValue () const
bool isMemIntrinValue () const
bool isUndefValue () const
bool isSelectValue () const
Value * getSimpleValue () const
LoadInst * getCoercedLoadValue () const
MemIntrinsic * getMemIntrinValue () const
Value * getSelectCondition () const
Value * MaterializeAdjustedValue (LoadInst *Load, Instruction *InsertPt) const
 Emit code at the specified insertion point to adjust the value defined here to the specified type.

Static Public Member Functions

static AvailableValue get (Value *V, unsigned Offset=0)
static AvailableValue getMI (MemIntrinsic *MI, unsigned Offset=0)
static AvailableValue getLoad (LoadInst *Load, unsigned Offset=0)
static AvailableValue getUndef ()
static AvailableValue getSelect (Value *Cond, Value *V1, Value *V2)

Public Attributes

Value * Val
 Val - The value that is live out of the block.
ValType Kind
 Kind of the live-out value.
unsigned Offset = 0
 Offset - The byte offset in Val that is interesting for the load query.
Value * V1 = nullptr
 V1, V2 - The dominating non-clobbered values of SelectVal.
Value * V2 = nullptr

Detailed Description

Represents a particular available value that we know how to materialize.

Materialization of an AvailableValue never fails. An AvailableValue is implicitly associated with a rematerialization point which is the location of the instruction from which it was formed.

Definition at line 502 of file GVN.cpp.

Member Enumeration Documentation

◆ ValType

Enumerator
SimpleVal 
LoadVal 
MemIntrin 
UndefVal 
SelectVal 

Definition at line 503 of file GVN.cpp.

Member Function Documentation

◆ get()

AvailableValue GVNPassImpl::AvailableValue::get ( Value * V,
unsigned Offset = 0 )
inlinestatic

Definition at line 523 of file GVN.cpp.

References Kind, Offset, SimpleVal, and Val.

Referenced by GVNPassImpl::AvailableValueInBlock::get().

◆ getCoercedLoadValue()

LoadInst * GVNPassImpl::AvailableValue::getCoercedLoadValue ( ) const
inline

Definition at line 576 of file GVN.cpp.

References assert(), llvm::cast(), isCoercedLoadValue(), and Val.

Referenced by MaterializeAdjustedValue().

◆ getLoad()

AvailableValue GVNPassImpl::AvailableValue::getLoad ( LoadInst * Load,
unsigned Offset = 0 )
inlinestatic

Definition at line 539 of file GVN.cpp.

References Kind, llvm::Load, LoadVal, Offset, and Val.

◆ getMemIntrinValue()

MemIntrinsic * GVNPassImpl::AvailableValue::getMemIntrinValue ( ) const
inline

Definition at line 581 of file GVN.cpp.

References assert(), llvm::cast(), isMemIntrinValue(), and Val.

Referenced by MaterializeAdjustedValue().

◆ getMI()

AvailableValue GVNPassImpl::AvailableValue::getMI ( MemIntrinsic * MI,
unsigned Offset = 0 )
inlinestatic

Definition at line 531 of file GVN.cpp.

References Kind, MemIntrin, MI, Offset, and Val.

◆ getSelect()

AvailableValue GVNPassImpl::AvailableValue::getSelect ( Value * Cond,
Value * V1,
Value * V2 )
inlinestatic

Definition at line 555 of file GVN.cpp.

References Cond, Kind, Offset, SelectVal, V1, V2, and Val.

◆ getSelectCondition()

Value * GVNPassImpl::AvailableValue::getSelectCondition ( ) const
inline

Definition at line 586 of file GVN.cpp.

References assert(), isSelectValue(), and Val.

Referenced by MaterializeAdjustedValue().

◆ getSimpleValue()

Value * GVNPassImpl::AvailableValue::getSimpleValue ( ) const
inline

Definition at line 571 of file GVN.cpp.

References assert(), isSimpleValue(), and Val.

Referenced by MaterializeAdjustedValue().

◆ getUndef()

AvailableValue GVNPassImpl::AvailableValue::getUndef ( )
inlinestatic

Definition at line 547 of file GVN.cpp.

References Kind, Offset, UndefVal, and Val.

Referenced by GVNPassImpl::AvailableValueInBlock::getUndef().

◆ isCoercedLoadValue()

bool GVNPassImpl::AvailableValue::isCoercedLoadValue ( ) const
inline

Definition at line 566 of file GVN.cpp.

References Kind, and LoadVal.

Referenced by getCoercedLoadValue(), and MaterializeAdjustedValue().

◆ isMemIntrinValue()

bool GVNPassImpl::AvailableValue::isMemIntrinValue ( ) const
inline

Definition at line 567 of file GVN.cpp.

References Kind, and MemIntrin.

Referenced by getMemIntrinValue(), and MaterializeAdjustedValue().

◆ isSelectValue()

bool GVNPassImpl::AvailableValue::isSelectValue ( ) const
inline

Definition at line 569 of file GVN.cpp.

References Kind, and SelectVal.

Referenced by getSelectCondition(), and MaterializeAdjustedValue().

◆ isSimpleValue()

bool GVNPassImpl::AvailableValue::isSimpleValue ( ) const
inline

Definition at line 565 of file GVN.cpp.

References Kind, and SimpleVal.

Referenced by getSimpleValue(), and MaterializeAdjustedValue().

◆ isUndefValue()

bool GVNPassImpl::AvailableValue::isUndefValue ( ) const
inline

Definition at line 568 of file GVN.cpp.

References Kind, and UndefVal.

◆ MaterializeAdjustedValue()

Member Data Documentation

◆ Kind

ValType GVNPassImpl::AvailableValue::Kind

Kind of the live-out value.

Definition at line 516 of file GVN.cpp.

Referenced by get(), getLoad(), getMI(), getSelect(), getUndef(), isCoercedLoadValue(), isMemIntrinValue(), isSelectValue(), isSimpleValue(), and isUndefValue().

◆ Offset

unsigned GVNPassImpl::AvailableValue::Offset = 0

Offset - The byte offset in Val that is interesting for the load query.

Definition at line 519 of file GVN.cpp.

Referenced by get(), getLoad(), getMI(), getSelect(), getUndef(), and MaterializeAdjustedValue().

◆ V1

Value* GVNPassImpl::AvailableValue::V1 = nullptr

V1, V2 - The dominating non-clobbered values of SelectVal.

Definition at line 521 of file GVN.cpp.

Referenced by getSelect(), and MaterializeAdjustedValue().

◆ V2

Value * GVNPassImpl::AvailableValue::V2 = nullptr

Definition at line 521 of file GVN.cpp.

Referenced by getSelect(), and MaterializeAdjustedValue().

◆ Val

Value* GVNPassImpl::AvailableValue::Val

Val - The value that is live out of the block.

Definition at line 514 of file GVN.cpp.

Referenced by get(), getCoercedLoadValue(), getLoad(), getMemIntrinValue(), getMI(), getSelect(), getSelectCondition(), getSimpleValue(), and getUndef().


The documentation for this struct was generated from the following file: