|
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 , VPVRecipeValueSC , 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 49 of file VPlanValue.h.
Definition at line 135 of file VPlanValue.h.
Definition at line 137 of file VPlanValue.h.
| typedef SmallVectorImpl<VPUser*>::iterator llvm::VPValue::user_iterator |
Definition at line 134 of file VPlanValue.h.
Definition at line 136 of file VPlanValue.h.
| anonymous enum |
An enumeration for keeping track of the concrete subclass of VPValue that are actually instantiated.
| Enumerator | |
|---|---|
| VPVIRValueSC | |
| VPVSymbolicSC | |
| VPVRecipeValueSC | A symbolic live-in VPValue without IR backing. |
| VPRegionValueSC | A VPValue defined by a recipe. |
Definition at line 81 of file VPlanValue.h.
|
inlinevirtual |
Definition at line 92 of file VPlanValue.h.
References assert().
|
inline |
Definition at line 119 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 501 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 108 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 127 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(), 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(), and tryToMatchAndCreateMulAccumulateReduction().
| const VPRecipeBase * VPValue::getDefiningRecipe | ( | ) | const |
Definition at line 132 of file VPlan.cpp.
References llvm::dyn_cast().
| Value * VPValue::getLiveInIRValue | ( | ) | const |
Return the underlying IR value for a VPIRValue.
Definition at line 137 of file VPlan.cpp.
References llvm::cast().
Referenced by llvm::VPlanTransforms::addMinimumVectorEpilogueIterationCheck(), llvm::VPReplicateRecipe::computeCost(), createLoopRegion(), llvm::VPDerivedIVRecipe::execute(), llvm::VPFirstOrderRecurrencePHIRecipe::execute(), llvm::VPWidenCallRecipe::getCalledScalarFunction(), llvm::VPlanTransforms::materializeConstantVectorTripCount(), preparePlanForEpilogueVectorLoop(), and preparePlanForMainVectorLoop().
|
inline |
Definition at line 113 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 176 of file VPlanValue.h.
References hasOneUse(), and user_begin().
Definition at line 177 of file VPlanValue.h.
References hasOneUse(), and user_begin().
|
inline |
Return the underlying Value attached to this VPValue.
Definition at line 74 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::VPWidenPHIRecipe::clone(), llvm::VPWidenRecipe::clone(), llvm::VPInstruction::computeCost(), llvm::VPReplicateRecipe::computeCost(), llvm::VPWidenCastRecipe::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(), llvm::VPlanTransforms::truncateToMinimalBitwidths(), llvm::VPlanTransforms::tryToConvertVPInstructionsToVPRecipes(), llvm::VPRecipeBuilder::tryToWidenMemory(), and llvm::VPReductionEVLRecipe::VPReductionEVLRecipe().
|
inline |
Definition at line 99 of file VPlanValue.h.
|
inline |
Returns true if this VPValue is defined by a recipe.
Definition at line 196 of file VPlanValue.h.
References getDefiningRecipe().
|
inline |
Returns true if the value has more than one unique user.
Definition at line 161 of file VPlanValue.h.
References getNumUsers(), user_begin(), and user_end().
|
inline |
Definition at line 172 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 1495 of file VPlan.cpp.
References isDefinedInsideLoopRegions().
Referenced by llvm::VPReplicateRecipe::computeCost(), llvm::VPRecipeWithIRFlags::getCostForRecipeWithOpcode(), getExpressionIV(), and llvm::VPlanTransforms::hoistInvariantLoads().
| void VPValue::print | ( | raw_ostream & | OS, |
| VPSlotTracker & | Tracker ) const |
Definition at line 101 of file VPlan.cpp.
References getDefiningRecipe(), and printAsOperand().
Referenced by dump().
| void VPValue::printAsOperand | ( | raw_ostream & | OS, |
| VPSlotTracker & | Tracker ) const |
Definition at line 1540 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 125 of file VPlanValue.h.
References assertNotMaterialized(), find(), and I.
| void VPValue::replaceAllUsesWith | ( | VPValue * | New | ) |
Definition at line 1498 of file VPlan.cpp.
References llvm::dyn_cast(), and replaceUsesWithIf().
Referenced by llvm::VPlanTransforms::addActiveLaneMask(), llvm::VPlanTransforms::adjustFixedOrderRecurrences(), convertRecipesInRegionBlocksToSingleScalar(), llvm::VPlanTransforms::convertToConcreteRecipes(), llvm::VPlanTransforms::convertToVariableLengthStep(), llvm::VPlanTransforms::createInterleaveGroups(), createLoopRegion(), createReplicateRegion(), llvm::VPExpressionRecipe::decompose(), llvm::VPRegionBlock::dissolveToCFGLoop(), llvm::VPlanTransforms::expandSCEVs(), expandVPWidenIntOrFpInduction(), fixupVFUsersForEVL(), llvm::VPlanTransforms::handleFindLastReductions(), handleFirstArgMinOrMax(), llvm::VPlanTransforms::materializeBackedgeTakenCount(), llvm::VPlanTransforms::materializeFactors(), llvm::VPlanTransforms::materializeVectorTripCount(), llvm::VPlanTransforms::narrowInterleaveGroups(), llvm::VPlanTransforms::optimizeFindIVReductions(), preparePlanForEpilogueVectorLoop(), removeRedundantCanonicalIVs(), 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 1504 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(), and sinkScalarOperands().
|
inline |
Definition at line 202 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 139 of file VPlanValue.h.
References assertNotMaterialized().
Referenced by getSingleUser(), getSingleUser(), hasMoreThanOneUniqueUser(), users(), and users().
|
inline |
Definition at line 143 of file VPlanValue.h.
References assertNotMaterialized().
|
inline |
Definition at line 147 of file VPlanValue.h.
References assertNotMaterialized().
Referenced by hasMoreThanOneUniqueUser(), users(), and users().
|
inline |
Definition at line 151 of file VPlanValue.h.
References assertNotMaterialized().
|
inline |
Definition at line 155 of file VPlanValue.h.
References user_begin(), and user_end().
Referenced by llvm::VPlanTransforms::addActiveLaneMask(), llvm::VPlanTransforms::createInLoopReductionRecipes(), llvm::VPlanTransforms::createPartialReductions(), createWidenInductionRecipe(), llvm::vputils::findCanonicalIVIncrement(), llvm::vputils::findHeaderMask(), llvm::vputils::findRecipe(), fixupVFUsersForEVL(), hoistPreviousBeforeFORUsers(), poisonGuaranteesUB(), reassociateHeaderMask(), removeRedundantCanonicalIVs(), removeRedundantInductionCasts(), sinkRecurrenceUsersAfterPrevious(), and sinkScalarOperands().
|
inline |
Definition at line 156 of file VPlanValue.h.
References user_begin(), and user_end().
|
friend |
|
friend |
|
friend |
|
friend |
Definition at line 51 of file VPlanValue.h.
References VPSymbolicValue.
Referenced by VPSymbolicValue.