LLVM 22.0.0git
llvm::VPValue Class Reference

This is the base class of the VPlan Def/Use graph, used for modeling the data flow into, within and out of the VPlan. More...

#include "Transforms/Vectorize/VPlanValue.h"

Inheritance diagram for llvm::VPValue:
[legend]

Public Types

enum  { VPVIRValueSC , VPVSymbolicSC , VPVRecipeValueSC }
 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.
ValuegetLiveInIRValue () const
 Return the underlying IR value for a VPIRValue.
 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
VPUsergetSingleUser ()
 Return the single user of this value, or nullptr if there is not exactly one user.
const VPUsergetSingleUser () 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 isDefinedOutsideLoopRegions () const
 Returns true if the VPValue is defined outside any loop.
void setUnderlyingValue (Value *Val)

Friends

class VPDef
struct VPDoubleValueDef
class VPlan
struct VPIRValue
struct VPSymbolicValue
class VPRecipeValue

Detailed Description

This is the base class of the VPlan Def/Use graph, used for modeling the data flow into, within and out of the VPlan.

VPValues can stand for live-ins coming from the input IR, symbolic values and values defined by recipes.

Definition at line 45 of file VPlanValue.h.

Member Typedef Documentation

◆ const_user_iterator

◆ const_user_range

◆ user_iterator

Definition at line 117 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
VPVIRValueSC 
VPVSymbolicSC 

A live-in VPValue wrapping an IR Value.

VPVRecipeValueSC 

A symbolic live-in VPValue without IR backing.

Definition at line 79 of file VPlanValue.h.

Constructor & Destructor Documentation

◆ VPValue()

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

◆ ~VPValue()

virtual llvm::VPValue::~VPValue ( )
inlinevirtual

Definition at line 88 of file VPlanValue.h.

References assert().

Member Function Documentation

◆ addUser()

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

Definition at line 106 of file VPlanValue.h.

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

◆ dump()

void VPValue::dump ( ) const

Dump the value to stderr (for debugging).

Definition at line 102 of file VPlan.cpp.

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

◆ getDefiningRecipe() [1/2]

◆ getDefiningRecipe() [2/2]

const VPRecipeBase * VPValue::getDefiningRecipe ( ) const

Definition at line 126 of file VPlan.cpp.

References llvm::cast(), and llvm::dyn_cast().

◆ getLiveInIRValue()

◆ getNumUsers()

◆ getSingleUser() [1/2]

VPUser * llvm::VPValue::getSingleUser ( )
inline

Return the single user of this value, or nullptr if there is not exactly one user.

Definition at line 147 of file VPlanValue.h.

References hasOneUse(), and user_begin().

◆ getSingleUser() [2/2]

const VPUser * llvm::VPValue::getSingleUser ( ) const
inline

Definition at line 148 of file VPlanValue.h.

References hasOneUse(), and user_begin().

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

◆ hasDefiningRecipe()

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

Returns true if this VPValue is defined by a recipe.

Definition at line 167 of file VPlanValue.h.

References getDefiningRecipe().

◆ hasMoreThanOneUniqueUser()

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

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

Definition at line 132 of file VPlanValue.h.

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

◆ hasOneUse()

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

Definition at line 143 of file VPlanValue.h.

References getNumUsers().

Referenced by getSingleUser(), and getSingleUser().

◆ isDefinedOutsideLoopRegions()

bool VPValue::isDefinedOutsideLoopRegions ( ) const

Returns true if the VPValue is defined outside any loop.

Definition at line 1382 of file VPlan.cpp.

References isDefinedInsideLoopRegions().

Referenced by llvm::VPRecipeWithIRFlags::getCostForRecipeWithOpcode(), and llvm::VPlanTransforms::hoistInvariantLoads().

◆ operator=()

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

◆ print()

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

Definition at line 95 of file VPlan.cpp.

References getDefiningRecipe(), and printAsOperand().

Referenced by dump().

◆ printAsOperand()

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

Definition at line 1424 of file VPlan.cpp.

References llvm::VPSlotTracker::getOrCreateName().

Referenced by print(), llvm::VPActiveLaneMaskPHIRecipe::printRecipe(), llvm::VPBlendRecipe::printRecipe(), llvm::VPCanonicalIVPHIRecipe::printRecipe(), llvm::VPDerivedIVRecipe::printRecipe(), llvm::VPEVLBasedIVPHIRecipe::printRecipe(), llvm::VPExpandSCEVRecipe::printRecipe(), llvm::VPExpressionRecipe::printRecipe(), llvm::VPFirstOrderRecurrencePHIRecipe::printRecipe(), llvm::VPHistogramRecipe::printRecipe(), llvm::VPInstruction::printRecipe(), llvm::VPInstructionWithType::printRecipe(), llvm::VPInterleaveEVLRecipe::printRecipe(), llvm::VPInterleaveRecipe::printRecipe(), llvm::VPPhi::printRecipe(), llvm::VPPredInstPHIRecipe::printRecipe(), llvm::VPReductionEVLRecipe::printRecipe(), llvm::VPReductionPHIRecipe::printRecipe(), llvm::VPReductionRecipe::printRecipe(), llvm::VPReplicateRecipe::printRecipe(), llvm::VPScalarIVStepsRecipe::printRecipe(), llvm::VPVectorEndPointerRecipe::printRecipe(), llvm::VPVectorPointerRecipe::printRecipe(), llvm::VPWidenCallRecipe::printRecipe(), llvm::VPWidenCanonicalIVRecipe::printRecipe(), llvm::VPWidenCastRecipe::printRecipe(), llvm::VPWidenGEPRecipe::printRecipe(), llvm::VPWidenIntOrFpInductionRecipe::printRecipe(), llvm::VPWidenIntrinsicRecipe::printRecipe(), llvm::VPWidenLoadEVLRecipe::printRecipe(), llvm::VPWidenLoadRecipe::printRecipe(), llvm::VPWidenPHIRecipe::printRecipe(), llvm::VPWidenPointerInductionRecipe::printRecipe(), and llvm::VPWidenRecipe::printRecipe().

◆ removeUser()

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

Remove a single User from the list of users.

Definition at line 109 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 1389 of file VPlan.cpp.

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

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

Definition at line 122 of file VPlanValue.h.

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

◆ user_begin() [2/2]

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

Definition at line 123 of file VPlanValue.h.

◆ user_end() [1/2]

user_iterator llvm::VPValue::user_end ( )
inline

Definition at line 124 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 125 of file VPlanValue.h.

◆ users() [1/2]

◆ users() [2/2]

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

Definition at line 127 of file VPlanValue.h.

References user_begin(), and user_end().

◆ VPDef

friend class VPDef
friend

Definition at line 46 of file VPlanValue.h.

References VPDef.

Referenced by VPDef.

◆ VPDoubleValueDef

friend struct VPDoubleValueDef
friend

Definition at line 47 of file VPlanValue.h.

References VPDoubleValueDef.

Referenced by VPDoubleValueDef.

◆ VPIRValue

friend struct VPIRValue
friend

Definition at line 49 of file VPlanValue.h.

References VPIRValue.

Referenced by VPIRValue.

◆ VPlan

friend class VPlan
friend

Definition at line 48 of file VPlanValue.h.

References VPlan.

Referenced by VPlan.

◆ VPRecipeValue

friend class VPRecipeValue
friend

Definition at line 51 of file VPlanValue.h.

References VPRecipeValue.

Referenced by VPRecipeValue.

◆ VPSymbolicValue

friend struct VPSymbolicValue
friend

Definition at line 50 of file VPlanValue.h.

References VPSymbolicValue.

Referenced by VPSymbolicValue.


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