LLVM 24.0.0git
llvm::GVNPassImpl::AvailableValue Struct Reference

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

Public Types

enum class  ValType : uint8_t

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
SelectInst * getSelectInstr () 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 (SelectInst *Sel, Value *V1, Value *V2, bool V1IsLoad, bool V2IsLoad)

Public Attributes

Value * Val
 Val - The value that is live out of the block.
ValType Kind
 Kind of the live-out value.
bool V1IsLoad = false
 Whether V1/V2 is the result of a dominating load from the select's address (as opposed to a value forwarded from a store).
bool V2IsLoad = false
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 466 of file GVN.cpp.

Member Enumeration Documentation

◆ ValType

Definition at line 467 of file GVN.cpp.

Member Function Documentation

◆ get()

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

Definition at line 490 of file GVN.cpp.

References Kind, Offset, and Val.

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

◆ getCoercedLoadValue()

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

Definition at line 546 of file GVN.cpp.

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

Referenced by MaterializeAdjustedValue().

◆ getLoad()

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

Definition at line 506 of file GVN.cpp.

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

◆ getMemIntrinValue()

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

Definition at line 551 of file GVN.cpp.

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

Referenced by MaterializeAdjustedValue().

◆ getMI()

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

Definition at line 498 of file GVN.cpp.

References Kind, MI, Offset, and Val.

◆ getSelect()

AvailableValue llvm::GVNPassImpl::AvailableValue::getSelect ( SelectInst * Sel,
Value * V1,
Value * V2,
bool V1IsLoad,
bool V2IsLoad )
inlinestatic

Definition at line 522 of file GVN.cpp.

References Kind, Offset, V1, V1IsLoad, V2, V2IsLoad, and Val.

◆ getSelectInstr()

SelectInst * llvm::GVNPassImpl::AvailableValue::getSelectInstr ( ) const
inline

Definition at line 556 of file GVN.cpp.

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

Referenced by MaterializeAdjustedValue().

◆ getSimpleValue()

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

Definition at line 541 of file GVN.cpp.

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

Referenced by MaterializeAdjustedValue().

◆ getUndef()

AvailableValue llvm::GVNPassImpl::AvailableValue::getUndef ( )
inlinestatic

Definition at line 514 of file GVN.cpp.

References Kind, Offset, and Val.

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

◆ isCoercedLoadValue()

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

Definition at line 536 of file GVN.cpp.

References Kind.

Referenced by getCoercedLoadValue(), and MaterializeAdjustedValue().

◆ isMemIntrinValue()

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

Definition at line 537 of file GVN.cpp.

References Kind.

Referenced by getMemIntrinValue(), and MaterializeAdjustedValue().

◆ isSelectValue()

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

Definition at line 539 of file GVN.cpp.

References Kind.

Referenced by getSelectInstr(), and MaterializeAdjustedValue().

◆ isSimpleValue()

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

Definition at line 535 of file GVN.cpp.

References Kind.

Referenced by getSimpleValue(), and MaterializeAdjustedValue().

◆ isUndefValue()

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

Definition at line 538 of file GVN.cpp.

References Kind.

◆ MaterializeAdjustedValue()

Member Data Documentation

◆ Kind

ValType llvm::GVNPassImpl::AvailableValue::Kind

Kind of the live-out value.

Definition at line 480 of file GVN.cpp.

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

◆ Offset

unsigned llvm::GVNPassImpl::AvailableValue::Offset = 0

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

Definition at line 486 of file GVN.cpp.

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

◆ V1

Value* llvm::GVNPassImpl::AvailableValue::V1 = nullptr

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

Definition at line 488 of file GVN.cpp.

Referenced by getSelect(), and MaterializeAdjustedValue().

◆ V1IsLoad

bool llvm::GVNPassImpl::AvailableValue::V1IsLoad = false

Whether V1/V2 is the result of a dominating load from the select's address (as opposed to a value forwarded from a store).

Definition at line 483 of file GVN.cpp.

Referenced by getSelect(), and MaterializeAdjustedValue().

◆ V2

Value * llvm::GVNPassImpl::AvailableValue::V2 = nullptr

Definition at line 488 of file GVN.cpp.

Referenced by getSelect(), and MaterializeAdjustedValue().

◆ V2IsLoad

bool llvm::GVNPassImpl::AvailableValue::V2IsLoad = false

Definition at line 483 of file GVN.cpp.

Referenced by getSelect(), and MaterializeAdjustedValue().

◆ Val

Value* llvm::GVNPassImpl::AvailableValue::Val

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

Definition at line 478 of file GVN.cpp.

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


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