LLVM 22.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 () 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 | |
Value * | UnderlyingVal |
VPDef * | Def |
Pointer to the VPDef that defines this VPValue. | |
Friends | |
class | VPDef |
struct | VPDoubleValueDef |
class | VPInterleaveRecipe |
class | VPlan |
class | VPExpressionRecipe |
Definition at line 48 of file VPlanValue.h.
Definition at line 126 of file VPlanValue.h.
Definition at line 128 of file VPlanValue.h.
typedef SmallVectorImpl<VPUser*>::iterator llvm::VPValue::user_iterator |
Definition at line 125 of file VPlanValue.h.
Definition at line 127 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 89 of file VPlanValue.h.
|
inlineprotected |
Create a live-in VPValue.
Definition at line 70 of file VPlanValue.h.
Create a VPValue for a Def
which is a subclass of VPValue.
Definition at line 72 of file VPlanValue.h.
Create a VPValue for a Def
which defines multiple values.
Definition at line 74 of file VPlanValue.h.
|
virtual |
|
inline |
Definition at line 114 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 108 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 125 of file VPlan.cpp.
References Def.
Referenced by canNarrowLoad(), llvm::VPlanTransforms::canonicalizeEVLLoops(), llvm::VPWidenCastRecipe::computeCost(), llvm::VPPartialReductionRecipe::computeCost(), createReplicateRegion(), expandVPWidenIntOrFpInduction(), getOptimizableIVOf(), llvm::vputils::getOrCreateVPValueForSCEVExpr(), llvm::VPWidenIntOrFpInductionRecipe::isCanonical(), isDefinedInsideLoopRegions(), llvm::vputils::isSingleScalar(), llvm::VPlanTransforms::narrowInterleaveGroups(), preparePlanForMainVectorLoop(), recursivelyDeleteDeadRecipes(), transformRecipestoEVLRecipes(), llvm::VPRecipeBuilder::tryToCreatePartialReduction(), and tryToMatchAndCreateMulAccumulateReduction().
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 174 of file VPlanValue.h.
References assert().
Referenced by llvm::VPHistogramRecipe::computeCost(), llvm::VPReplicateRecipe::computeCost(), llvm::VPlanTransforms::convertToConcreteRecipes(), llvm::VPlan::duplicate(), llvm::VPWidenRecipe::execute(), llvm::VPFirstOrderRecurrencePHIRecipe::execute(), llvm::LoopVectorizationPlanner::executePlan(), llvm::VPWidenIntOrFpInductionRecipe::getScalarType(), llvm::VPCanonicalIVPHIRecipe::getScalarType(), llvm::VPDerivedIVRecipe::getScalarType(), getStartValueFromReductionResult(), llvm::VPWidenIntOrFpInductionRecipe::isCanonical(), llvm::VPlanPatternMatch::int_pred_ty< Pred, BitWidth >::match(), llvm::VPlanTransforms::materializeConstantVectorTripCount(), llvm::VPlanTransforms::materializeVectorTripCount(), preparePlanForEpilogueVectorLoop(), and preparePlanForMainVectorLoop().
|
inline |
Definition at line 113 of file VPlanValue.h.
References Users.
Referenced by llvm::VPWidenCastRecipe::computeCost(), createReplicateRegion(), llvm::VPlanTransforms::materializeBackedgeTakenCount(), llvm::VPlanTransforms::materializeBroadcasts(), llvm::VPlanTransforms::materializeVectorTripCount(), llvm::VPlanTransforms::materializeVFAndVFxUF(), llvm::VPlan::printLiveIns(), replaceUsesWithIf(), llvm::VPlan::resetTripCount(), simplifyBlends(), and transformRecipestoEVLRecipes().
|
inline |
Return the underlying Value attached to this VPValue.
Definition at line 85 of file VPlanValue.h.
Referenced by llvm::VPInstructionWithType::clone(), llvm::VPWidenCastRecipe::clone(), llvm::VPWidenIntrinsicRecipe::clone(), llvm::VPReductionPHIRecipe::clone(), llvm::VPInstruction::computeCost(), llvm::VPWidenCastRecipe::computeCost(), llvm::VPWidenSelectRecipe::computeCost(), llvm::VPReplicateRecipe::computeCost(), llvm::VPWidenRecipe::execute(), llvm::VPWidenIntrinsicRecipe::execute(), llvm::VPWidenCallRecipe::execute(), llvm::VPRecipeWithIRFlags::getCostForRecipeWithOpcode(), llvm::VPWidenInductionRecipe::getPHINode(), llvm::VPSingleDefRecipe::getUnderlyingInstr(), optimizeVectorInductionWidthForTCAndVFUF(), llvm::VPlanTransforms::truncateToMinimalBitwidths(), and llvm::VPlanTransforms::tryToConvertVPInstructionsToVPRecipes().
|
inline |
Definition at line 103 of file VPlanValue.h.
|
inline |
Returns true if this VPValue is defined by a recipe.
Definition at line 166 of file VPlanValue.h.
|
inline |
Returns true if the value has more than one unique user.
Definition at line 140 of file VPlanValue.h.
Referenced by llvm::VPWidenCastRecipe::computeCost().
bool VPValue::isDefinedOutsideLoopRegions | ( | ) | const |
Returns true if the VPValue is defined outside any loop.
Definition at line 1400 of file VPlan.cpp.
References isDefinedInsideLoopRegions().
Referenced by llvm::VPWidenSelectRecipe::computeCost(), and llvm::VPRecipeWithIRFlags::getCostForRecipeWithOpcode().
|
inline |
Returns true if this VPValue is a live-in, i.e. defined outside the VPlan.
Definition at line 169 of file VPlanValue.h.
Referenced by llvm::VPWidenCastRecipe::computeCost(), llvm::VPHistogramRecipe::computeCost(), llvm::VPlanTransforms::convertToConcreteRecipes(), llvm::VPlan::duplicate(), llvm::VPIRInstruction::extractLastLaneOfFirstOperand(), llvm::VPlan::getOrAddLiveIn(), llvm::VPlanTransforms::handleUncountableEarlyExit(), isAlreadyNarrow(), llvm::vputils::isSingleScalar(), llvm::VPlanPatternMatch::int_pred_ty< Pred, BitWidth >::match(), llvm::VPlanTransforms::materializeConstantVectorTripCount(), llvm::VPlanTransforms::materializeVectorTripCount(), optimizeVectorInductionWidthForTCAndVFUF(), and llvm::VPlan::printLiveIns().
void VPValue::print | ( | raw_ostream & | OS, |
VPSlotTracker & | Tracker | ||
) | const |
void VPValue::printAsOperand | ( | raw_ostream & | OS, |
VPSlotTracker & | Tracker | ||
) | const |
Definition at line 1442 of file VPlan.cpp.
References llvm::VPSlotTracker::getOrCreateName(), and OS.
Referenced by llvm::VPInstruction::print(), llvm::VPInstructionWithType::print(), llvm::VPPhi::print(), llvm::VPWidenRecipe::print(), llvm::VPWidenCastRecipe::print(), llvm::VPWidenIntrinsicRecipe::print(), llvm::VPWidenCallRecipe::print(), llvm::VPHistogramRecipe::print(), llvm::VPWidenSelectRecipe::print(), llvm::VPWidenGEPRecipe::print(), llvm::VPVectorEndPointerRecipe::print(), llvm::VPVectorPointerRecipe::print(), llvm::VPWidenIntOrFpInductionRecipe::print(), llvm::VPWidenPointerInductionRecipe::print(), llvm::VPWidenPHIRecipe::print(), llvm::VPFirstOrderRecurrencePHIRecipe::print(), llvm::VPReductionPHIRecipe::print(), llvm::VPBlendRecipe::print(), llvm::VPInterleaveRecipe::print(), llvm::VPReductionRecipe::print(), llvm::VPPartialReductionRecipe::print(), llvm::VPReductionEVLRecipe::print(), llvm::VPReplicateRecipe::print(), llvm::VPExpressionRecipe::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(), print(), and llvm::VPlan::printLiveIns().
|
inline |
void VPValue::replaceAllUsesWith | ( | VPValue * | New | ) |
Definition at line 1403 of file VPlan.cpp.
References replaceUsesWithIf().
Referenced by llvm::VPlanTransforms::addActiveLaneMask(), addExitUsersForFirstOrderRecurrences(), llvm::VPlanTransforms::canonicalizeEVLLoops(), llvm::VPlanTransforms::convertToConcreteRecipes(), llvm::VPlanTransforms::createInterleaveGroups(), createReplicateRegion(), llvm::VPExpressionRecipe::decompose(), llvm::VPRegionBlock::dissolveToCFGLoop(), llvm::VPlanTransforms::expandSCEVs(), expandVPWidenIntOrFpInduction(), legalizeAndOptimizeInductions(), llvm::VPlanTransforms::materializeBackedgeTakenCount(), llvm::VPlanTransforms::materializeVectorTripCount(), llvm::VPlanTransforms::materializeVFAndVFxUF(), llvm::VPlanTransforms::narrowInterleaveGroups(), preparePlanForEpilogueVectorLoop(), removeRedundantCanonicalIVs(), removeRedundantInductionCasts(), simplifyBlends(), simplifyBranchConditionForVFAndUF(), transformRecipestoEVLRecipes(), llvm::VPlanTransforms::truncateToMinimalBitwidths(), and llvm::VPlanTransforms::tryToConvertVPInstructionsToVPRecipes().
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 1407 of file VPlan.cpp.
References llvm::User::getNumOperands(), getNumUsers(), llvm::User::getOperand(), I, and llvm::User::setOperand().
Referenced by llvm::VPlanTransforms::materializeBroadcasts(), llvm::VPlanTransforms::materializeVFAndVFxUF(), mergeReplicateRegionsIntoSuccessors(), preparePlanForMainVectorLoop(), replaceAllUsesWith(), sinkScalarOperands(), and transformRecipestoEVLRecipes().
|
inline |
Definition at line 184 of file VPlanValue.h.
References assert().
Referenced by llvm::VPBuilder::createNaryOp(), and llvm::VPlanTransforms::materializeConstantVectorTripCount().
|
inline |
Definition at line 130 of file VPlanValue.h.
References Users.
Referenced by llvm::VPWidenCastRecipe::computeCost().
|
inline |
Definition at line 131 of file VPlanValue.h.
References Users.
|
inline |
Definition at line 132 of file VPlanValue.h.
References Users.
|
inline |
Definition at line 133 of file VPlanValue.h.
References Users.
|
inline |
Definition at line 134 of file VPlanValue.h.
Referenced by llvm::VPlanTransforms::addActiveLaneMask(), findHeaderMask(), llvm::VPlanTransforms::handleMaxMinNumReductions(), removeRedundantCanonicalIVs(), removeRedundantInductionCasts(), llvm::VPReplicateRecipe::shouldPack(), sinkRecurrenceUsersAfterPrevious(), sinkScalarOperands(), and transformRecipestoEVLRecipes().
|
inline |
Definition at line 135 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 53 of file VPlanValue.h.
|
friend |
Definition at line 51 of file VPlanValue.h.
|
friend |
Definition at line 52 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 65 of file VPlanValue.h.
Referenced by dump(), getDefiningRecipe(), print(), VPValue(), and ~VPValue().
|
protected |
Definition at line 61 of file VPlanValue.h.