Thanks to visit codestin.com
Credit goes to llvm.org

LLVM 22.0.0git
llvm::VPValue Class Reference

#include "Transforms/Vectorize/VPlanValue.h"

Inheritance diagram for llvm::VPValue:
[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 () const
 Return the underlying Value attached to this VPValue.
 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 () const
 Returns true if the value has more than one unique user.
bool hasOneUse () const
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 () const
 Returns the underlying IR value, if this VPValue is defined outside the scope of VPlan.
bool isDefinedOutsideLoopRegions () const
 Returns true if the VPValue is defined outside any loop.
void setUnderlyingValue (Value *Val)

Protected Member Functions

 VPValue (const unsigned char SC, Value *UV=nullptr, VPDef *Def=nullptr)
 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.

Protected Attributes

ValueUnderlyingVal
VPDefDef
 Pointer to the VPDef that defines this VPValue.

Friends

class VPDef
struct VPDoubleValueDef
class VPInterleaveBase
class VPlan
class VPExpressionRecipe

Detailed Description

Definition at line 48 of file VPlanValue.h.

Member Typedef Documentation

◆ const_user_iterator

◆ const_user_range

◆ user_iterator

Definition at line 125 of file VPlanValue.h.

◆ user_range

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 89 of file VPlanValue.h.

Constructor & Destructor Documentation

◆ VPValue() [1/5]

◆ VPValue() [2/5]

llvm::VPValue::VPValue ( Value * UV = nullptr)
inlineprotected

Create a live-in VPValue.

Definition at line 70 of file VPlanValue.h.

References VPValue(), and VPValueSC.

◆ VPValue() [3/5]

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

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

Definition at line 72 of file VPlanValue.h.

References Def, VPDef, VPValue(), and VPVRecipeSC.

◆ VPValue() [4/5]

llvm::VPValue::VPValue ( Value * UV,
VPDef * Def )
inlineprotected

Create a VPValue for a Def which defines multiple values.

Definition at line 74 of file VPlanValue.h.

References Def, VPDef, VPValue(), and VPValueSC.

◆ VPValue() [5/5]

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

References VPValue().

◆ ~VPValue()

VPValue::~VPValue ( )
virtual

Definition at line 104 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.

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

◆ dump()

void VPValue::dump ( ) const

Dump the value to stderr (for debugging).

Definition at line 118 of file VPlan.cpp.

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

◆ getDefiningRecipe() [1/2]

◆ getDefiningRecipe() [2/2]

const VPRecipeBase * VPValue::getDefiningRecipe ( ) const

Definition at line 139 of file VPlan.cpp.

References llvm::cast_or_null(), and Def.

◆ getLiveInIRValue()

◆ getNumUsers()

◆ getUnderlyingValue()

◆ 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 168 of file VPlanValue.h.

References getDefiningRecipe().

Referenced by isLiveIn().

◆ hasMoreThanOneUniqueUser()

bool llvm::VPValue::hasMoreThanOneUniqueUser ( ) const
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().

Referenced by llvm::VPWidenCastRecipe::computeCost().

◆ hasOneUse()

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

Definition at line 151 of file VPlanValue.h.

References getNumUsers().

◆ isDefinedOutsideLoopRegions()

bool VPValue::isDefinedOutsideLoopRegions ( ) const

Returns true if the VPValue is defined outside any loop.

Definition at line 1409 of file VPlan.cpp.

References isDefinedInsideLoopRegions().

Referenced by llvm::VPWidenSelectRecipe::computeCost(), and llvm::VPRecipeWithIRFlags::getCostForRecipeWithOpcode().

◆ isLiveIn()

◆ operator=()

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

References VPValue().

◆ print()

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

Definition at line 111 of file VPlan.cpp.

References Def, llvm::dyn_cast_or_null(), and printAsOperand().

Referenced by dump().

◆ printAsOperand()

◆ 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 find(), and I.

◆ replaceAllUsesWith()

◆ 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 1416 of file VPlan.cpp.

References llvm::User::getNumOperands(), getNumUsers(), llvm::User::getOperand(), I, llvm::User::setOperand(), and VPValue().

Referenced by llvm::VPlanTransforms::materializeVFAndVFxUF(), mergeReplicateRegionsIntoSuccessors(), preparePlanForMainVectorLoop(), replaceAllUsesWith(), llvm::VPlanTransforms::replaceSymbolicStrides(), sinkScalarOperands(), and transformRecipestoEVLRecipes().

◆ setUnderlyingValue()

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

◆ 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.

◆ user_end() [1/2]

user_iterator llvm::VPValue::user_end ( )
inline

Definition at line 132 of file VPlanValue.h.

Referenced by hasMoreThanOneUniqueUser(), users(), and users().

◆ user_end() [2/2]

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

Definition at line 133 of file VPlanValue.h.

◆ users() [1/2]

◆ 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().

◆ VPDef

◆ VPDoubleValueDef

friend struct VPDoubleValueDef
friend

Definition at line 50 of file VPlanValue.h.

References VPDoubleValueDef.

Referenced by VPDoubleValueDef.

◆ VPExpressionRecipe

friend class VPExpressionRecipe
friend

Definition at line 53 of file VPlanValue.h.

References VPExpressionRecipe.

Referenced by llvm::VPExpressionRecipe::clone(), and VPExpressionRecipe.

◆ VPInterleaveBase

friend class VPInterleaveBase
friend

Definition at line 51 of file VPlanValue.h.

References VPInterleaveBase.

Referenced by VPInterleaveBase.

◆ VPlan

friend class VPlan
friend

Definition at line 52 of file VPlanValue.h.

References VPlan.

Referenced by VPlan.

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(), getDefiningRecipe(), print(), VPValue(), VPValue(), VPValue(), and ~VPValue().

◆ UnderlyingVal

Value* llvm::VPValue::UnderlyingVal
protected

Definition at line 61 of file VPlanValue.h.

Referenced by getUnderlyingValue(), setUnderlyingValue(), and VPValue().


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