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. | |
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). | |
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 | VPInterleaveBase |
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.
Definition at line 98 of file VPlan.cpp.
References Def, UnderlyingVal, and VPDef.
Referenced by llvm::VPWidenLoadEVLRecipe::execute(), llvm::VPWidenLoadEVLRecipe::getEVL(), llvm::VPWidenLoadEVLRecipe::onlyFirstLaneUsed(), llvm::VPWidenLoadRecipe::onlyFirstLaneUsed(), operator=(), replaceAllUsesWith(), replaceUsesWithIf(), llvm::VPSingleDefRecipe::VPSingleDefRecipe(), llvm::VPSingleDefRecipe::VPSingleDefRecipe(), VPValue(), VPValue(), VPValue(), VPValue(), llvm::VPWidenLoadEVLRecipe::VPWidenLoadEVLRecipe(), and llvm::VPWidenLoadRecipe::VPWidenLoadRecipe().
|
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.
References Def, VPDef, VPValue(), and VPVRecipeSC.
|
virtual |
|
inline |
Definition at line 114 of file VPlanValue.h.
Referenced by llvm::VPUser::addOperand().
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().
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 135 of file VPlan.cpp.
References llvm::cast_or_null(), and Def.
Referenced by canNarrowLoad(), llvm::VPlanTransforms::canonicalizeEVLLoops(), llvm::VPPartialReductionRecipe::computeCost(), llvm::VPWidenCastRecipe::computeCost(), llvm::VPlanTransforms::createInterleaveGroups(), createReplicateRegion(), expandVPWidenIntOrFpInduction(), getOptimizableIVOf(), llvm::vputils::getOrCreateVPValueForSCEVExpr(), hasDefiningRecipe(), llvm::VPWidenIntOrFpInductionRecipe::isCanonical(), isDefinedInsideLoopRegions(), llvm::vputils::isSingleScalar(), llvm::VPlanTransforms::narrowInterleaveGroups(), preparePlanForMainVectorLoop(), recursivelyDeleteDeadRecipes(), removeCommonBlendMask(), transformRecipestoEVLRecipes(), llvm::VPRecipeBuilder::tryToCreatePartialReduction(), and tryToMatchAndCreateMulAccumulateReduction().
const VPRecipeBase * VPValue::getDefiningRecipe | ( | ) | const |
Definition at line 139 of file VPlan.cpp.
References llvm::cast_or_null(), and Def.
|
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 176 of file VPlanValue.h.
References assert(), getUnderlyingValue(), and isLiveIn().
Referenced by llvm::VPHistogramRecipe::computeCost(), llvm::VPInstruction::computeCost(), llvm::VPReplicateRecipe::computeCost(), llvm::VPlanTransforms::convertToConcreteRecipes(), llvm::VPDerivedIVRecipe::execute(), llvm::VPFirstOrderRecurrencePHIRecipe::execute(), llvm::VPWidenRecipe::execute(), llvm::LoopVectorizationPlanner::executePlan(), llvm::VPWidenCallRecipe::getCalledScalarFunction(), llvm::VPCanonicalIVPHIRecipe::getScalarType(), llvm::VPDerivedIVRecipe::getScalarType(), llvm::VPWidenIntOrFpInductionRecipe::getScalarType(), getStartValueFromReductionResult(), llvm::VPWidenIntOrFpInductionRecipe::isCanonical(), llvm::VPlanPatternMatch::bind_const_int::match(), llvm::VPlanPatternMatch::int_pred_ty< is_specific_int, Bitwidth >::match(), llvm::VPlanTransforms::materializeConstantVectorTripCount(), llvm::VPlanTransforms::materializeVectorTripCount(), preparePlanForEpilogueVectorLoop(), preparePlanForMainVectorLoop(), and llvm::VPWidenCallRecipe::VPWidenCallRecipe().
|
inline |
Definition at line 113 of file VPlanValue.h.
Referenced by llvm::VPWidenCastRecipe::computeCost(), createReplicateRegion(), hasMoreThanOneUniqueUser(), hasOneUse(), llvm::VPlanTransforms::materializeBackedgeTakenCount(), llvm::VPlanTransforms::materializeBroadcasts(), llvm::VPlanTransforms::materializeVectorTripCount(), llvm::VPlanTransforms::materializeVFAndVFxUF(), replaceUsesWithIf(), llvm::VPlan::resetTripCount(), simplifyBlends(), and transformRecipestoEVLRecipes().
|
inline |
Return the underlying Value attached to this VPValue.
Definition at line 85 of file VPlanValue.h.
References UnderlyingVal.
Referenced by llvm::VPBlendRecipe::clone(), llvm::VPInstruction::clone(), llvm::VPInstructionWithType::clone(), llvm::VPPhi::clone(), llvm::VPReductionPHIRecipe::clone(), llvm::VPWidenCallRecipe::clone(), llvm::VPWidenCastRecipe::clone(), llvm::VPWidenIntrinsicRecipe::clone(), llvm::VPWidenPHIRecipe::clone(), llvm::VPWidenRecipe::clone(), llvm::VPInstruction::computeCost(), llvm::VPReplicateRecipe::computeCost(), llvm::VPWidenCastRecipe::computeCost(), llvm::VPWidenSelectRecipe::computeCost(), llvm::VPlanTransforms::dropPoisonGeneratingRecipes(), llvm::VPWidenCallRecipe::execute(), llvm::VPWidenIntrinsicRecipe::execute(), llvm::VPWidenRecipe::execute(), llvm::VPRecipeWithIRFlags::getCostForRecipeWithOpcode(), getLiveInIRValue(), llvm::VPWidenInductionRecipe::getPHINode(), llvm::VPSingleDefRecipe::getUnderlyingInstr(), llvm::VPSingleDefRecipe::getUnderlyingInstr(), optimizeVectorInductionWidthForTCAndVFUF(), llvm::VPlanTransforms::truncateToMinimalBitwidths(), llvm::VPlanTransforms::tryToConvertVPInstructionsToVPRecipes(), and llvm::VPReductionEVLRecipe::VPReductionEVLRecipe().
|
inline |
Definition at line 103 of file VPlanValue.h.
|
inline |
Returns true if this VPValue is defined by a recipe.
Definition at line 168 of file VPlanValue.h.
References getDefiningRecipe().
Referenced by isLiveIn().
|
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().
|
inline |
Definition at line 151 of file VPlanValue.h.
References getNumUsers().
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().
|
inline |
Returns true if this VPValue is a live-in, i.e. defined outside the VPlan.
Definition at line 171 of file VPlanValue.h.
References hasDefiningRecipe().
Referenced by llvm::VPHistogramRecipe::computeCost(), llvm::VPWidenCastRecipe::computeCost(), llvm::VPlanTransforms::convertToConcreteRecipes(), llvm::VPIRInstruction::extractLastLaneOfFirstOperand(), getLiveInIRValue(), llvm::VPlan::getOrAddLiveIn(), llvm::VPlanTransforms::handleUncountableEarlyExit(), isAlreadyNarrow(), llvm::vputils::isSingleScalar(), llvm::VPlanPatternMatch::bind_const_int::match(), llvm::VPlanPatternMatch::int_pred_ty< is_specific_int, Bitwidth >::match(), llvm::VPlanPatternMatch::live_in_vpvalue::match(), llvm::VPlanTransforms::materializeConstantVectorTripCount(), llvm::VPlanTransforms::materializeVectorTripCount(), and optimizeVectorInductionWidthForTCAndVFUF().
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().
void VPValue::printAsOperand | ( | raw_ostream & | OS, |
VPSlotTracker & | Tracker ) const |
Definition at line 1451 of file VPlan.cpp.
References llvm::VPSlotTracker::getOrCreateName().
Referenced by llvm::VPActiveLaneMaskPHIRecipe::print(), llvm::VPBlendRecipe::print(), llvm::VPCanonicalIVPHIRecipe::print(), llvm::VPDerivedIVRecipe::print(), llvm::VPEVLBasedIVPHIRecipe::print(), llvm::VPExpandSCEVRecipe::print(), llvm::VPExpressionRecipe::print(), llvm::VPFirstOrderRecurrencePHIRecipe::print(), llvm::VPHistogramRecipe::print(), llvm::VPInstruction::print(), llvm::VPInstructionWithType::print(), llvm::VPInterleaveEVLRecipe::print(), llvm::VPInterleaveRecipe::print(), llvm::VPPartialReductionRecipe::print(), llvm::VPPhi::print(), llvm::VPPredInstPHIRecipe::print(), llvm::VPReductionEVLRecipe::print(), llvm::VPReductionPHIRecipe::print(), llvm::VPReductionRecipe::print(), llvm::VPReplicateRecipe::print(), llvm::VPScalarIVStepsRecipe::print(), print(), llvm::VPVectorEndPointerRecipe::print(), llvm::VPVectorPointerRecipe::print(), llvm::VPWidenCallRecipe::print(), llvm::VPWidenCanonicalIVRecipe::print(), llvm::VPWidenCastRecipe::print(), llvm::VPWidenGEPRecipe::print(), llvm::VPWidenIntOrFpInductionRecipe::print(), llvm::VPWidenIntrinsicRecipe::print(), llvm::VPWidenLoadEVLRecipe::print(), llvm::VPWidenLoadRecipe::print(), llvm::VPWidenPHIRecipe::print(), llvm::VPWidenPointerInductionRecipe::print(), llvm::VPWidenRecipe::print(), and llvm::VPWidenSelectRecipe::print().
|
inline |
Remove a single User
from the list of users.
Definition at line 117 of file VPlanValue.h.
void VPValue::replaceAllUsesWith | ( | VPValue * | New | ) |
Definition at line 1412 of file VPlan.cpp.
References replaceUsesWithIf(), and VPValue().
Referenced by llvm::VPlanTransforms::addActiveLaneMask(), addExitUsersForFirstOrderRecurrences(), llvm::VPlanTransforms::canonicalizeEVLLoops(), 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 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().
|
inline |
Definition at line 186 of file VPlanValue.h.
References assert(), and UnderlyingVal.
Referenced by llvm::VPBuilder::createNaryOp(), llvm::VPlanTransforms::materializeConstantVectorTripCount(), and llvm::VPReductionRecipe::VPReductionRecipe().
|
inline |
Definition at line 130 of file VPlanValue.h.
Referenced by llvm::VPWidenCastRecipe::computeCost(), hasMoreThanOneUniqueUser(), users(), and users().
|
inline |
Definition at line 131 of file VPlanValue.h.
|
inline |
Definition at line 132 of file VPlanValue.h.
Referenced by hasMoreThanOneUniqueUser(), users(), and users().
|
inline |
Definition at line 133 of file VPlanValue.h.
|
inline |
Definition at line 134 of file VPlanValue.h.
References user_begin(), and user_end().
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.
References user_begin(), and user_end().
|
friend |
Definition at line 49 of file VPlanValue.h.
References VPDef.
Referenced by VPDef, VPValue(), VPValue(), VPValue(), llvm::VPWidenLoadEVLRecipe::VPWidenLoadEVLRecipe(), and llvm::VPWidenLoadRecipe::VPWidenLoadRecipe().
|
friend |
Definition at line 50 of file VPlanValue.h.
References VPDoubleValueDef.
Referenced by VPDoubleValueDef.
|
friend |
Definition at line 53 of file VPlanValue.h.
References VPExpressionRecipe.
Referenced by llvm::VPExpressionRecipe::clone(), and VPExpressionRecipe.
|
friend |
Definition at line 51 of file VPlanValue.h.
References VPInterleaveBase.
Referenced by VPInterleaveBase.
|
friend |
|
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().
|
protected |
Definition at line 61 of file VPlanValue.h.
Referenced by getUnderlyingValue(), setUnderlyingValue(), and VPValue().