LLVM 20.0.0git
|
#include "Transforms/Vectorize/VPlanValue.h"
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_iterator > | user_range |
typedef iterator_range< const_user_iterator > | const_user_range |
Public Member Functions | |
Value * | getUnderlyingValue () const |
Return the underlying Value attached to this VPValue. | |
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 | |
VPValue & | operator= (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. | |
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). | |
VPRecipeBase * | getDefiningRecipe () |
Returns the recipe defining this VPValue or nullptr if it is not defined by a recipe, i.e. | |
const VPRecipeBase * | getDefiningRecipe () 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. | |
Value * | getLiveInIRValue () |
Returns the underlying IR value, if this VPValue is defined outside the scope of VPlan. | |
const Value * | getLiveInIRValue () const |
bool | isDefinedOutsideLoopRegions () const |
Returns true if the VPValue is defined outside any loop region. | |
void | setUnderlyingValue (Value *Val) |
Protected Member Functions | |
VPValue (const unsigned char SC, Value *UV=nullptr, VPDef *Def=nullptr) | |
Protected Attributes | |
Value * | UnderlyingVal |
VPDef * | Def |
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 |
Definition at line 44 of file VPlanValue.h.
Definition at line 124 of file VPlanValue.h.
Definition at line 126 of file VPlanValue.h.
typedef SmallVectorImpl<VPUser*>::iterator llvm::VPValue::user_iterator |
Definition at line 123 of file VPlanValue.h.
Definition at line 125 of file VPlanValue.h.
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 81 of file VPlanValue.h.
|
inline |
Create a live-in VPValue.
Definition at line 88 of file VPlanValue.h.
Create a VPValue for a Def
which is a subclass of VPValue.
Definition at line 90 of file VPlanValue.h.
Create a VPValue for a Def
which defines multiple values.
Definition at line 92 of file VPlanValue.h.
|
virtual |
|
inline |
Definition at line 112 of file VPlanValue.h.
References Users.
Referenced by llvm::VPUser::addOperand().
void VPValue::dump | ( | ) | const |
Dump the value to stderr (for debugging).
Definition at line 106 of file VPlan.cpp.
References llvm::dbgs(), Def, and print().
VPRecipeBase * VPValue::getDefiningRecipe | ( | ) |
Returns the recipe defining this VPValue or nullptr if it is not defined by a recipe, i.e.
is a live-in.
Definition at line 123 of file VPlan.cpp.
References Def.
Referenced by llvm::VPWidenCastRecipe::computeCost(), llvm::VPHeaderPHIRecipe::getBackedgeRecipe(), llvm::vputils::getOrCreateVPValueForSCEVExpr(), hasDefiningRecipe(), llvm::VPWidenIntOrFpInductionRecipe::isCanonical(), llvm::VPCanonicalIVPHIRecipe::isCanonical(), llvm::vputils::isUniformAfterVectorization(), and recursivelyDeleteDeadRecipes().
const VPRecipeBase * VPValue::getDefiningRecipe | ( | ) | const |
|
inline |
Returns the underlying IR value, if this VPValue is defined outside the scope of VPlan.
Returns nullptr if the VPValue is defined by a VPDef inside a VPlan.
Definition at line 172 of file VPlanValue.h.
References assert(), getUnderlyingValue(), and isLiveIn().
Referenced by llvm::VPHistogramRecipe::computeCost(), llvm::VPWidenIntOrFpInductionRecipe::execute(), llvm::VPWidenPointerInductionRecipe::execute(), llvm::VPFirstOrderRecurrencePHIRecipe::execute(), llvm::VPReductionPHIRecipe::execute(), llvm::VPDerivedIVRecipe::execute(), llvm::InnerLoopVectorizer::fixupIVUsers(), llvm::VPWidenCallRecipe::getCalledScalarFunction(), llvm::VPCanonicalIVPHIRecipe::getScalarType(), llvm::VPDerivedIVRecipe::getScalarType(), llvm::VPWidenIntOrFpInductionRecipe::isCanonical(), llvm::VPCanonicalIVPHIRecipe::isCanonical(), and llvm::VPlanPatternMatch::specific_intval< BitWidth >::match().
Definition at line 177 of file VPlanValue.h.
References assert(), getUnderlyingValue(), and isLiveIn().
|
inline |
Definition at line 111 of file VPlanValue.h.
References Users.
Referenced by llvm::VPWidenCastRecipe::computeCost(), createReplicateRegion(), hasMoreThanOneUniqueUser(), and llvm::VPlan::resetTripCount().
|
inline |
Return the underlying Value attached to this VPValue.
Definition at line 77 of file VPlanValue.h.
References UnderlyingVal.
Referenced by llvm::VPWidenCastRecipe::clone(), llvm::VPWidenIntrinsicRecipe::clone(), llvm::VPWidenCallRecipe::clone(), llvm::VPBlendRecipe::clone(), llvm::VPWidenRecipe::computeCost(), llvm::VPWidenCastRecipe::computeCost(), llvm::VPWidenIntrinsicRecipe::computeCost(), llvm::VPWidenSelectRecipe::computeCost(), llvm::VPReplicateRecipe::computeCost(), llvm::VPWidenRecipe::execute(), llvm::VPWidenCastRecipe::execute(), llvm::VPWidenIntrinsicRecipe::execute(), llvm::VPWidenCallRecipe::execute(), llvm::VPPredInstPHIRecipe::execute(), llvm::VPWidenEVLRecipe::execute(), getLiveInIRValue(), llvm::VPWidenInductionRecipe::getPHINode(), llvm::VPSingleDefRecipe::getUnderlyingInstr(), llvm::VPWidenPHIRecipe::print(), llvm::VPlanTransforms::truncateToMinimalBitwidths(), and llvm::VPlanTransforms::VPInstructionsToVPRecipes().
|
inline |
Definition at line 101 of file VPlanValue.h.
|
inline |
Returns true if this VPValue is defined by a recipe.
Definition at line 164 of file VPlanValue.h.
References getDefiningRecipe().
Referenced by isLiveIn().
|
inline |
Returns true if the value has more than one unique user.
Definition at line 138 of file VPlanValue.h.
References getNumUsers(), user_begin(), and user_end().
Referenced by llvm::VPWidenCastRecipe::computeCost().
bool VPValue::isDefinedOutsideLoopRegions | ( | ) | const |
Returns true if the VPValue is defined outside any loop region.
Definition at line 1417 of file VPlan.cpp.
Referenced by llvm::VPWidenRecipe::computeCost(), llvm::VPWidenSelectRecipe::computeCost(), llvm::VPWidenSelectRecipe::isInvariantCond(), and llvm::vputils::isUniformAfterVectorization().
|
inline |
Returns true if this VPValue is a live-in, i.e. defined outside the VPlan.
Definition at line 167 of file VPlanValue.h.
References hasDefiningRecipe().
Referenced by llvm::VPWidenCastRecipe::computeCost(), llvm::VPHistogramRecipe::computeCost(), llvm::InnerLoopVectorizer::fixupIVUsers(), getLiveInIRValue(), llvm::VPlan::getOrAddLiveIn(), and llvm::VPlanPatternMatch::specific_intval< BitWidth >::match().
void VPValue::print | ( | raw_ostream & | OS, |
VPSlotTracker & | Tracker | ||
) | const |
void VPValue::printAsOperand | ( | raw_ostream & | OS, |
VPSlotTracker & | Tracker | ||
) | const |
Definition at line 1454 of file VPlan.cpp.
References llvm::VPSlotTracker::getOrCreateName(), and OS.
Referenced by llvm::VPInstruction::print(), llvm::VPWidenRecipe::print(), llvm::VPWidenCastRecipe::print(), llvm::VPWidenIntrinsicRecipe::print(), llvm::VPWidenCallRecipe::print(), llvm::VPHistogramRecipe::print(), llvm::VPWidenSelectRecipe::print(), llvm::VPWidenGEPRecipe::print(), llvm::VPReverseVectorPointerRecipe::print(), llvm::VPVectorPointerRecipe::print(), llvm::VPWidenIntOrFpInductionRecipe::print(), llvm::VPWidenPointerInductionRecipe::print(), llvm::VPScalarPHIRecipe::print(), llvm::VPWidenPHIRecipe::print(), llvm::VPFirstOrderRecurrencePHIRecipe::print(), llvm::VPReductionPHIRecipe::print(), llvm::VPBlendRecipe::print(), llvm::VPInterleaveRecipe::print(), llvm::VPReductionRecipe::print(), llvm::VPReductionEVLRecipe::print(), llvm::VPReplicateRecipe::print(), llvm::VPPredInstPHIRecipe::print(), llvm::VPWidenLoadRecipe::print(), llvm::VPWidenLoadEVLRecipe::print(), llvm::VPExpandSCEVRecipe::print(), llvm::VPCanonicalIVPHIRecipe::print(), llvm::VPActiveLaneMaskPHIRecipe::print(), llvm::VPEVLBasedIVPHIRecipe::print(), llvm::VPWidenCanonicalIVRecipe::print(), llvm::VPDerivedIVRecipe::print(), llvm::VPScalarIVStepsRecipe::print(), llvm::VPWidenEVLRecipe::print(), and print().
|
inline |
Remove a single User
from the list of users.
Definition at line 115 of file VPlanValue.h.
References llvm::find(), I, and Users.
void VPValue::replaceAllUsesWith | ( | VPValue * | New | ) |
Definition at line 1422 of file VPlan.cpp.
Referenced by llvm::VPlanTransforms::createInterleaveGroups(), createReplicateRegion(), legalizeAndOptimizeInductions(), preparePlanForEpilogueVectorLoop(), removeRedundantCanonicalIVs(), removeRedundantInductionCasts(), simplifyRecipe(), transformRecipestoEVLRecipes(), llvm::VPlanTransforms::truncateToMinimalBitwidths(), and llvm::VPlanTransforms::VPInstructionsToVPRecipes().
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 1426 of file VPlan.cpp.
References llvm::User::getNumOperands(), llvm::User::getOperand(), I, llvm::User::setOperand(), and Users.
Referenced by mergeReplicateRegionsIntoSuccessors(), and sinkScalarOperands().
|
inline |
Definition at line 187 of file VPlanValue.h.
References assert(), and UnderlyingVal.
Referenced by llvm::VPBuilder::createNaryOp().
|
inline |
Definition at line 128 of file VPlanValue.h.
References Users.
Referenced by llvm::VPWidenCastRecipe::computeCost(), hasMoreThanOneUniqueUser(), and users().
|
inline |
Definition at line 129 of file VPlanValue.h.
References Users.
|
inline |
Definition at line 130 of file VPlanValue.h.
References Users.
Referenced by hasMoreThanOneUniqueUser(), and users().
|
inline |
Definition at line 131 of file VPlanValue.h.
References Users.
|
inline |
Definition at line 132 of file VPlanValue.h.
References user_begin(), and user_end().
Referenced by llvm::VPlanTransforms::addActiveLaneMask(), collectAllHeaderMasks(), llvm::VPBlendRecipe::onlyFirstLaneUsed(), removeRedundantCanonicalIVs(), removeRedundantInductionCasts(), llvm::VPReplicateRecipe::shouldPack(), sinkRecurrenceUsersAfterPrevious(), sinkScalarOperands(), and transformRecipestoEVLRecipes().
|
inline |
Definition at line 133 of file VPlanValue.h.
References user_begin(), and user_end().
|
friend |
Definition at line 49 of file VPlanValue.h.
|
friend |
Definition at line 45 of file VPlanValue.h.
|
friend |
Definition at line 46 of file VPlanValue.h.
|
friend |
Definition at line 47 of file VPlanValue.h.
|
friend |
Definition at line 50 of file VPlanValue.h.
|
friend |
Definition at line 48 of file VPlanValue.h.
|
friend |
Definition at line 52 of file VPlanValue.h.
|
friend |
Definition at line 51 of file VPlanValue.h.
|
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 64 of file VPlanValue.h.
Referenced by dump(), getDefiningRecipe(), print(), VPValue(), and ~VPValue().
|
protected |
Definition at line 60 of file VPlanValue.h.
Referenced by getUnderlyingValue(), and setUnderlyingValue().