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 (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) | |
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 | |
Value * | UnderlyingVal |
VPDef * | Def |
Pointer to the VPDef that defines this VPValue. | |
Friends | |
class | VPBuilder |
class | VPDef |
struct | VPDoubleValueDef |
class | VPInstruction |
class | VPInterleaveRecipe |
struct | VPlanTransforms |
class | VPBasicBlock |
class | VPInterleavedAccessInfo |
class | VPSlotTracker |
class | VPRecipeBase |
class | VPlan |
Definition at line 46 of file VPlanValue.h.
Definition at line 130 of file VPlanValue.h.
Definition at line 132 of file VPlanValue.h.
typedef SmallVectorImpl<VPUser*>::iterator llvm::VPValue::user_iterator |
Definition at line 129 of file VPlanValue.h.
Definition at line 131 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 93 of file VPlanValue.h.
|
inlineprotected |
Create a live-in VPValue.
Definition at line 74 of file VPlanValue.h.
Create a VPValue for a Def
which is a subclass of VPValue.
Definition at line 76 of file VPlanValue.h.
Create a VPValue for a Def
which defines multiple values.
Definition at line 78 of file VPlanValue.h.
|
virtual |
|
inline |
Definition at line 118 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::VPPartialReductionRecipe::computeCost(), llvm::VPHeaderPHIRecipe::getBackedgeRecipe(), getOptimizableIVOf(), llvm::vputils::getOrCreateVPValueForSCEVExpr(), hasDefiningRecipe(), llvm::VPWidenIntOrFpInductionRecipe::isCanonical(), isDefinedInsideLoopRegions(), llvm::vputils::isUniformAfterVectorization(), preparePlanForMainVectorLoop(), recursivelyDeleteDeadRecipes(), and llvm::VPRecipeBuilder::tryToCreatePartialReduction().
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 178 of file VPlanValue.h.
References assert(), getUnderlyingValue(), and isLiveIn().
Referenced by llvm::VPWidenIntOrFpInductionRecipe::execute(), llvm::VPWidenPointerInductionRecipe::execute(), llvm::VPFirstOrderRecurrencePHIRecipe::execute(), llvm::VPReductionPHIRecipe::execute(), llvm::VPDerivedIVRecipe::execute(), llvm::VPWidenCallRecipe::getCalledScalarFunction(), getOptimizableIVOf(), llvm::VPCanonicalIVPHIRecipe::getScalarType(), llvm::VPDerivedIVRecipe::getScalarType(), llvm::VPWidenIntOrFpInductionRecipe::isCanonical(), llvm::VPlanPatternMatch::specific_intval< BitWidth >::match(), and llvm::VPlanTransforms::optimizeInductionExitUsers().
Definition at line 183 of file VPlanValue.h.
References assert(), getUnderlyingValue(), and isLiveIn().
|
inline |
Definition at line 117 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 89 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::VPWidenSelectRecipe::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 107 of file VPlanValue.h.
|
inline |
Returns true if this VPValue is defined by a recipe.
Definition at line 170 of file VPlanValue.h.
References getDefiningRecipe().
Referenced by isLiveIn().
|
inline |
Returns true if the value has more than one unique user.
Definition at line 144 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.
References isDefinedInsideLoopRegions().
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 173 of file VPlanValue.h.
References hasDefiningRecipe().
Referenced by llvm::VPWidenCastRecipe::computeCost(), getLiveInIRValue(), getOptimizableIVOf(), 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 1452 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::VPPartialReductionRecipe::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 121 of file VPlanValue.h.
References llvm::find(), I, and Users.
void VPValue::replaceAllUsesWith | ( | VPValue * | New | ) |
Definition at line 1420 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 1424 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 193 of file VPlanValue.h.
References assert(), and UnderlyingVal.
Referenced by llvm::VPBuilder::createNaryOp().
|
inline |
Definition at line 134 of file VPlanValue.h.
References Users.
Referenced by llvm::VPWidenCastRecipe::computeCost(), hasMoreThanOneUniqueUser(), and users().
|
inline |
Definition at line 135 of file VPlanValue.h.
References Users.
|
inline |
Definition at line 136 of file VPlanValue.h.
References Users.
Referenced by hasMoreThanOneUniqueUser(), and users().
|
inline |
Definition at line 137 of file VPlanValue.h.
References Users.
|
inline |
Definition at line 138 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 139 of file VPlanValue.h.
References user_begin(), and user_end().
|
friend |
Definition at line 53 of file VPlanValue.h.
|
friend |
Definition at line 47 of file VPlanValue.h.
|
friend |
Definition at line 48 of file VPlanValue.h.
|
friend |
Definition at line 49 of file VPlanValue.h.
|
friend |
Definition at line 50 of file VPlanValue.h.
|
friend |
Definition at line 54 of file VPlanValue.h.
|
friend |
Definition at line 51 of file VPlanValue.h.
|
friend |
Definition at line 57 of file VPlanValue.h.
|
friend |
Definition at line 52 of file VPlanValue.h.
|
friend |
Definition at line 56 of file VPlanValue.h.
|
friend |
Definition at line 55 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 69 of file VPlanValue.h.
Referenced by dump(), getDefiningRecipe(), print(), VPValue(), and ~VPValue().
|
protected |
Definition at line 65 of file VPlanValue.h.
Referenced by getUnderlyingValue(), and setUnderlyingValue().