|
LLVM 23.0.0git
|
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"
Public Types | |
| enum | { VPVIRValueSC , VPVSymbolicSC , VPVSingleDefValueSC , VPVMultiDefValueSC , VPRegionValueSC } |
| 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. | |
| Value * | getLiveInIRValue () const |
| Return the underlying IR value for a VPIRValue. | |
| 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). | |
| void | assertNotMaterialized () const |
| Assert that this VPValue has not been materialized, if it is a VPSymbolicValue. | |
| 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 |
| VPUser * | getSingleUser () |
| Return the single user of this value, or nullptr if there is not exactly one user. | |
| const VPUser * | getSingleUser () 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 | isDefinedOutsideLoopRegions () const |
| Returns true if the VPValue is defined outside any loop. | |
| void | setUnderlyingValue (Value *Val) |
Friends | |
| struct | VPIRValue |
| struct | VPSymbolicValue |
| class | VPRecipeValue |
| class | VPRegionValue |
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 50 of file VPlanValue.h.
Definition at line 137 of file VPlanValue.h.
Definition at line 139 of file VPlanValue.h.
| typedef SmallVectorImpl<VPUser*>::iterator llvm::VPValue::user_iterator |
Definition at line 136 of file VPlanValue.h.
Definition at line 138 of file VPlanValue.h.
| anonymous enum |
An enumeration for keeping track of the concrete subclass of VPValue that are actually instantiated.
| Enumerator | |
|---|---|
| VPVIRValueSC | |
| VPVSymbolicSC | |
| VPVSingleDefValueSC | A symbolic live-in VPValue without IR backing. |
| VPVMultiDefValueSC | A VPValue defined by a VPSingleDefRecipe. |
| VPRegionValueSC | A VPValue defined by a multi-def recipe. |
Definition at line 82 of file VPlanValue.h.
|
inlinevirtual |
Definition at line 94 of file VPlanValue.h.
References assert().
|
inline |
Definition at line 121 of file VPlanValue.h.
References assertNotMaterialized().
Referenced by llvm::VPUser::addOperand().
|
inline |
Assert that this VPValue has not been materialized, if it is a VPSymbolicValue.
Definition at line 548 of file VPlanValue.h.
References assert(), llvm::cast(), and llvm::isa().
Referenced by addUser(), getNumUsers(), removeUser(), replaceUsesWithIf(), user_begin(), user_begin(), user_end(), and user_end().
| void VPValue::dump | ( | ) | const |
Dump the value to stderr (for debugging).
Definition at line 109 of file VPlan.cpp.
References llvm::dbgs(), getDefiningRecipe(), 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 130 of file VPlan.cpp.
References llvm::dyn_cast().
Referenced by canNarrowLoad(), llvm::VPReductionRecipe::classof(), cloneBinOpForScalarIV(), llvm::VPlanTransforms::createInterleaveGroups(), createReplicateRegion(), createWidenInductionRecipe(), dump(), expandVPWidenIntOrFpInduction(), llvm::vputils::findRecipe(), fixupVFUsersForEVL(), llvm::VPRecipeWithIRFlags::getCostForRecipeWithOpcode(), getDefiningRecipe(), getOptimizableIVOf(), llvm::vputils::getRecipesForUncountableExit(), llvm::VPlanTransforms::handleFindLastReductions(), handleFirstArgMinOrMax(), llvm::VPlanTransforms::handleUncountableEarlyExits(), hasDefiningRecipe(), isDefinedInsideLoopRegions(), llvm::vputils::isSingleScalar(), llvm::VPlanTransforms::materializeVectorTripCount(), llvm::VPlanTransforms::optimizeFindIVReductions(), print(), recursivelyDeleteDeadRecipes(), removeCommonBlendMask(), llvm::VPlanTransforms::removeDeadRecipes(), tryToMatchAndCreateMulAccumulateReduction(), and llvm::VPRecipeValue::~VPRecipeValue().
| const VPRecipeBase * VPValue::getDefiningRecipe | ( | ) | const |
Definition at line 139 of file VPlan.cpp.
References getDefiningRecipe().
| Value * VPValue::getLiveInIRValue | ( | ) | const |
Return the underlying IR value for a VPIRValue.
Definition at line 143 of file VPlan.cpp.
References llvm::cast().
Referenced by llvm::VPlanTransforms::addMinimumVectorEpilogueIterationCheck(), llvm::VPReplicateRecipe::computeCost(), createLoopRegion(), decideCallWidening(), llvm::VPFirstOrderRecurrencePHIRecipe::execute(), llvm::VPWidenCallRecipe::getCalledScalarFunction(), llvm::VPlanTransforms::materializeConstantVectorTripCount(), preparePlanForEpilogueVectorLoop(), and preparePlanForMainVectorLoop().
|
inline |
Definition at line 115 of file VPlanValue.h.
References assertNotMaterialized().
Referenced by llvm::calculateRegisterUsageForPlan(), createReplicateRegion(), llvm::VPlanTransforms::handleMultiUseReductions(), hasMoreThanOneUniqueUser(), hasOneUse(), llvm::VPlanTransforms::materializeBackedgeTakenCount(), llvm::VPlanTransforms::materializeConstantVectorTripCount(), llvm::VPlanTransforms::materializeFactors(), llvm::VPlanTransforms::materializeVectorTripCount(), llvm::VPlanTransforms::removeDeadRecipes(), replaceUsesWithIf(), llvm::VPlan::resetTripCount(), and simplifyBlends().
|
inline |
Return the single user of this value, or nullptr if there is not exactly one user.
Definition at line 178 of file VPlanValue.h.
References hasOneUse(), and user_begin().
Definition at line 179 of file VPlanValue.h.
References hasOneUse(), and user_begin().
|
inline |
Return the underlying Value attached to this VPValue.
Definition at line 75 of file VPlanValue.h.
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::VPWidenRecipe::clone(), llvm::VPInstruction::computeCost(), llvm::VPReplicateRecipe::computeCost(), llvm::VPlanTransforms::dropPoisonGeneratingRecipes(), llvm::VPWidenCallRecipe::execute(), llvm::VPWidenIntrinsicRecipe::execute(), llvm::VPRecipeWithIRFlags::getCostForRecipeWithOpcode(), llvm::VPWidenInductionRecipe::getPHINode(), llvm::VPIRValue::getType(), llvm::VPSingleDefRecipe::getUnderlyingInstr(), llvm::VPSingleDefRecipe::getUnderlyingInstr(), llvm::VPIRValue::getValue(), llvm::VPlanTransforms::materializeVectorTripCount(), preparePlanForEpilogueVectorLoop(), llvm::VPlanTransforms::truncateToMinimalBitwidths(), llvm::VPlanTransforms::tryToConvertVPInstructionsToVPRecipes(), and llvm::VPReductionEVLRecipe::VPReductionEVLRecipe().
|
inline |
Definition at line 101 of file VPlanValue.h.
|
inline |
Returns true if this VPValue is defined by a recipe.
Definition at line 198 of file VPlanValue.h.
References getDefiningRecipe().
|
inline |
Returns true if the value has more than one unique user.
Definition at line 163 of file VPlanValue.h.
References getNumUsers(), user_begin(), and user_end().
|
inline |
Definition at line 174 of file VPlanValue.h.
References getNumUsers().
Referenced by getSingleUser(), and getSingleUser().
| bool VPValue::isDefinedOutsideLoopRegions | ( | ) | const |
Returns true if the VPValue is defined outside any loop.
Definition at line 1486 of file VPlan.cpp.
References isDefinedInsideLoopRegions().
Referenced by llvm::VPReplicateRecipe::computeCost(), llvm::VPRecipeWithIRFlags::getCostForRecipeWithOpcode(), and getExpressionIV().
| void VPValue::print | ( | raw_ostream & | OS, |
| VPSlotTracker & | Tracker ) const |
Definition at line 102 of file VPlan.cpp.
References getDefiningRecipe(), and printAsOperand().
Referenced by dump().
| void VPValue::printAsOperand | ( | raw_ostream & | OS, |
| VPSlotTracker & | Tracker ) const |
Definition at line 1531 of file VPlan.cpp.
References llvm::VPSlotTracker::getOrCreateName().
Referenced by print(), llvm::VPActiveLaneMaskPHIRecipe::printRecipe(), llvm::VPBlendRecipe::printRecipe(), llvm::VPCurrentIterationPHIRecipe::printRecipe(), llvm::VPDerivedIVRecipe::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().
|
inline |
Remove a single User from the list of users.
Definition at line 127 of file VPlanValue.h.
References assertNotMaterialized(), find(), and I.
| void VPValue::replaceAllUsesWith | ( | VPValue * | New | ) |
Definition at line 1489 of file VPlan.cpp.
References llvm::dyn_cast(), and replaceUsesWithIf().
Referenced by llvm::VPlanTransforms::addActiveLaneMask(), convertRecipesInRegionBlocksToSingleScalar(), llvm::VPlanTransforms::convertToConcreteRecipes(), llvm::VPlanTransforms::convertToVariableLengthStep(), llvm::VPlanTransforms::createInterleaveGroups(), createLoopRegion(), createReplicateRegion(), llvm::VPRegionBlock::dissolveToCFGLoop(), llvm::VPlanTransforms::expandSCEVs(), expandVPWidenIntOrFpInduction(), fixupVFUsersForEVL(), llvm::VPlanTransforms::handleFindLastReductions(), handleFirstArgMinOrMax(), llvm::VPlanTransforms::materializeBackedgeTakenCount(), llvm::VPlanTransforms::materializeFactors(), llvm::VPlanTransforms::materializeVectorTripCount(), narrowToSingleScalarRecipes(), llvm::VPlanTransforms::optimizeFindIVReductions(), preparePlanForEpilogueVectorLoop(), removeRedundantInductionCasts(), simplifyBlends(), simplifyRecipe(), llvm::VPlanTransforms::truncateToMinimalBitwidths(), llvm::VPlanTransforms::tryToConvertVPInstructionsToVPRecipes(), and llvm::VPlanTransforms::unrollByUF().
| 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 1495 of file VPlan.cpp.
References assertNotMaterialized(), llvm::User::getNumOperands(), getNumUsers(), llvm::User::getOperand(), I, and llvm::User::setOperand().
Referenced by fixupVFUsersForEVL(), llvm::VPlanTransforms::materializeFactors(), mergeReplicateRegionsIntoSuccessors(), preparePlanForMainVectorLoop(), replaceAllUsesWith(), llvm::VPlanTransforms::replaceSymbolicStrides(), sinkScalarOperands(), and tryToSinkOrHoistRecurrenceUsers().
|
inline |
Definition at line 204 of file VPlanValue.h.
References assert().
Referenced by llvm::VPInstruction::execute(), llvm::VPlanTransforms::materializeConstantVectorTripCount(), llvm::VPBlendRecipe::VPBlendRecipe(), and llvm::VPReductionRecipe::VPReductionRecipe().
|
inline |
Definition at line 141 of file VPlanValue.h.
References assertNotMaterialized().
Referenced by getSingleUser(), getSingleUser(), hasMoreThanOneUniqueUser(), users(), and users().
|
inline |
Definition at line 145 of file VPlanValue.h.
References assertNotMaterialized().
|
inline |
Definition at line 149 of file VPlanValue.h.
References assertNotMaterialized().
Referenced by hasMoreThanOneUniqueUser(), users(), and users().
|
inline |
Definition at line 153 of file VPlanValue.h.
References assertNotMaterialized().
|
inline |
Definition at line 157 of file VPlanValue.h.
References user_begin(), and user_end().
Referenced by llvm::VPlanTransforms::createInLoopReductionRecipes(), llvm::VPlanTransforms::createPartialReductions(), createWidenInductionRecipe(), llvm::vputils::findCanonicalIVIncrement(), llvm::vputils::findHeaderMask(), llvm::vputils::findRecipe(), fixupVFUsersForEVL(), hoistPreviousBeforeFORUsers(), llvm::vputils::isUsedByLoadStoreAddress(), poisonGuaranteesUB(), reassociateHeaderMask(), removeRedundantInductionCasts(), sinkRecurrenceUsersAfterPrevious(), and sinkScalarOperands().
|
inline |
Definition at line 158 of file VPlanValue.h.
References user_begin(), and user_end().
|
friend |
|
friend |
|
friend |
|
friend |
Definition at line 52 of file VPlanValue.h.
References VPSymbolicValue.
Referenced by VPSymbolicValue.