LLVM 19.0.0git
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
llvm::VPValue Class Reference

#include "Transforms/Vectorize/VPlanValue.h"

Inheritance diagram for llvm::VPValue:
Inheritance graph
[legend]

Public Types

enum  { VPValueSC , VPVRecipeSC }
 An enumeration for keeping track of the concrete subclass of VPValue that are actually instantiated. More...
 
typedef SmallVectorImpl< VPUser * >::iterator user_iterator
 
typedef SmallVectorImpl< VPUser * >::const_iterator const_user_iterator
 
typedef iterator_range< user_iteratoruser_range
 
typedef iterator_range< const_user_iteratorconst_user_range
 

Public Member Functions

ValuegetUnderlyingValue ()
 Return the underlying Value attached to this VPValue.
 
const ValuegetUnderlyingValue () const
 
 VPValue (Value *UV=nullptr)
 Create a live-in VPValue.
 
 VPValue (VPDef *Def, Value *UV=nullptr)
 Create a VPValue for a Def which is a subclass of VPValue.
 
 VPValue (Value *UV, VPDef *Def)
 Create a VPValue for a Def which defines multiple values.
 
 VPValue (const VPValue &)=delete
 
VPValueoperator= (const VPValue &)=delete
 
virtual ~VPValue ()
 
unsigned getVPValueID () const
 
void printAsOperand (raw_ostream &OS, VPSlotTracker &Tracker) const
 
void print (raw_ostream &OS, VPSlotTracker &Tracker) const
 
void dump () const
 Dump the value to stderr (for debugging).
 
unsigned getNumUsers () const
 
void addUser (VPUser &User)
 
void removeUser (VPUser &User)
 Remove a single User from the list of users.
 
user_iterator user_begin ()
 
const_user_iterator user_begin () const
 
user_iterator user_end ()
 
const_user_iterator user_end () const
 
user_range users ()
 
const_user_range users () const
 
bool hasMoreThanOneUniqueUser ()
 Returns true if the value has more than one unique user.
 
void replaceAllUsesWith (VPValue *New)
 
void replaceUsesWithIf (VPValue *New, llvm::function_ref< bool(VPUser &U, unsigned Idx)> ShouldReplace)
 Go through the uses list for this VPValue and make each use point to New if the callback ShouldReplace returns true for the given use specified by a pair of (VPUser, the use index).
 
VPRecipeBasegetDefiningRecipe ()
 Returns the recipe defining this VPValue or nullptr if it is not defined by a recipe, i.e.
 
const VPRecipeBasegetDefiningRecipe () const
 
bool hasDefiningRecipe () const
 Returns true if this VPValue is defined by a recipe.
 
bool isLiveIn () const
 Returns true if this VPValue is a live-in, i.e. defined outside the VPlan.
 
ValuegetLiveInIRValue ()
 Returns the underlying IR value, if this VPValue is defined outside the scope of VPlan.
 
const ValuegetLiveInIRValue () const
 
bool isDefinedOutsideVectorRegions () const
 Returns true if the VPValue is defined outside any vector regions, i.e.
 
void setUnderlyingValue (Value *Val)
 

Protected Member Functions

 VPValue (const unsigned char SC, Value *UV=nullptr, VPDef *Def=nullptr)
 

Protected Attributes

ValueUnderlyingVal
 
VPDefDef
 Pointer to the VPDef that defines this VPValue.
 

Friends

class VPBuilder
 
class VPDef
 
class VPInstruction
 
struct VPlanTransforms
 
class VPBasicBlock
 
class VPInterleavedAccessInfo
 
class VPSlotTracker
 
class VPRecipeBase
 
class VPWidenMemoryInstructionRecipe
 

Detailed Description

Definition at line 44 of file VPlanValue.h.

Member Typedef Documentation

◆ const_user_iterator

Definition at line 126 of file VPlanValue.h.

◆ const_user_range

Definition at line 128 of file VPlanValue.h.

◆ user_iterator

Definition at line 125 of file VPlanValue.h.

◆ user_range

Definition at line 127 of file VPlanValue.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum

An enumeration for keeping track of the concrete subclass of VPValue that are actually instantiated.

Enumerator
VPValueSC 
VPVRecipeSC 

A generic VPValue, like live-in values or defined by a recipe that defines multiple values.

A VPValue sub-class that is a VPRecipeBase.

Definition at line 83 of file VPlanValue.h.

Constructor & Destructor Documentation

◆ VPValue() [1/5]

VPValue::VPValue ( const unsigned char  SC,
Value UV = nullptr,
VPDef Def = nullptr 
)
protected

Definition at line 81 of file VPlan.cpp.

References Def.

◆ VPValue() [2/5]

llvm::VPValue::VPValue ( Value UV = nullptr)
inline

Create a live-in VPValue.

Definition at line 90 of file VPlanValue.h.

◆ VPValue() [3/5]

llvm::VPValue::VPValue ( VPDef Def,
Value UV = nullptr 
)
inline

Create a VPValue for a Def which is a subclass of VPValue.

Definition at line 92 of file VPlanValue.h.

◆ VPValue() [4/5]

llvm::VPValue::VPValue ( Value UV,
VPDef Def 
)
inline

Create a VPValue for a Def which defines multiple values.

Definition at line 94 of file VPlanValue.h.

◆ VPValue() [5/5]

llvm::VPValue::VPValue ( const VPValue )
delete

◆ ~VPValue()

VPValue::~VPValue ( )
virtual

Definition at line 87 of file VPlan.cpp.

References assert(), and Def.

Member Function Documentation

◆ addUser()

void llvm::VPValue::addUser ( VPUser User)
inline

Definition at line 114 of file VPlanValue.h.

References Users.

Referenced by llvm::VPUser::addOperand().

◆ dump()

void VPValue::dump ( ) const

Dump the value to stderr (for debugging).

Definition at line 101 of file VPlan.cpp.

References llvm::dbgs(), Def, and print().

◆ getDefiningRecipe() [1/2]

VPRecipeBase * VPValue::getDefiningRecipe ( )

◆ getDefiningRecipe() [2/2]

const VPRecipeBase * VPValue::getDefiningRecipe ( ) const

Definition at line 122 of file VPlan.cpp.

References Def.

◆ getLiveInIRValue() [1/2]

Value * llvm::VPValue::getLiveInIRValue ( )
inline

◆ getLiveInIRValue() [2/2]

const Value * llvm::VPValue::getLiveInIRValue ( ) const
inline

Definition at line 179 of file VPlanValue.h.

References assert(), getUnderlyingValue(), and isLiveIn().

◆ getNumUsers()

unsigned llvm::VPValue::getNumUsers ( ) const
inline

◆ getUnderlyingValue() [1/2]

Value * llvm::VPValue::getUnderlyingValue ( )
inline

◆ getUnderlyingValue() [2/2]

const Value * llvm::VPValue::getUnderlyingValue ( ) const
inline

Definition at line 79 of file VPlanValue.h.

References UnderlyingVal.

◆ getVPValueID()

unsigned llvm::VPValue::getVPValueID ( ) const
inline
Returns
an ID for the concrete type of this object. This is used to implement the classof checks. This should not be used for any other purpose, as the values may change as LLVM evolves.

Definition at line 103 of file VPlanValue.h.

◆ hasDefiningRecipe()

bool llvm::VPValue::hasDefiningRecipe ( ) const
inline

Returns true if this VPValue is defined by a recipe.

Definition at line 166 of file VPlanValue.h.

References getDefiningRecipe().

Referenced by isDefinedOutsideVectorRegions(), and isLiveIn().

◆ hasMoreThanOneUniqueUser()

bool llvm::VPValue::hasMoreThanOneUniqueUser ( )
inline

Returns true if the value has more than one unique user.

Definition at line 140 of file VPlanValue.h.

References getNumUsers(), user_begin(), and user_end().

◆ isDefinedOutsideVectorRegions()

bool llvm::VPValue::isDefinedOutsideVectorRegions ( ) const
inline

Returns true if the VPValue is defined outside any vector regions, i.e.

it is a live-in value. TODO: Also handle recipes defined in pre-header blocks.

Definition at line 188 of file VPlanValue.h.

References hasDefiningRecipe().

Referenced by llvm::VPWidenSelectRecipe::isInvariantCond(), and llvm::vputils::isUniformAfterVectorization().

◆ isLiveIn()

bool llvm::VPValue::isLiveIn ( ) const
inline

Returns true if this VPValue is a live-in, i.e. defined outside the VPlan.

Definition at line 169 of file VPlanValue.h.

References hasDefiningRecipe().

Referenced by llvm::VPlan::addVPValue(), llvm::InnerLoopVectorizer::fixupIVUsers(), and getLiveInIRValue().

◆ operator=()

VPValue & llvm::VPValue::operator= ( const VPValue )
delete

◆ print()

void VPValue::print ( raw_ostream OS,
VPSlotTracker Tracker 
) const

Definition at line 94 of file VPlan.cpp.

References Def, OS, and printAsOperand().

Referenced by dump().

◆ printAsOperand()

void VPValue::printAsOperand ( raw_ostream OS,
VPSlotTracker Tracker 
) const

◆ removeUser()

void llvm::VPValue::removeUser ( VPUser User)
inline

Remove a single User from the list of users.

Definition at line 117 of file VPlanValue.h.

References llvm::find(), I, and Users.

◆ replaceAllUsesWith()

void VPValue::replaceAllUsesWith ( VPValue New)

◆ replaceUsesWithIf()

void VPValue::replaceUsesWithIf ( VPValue New,
llvm::function_ref< bool(VPUser &U, unsigned Idx)>  ShouldReplace 
)

Go through the uses list for this VPValue and make each use point to New if the callback ShouldReplace returns true for the given use specified by a pair of (VPUser, the use index).

Definition at line 1284 of file VPlan.cpp.

References E, llvm::User::getNumOperands(), llvm::User::getOperand(), I, llvm::User::setOperand(), and Users.

Referenced by mergeReplicateRegionsIntoSuccessors(), and sinkScalarOperands().

◆ setUnderlyingValue()

void llvm::VPValue::setUnderlyingValue ( Value Val)
inline

Definition at line 191 of file VPlanValue.h.

References assert(), and UnderlyingVal.

Referenced by llvm::VPBuilder::createNaryOp().

◆ user_begin() [1/2]

user_iterator llvm::VPValue::user_begin ( )
inline

◆ user_begin() [2/2]

const_user_iterator llvm::VPValue::user_begin ( ) const
inline

Definition at line 131 of file VPlanValue.h.

References Users.

◆ user_end() [1/2]

user_iterator llvm::VPValue::user_end ( )
inline

Definition at line 132 of file VPlanValue.h.

References Users.

Referenced by llvm::VPReplicateRecipe::execute(), hasMoreThanOneUniqueUser(), and users().

◆ user_end() [2/2]

const_user_iterator llvm::VPValue::user_end ( ) const
inline

Definition at line 133 of file VPlanValue.h.

References Users.

◆ users() [1/2]

user_range llvm::VPValue::users ( )
inline

◆ users() [2/2]

const_user_range llvm::VPValue::users ( ) const
inline

Definition at line 135 of file VPlanValue.h.

References user_begin(), and user_end().

Friends And Related Function Documentation

◆ VPBasicBlock

friend class VPBasicBlock
friend

Definition at line 49 of file VPlanValue.h.

◆ VPBuilder

friend class VPBuilder
friend

Definition at line 45 of file VPlanValue.h.

◆ VPDef

friend class VPDef
friend

Definition at line 46 of file VPlanValue.h.

◆ VPInstruction

friend class VPInstruction
friend

Definition at line 47 of file VPlanValue.h.

◆ VPInterleavedAccessInfo

friend class VPInterleavedAccessInfo
friend

Definition at line 50 of file VPlanValue.h.

◆ VPlanTransforms

friend struct VPlanTransforms
friend

Definition at line 48 of file VPlanValue.h.

◆ VPRecipeBase

friend class VPRecipeBase
friend

Definition at line 52 of file VPlanValue.h.

◆ VPSlotTracker

friend class VPSlotTracker
friend

Definition at line 51 of file VPlanValue.h.

◆ VPWidenMemoryInstructionRecipe

friend class VPWidenMemoryInstructionRecipe
friend

Definition at line 53 of file VPlanValue.h.

Member Data Documentation

◆ Def

VPDef* llvm::VPValue::Def
protected

Pointer to the VPDef that defines this VPValue.

If it is nullptr, the VPValue is not defined by any recipe modeled in VPlan.

Definition at line 65 of file VPlanValue.h.

Referenced by dump(), getDefiningRecipe(), print(), VPValue(), and ~VPValue().

◆ UnderlyingVal

Value* llvm::VPValue::UnderlyingVal
protected

Definition at line 61 of file VPlanValue.h.

Referenced by getUnderlyingValue(), and setUnderlyingValue().


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