LLVM 22.0.0git
|
Functions | |
bool | onlyFirstLaneUsed (const VPValue *Def) |
Returns true if only the first lane of Def is used. | |
bool | onlyFirstPartUsed (const VPValue *Def) |
Returns true if only the first part of Def is used. | |
bool | onlyScalarValuesUsed (const VPValue *Def) |
Returns true if only scalar values of Def are used by all users. | |
VPValue * | getOrCreateVPValueForSCEVExpr (VPlan &Plan, const SCEV *Expr) |
Get or create a VPValue that corresponds to the expansion of Expr . | |
const SCEV * | getSCEVExprForVPValue (VPValue *V, ScalarEvolution &SE) |
Return the SCEV expression for V . | |
bool | isSingleScalar (const VPValue *VPV) |
Returns true if VPV is a single scalar, either because it produces the same value for all lanes or only has its first lane used. | |
bool | isHeaderMask (const VPValue *V, VPlan &Plan) |
Return true if V is a header mask in Plan . | |
bool | isUniformAcrossVFsAndUFs (VPValue *V) |
Checks if V is uniform across all VF lanes and UF parts. | |
VPBasicBlock * | getFirstLoopHeader (VPlan &Plan, VPDominatorTree &VPDT) |
Returns the header block of the first, top-level loop, or null if none exist. | |
VPBasicBlock * llvm::vputils::getFirstLoopHeader | ( | VPlan & | Plan, |
VPDominatorTree & | VPDT | ||
) |
Returns the header block of the first, top-level loop, or null if none exist.
Definition at line 138 of file VPlanUtils.cpp.
References llvm::find_if(), llvm::VPlan::getEntry(), I, llvm::VPBlockUtils::isHeader(), and llvm::vp_depth_first_shallow().
Referenced by llvm::VPlan::execute(), llvm::LoopVectorizationPlanner::executePlan(), and llvm::InnerLoopVectorizer::fixVectorizedLoop().
Get or create a VPValue that corresponds to the expansion of Expr
.
If Expr
is a SCEVConstant or SCEVUnknown, return a VPValue wrapping the live-in value. Otherwise return a VPExpandSCEVRecipe to expand Expr
. If Plan's
pre-header already contains a recipe expanding Expr
, return it. If not, create a new one.
Definition at line 32 of file VPlanUtils.cpp.
References llvm::VPlan::addSCEVExpansion(), llvm::VPBasicBlock::appendRecipe(), llvm::VPValue::getDefiningRecipe(), llvm::VPlan::getEntry(), llvm::VPlan::getOrAddLiveIn(), and llvm::VPlan::getSCEVExpansion().
Referenced by addInitialSkeleton(), createWidenInductionRecipes(), and llvm::VPlanTransforms::tryToConvertVPInstructionsToVPRecipes().
const SCEV * llvm::vputils::getSCEVExprForVPValue | ( | VPValue * | V, |
ScalarEvolution & | SE | ||
) |
Return the SCEV expression for V
.
Returns SCEVCouldNotCompute if no SCEV expression could be constructed.
Definition at line 79 of file VPlanUtils.cpp.
References llvm::TypeSwitch< T, ResultT >::Case(), Default, llvm::ScalarEvolution::getCouldNotCompute(), and llvm::ScalarEvolution::getSCEV().
Referenced by llvm::VPlanTransforms::addMinimumIterationCheck(), getOptimizableIVOf(), isConditionTrueViaVFAndUF(), llvm::LoopVectorizationPlanner::selectEpilogueVectorizationFactor(), and simplifyBranchConditionForVFAndUF().
Return true if V
is a header mask in Plan
.
Definition at line 55 of file VPlanUtils.cpp.
References A, B, llvm::VPlan::getCanonicalIV(), llvm::VPlan::getOrCreateBackedgeTakenCount(), llvm::VPlan::getTripCount(), llvm::VPlan::getVF(), llvm::PatternMatch::m_Specific(), llvm::PatternMatch::m_SpecificInt(), and llvm::PatternMatch::match().
Referenced by findHeaderMask().
Returns true if VPV
is a single scalar, either because it produces the same value for all lanes or only has its first lane used.
Definition at line 44 of file VPlanUtils.h.
References llvm::all_of(), llvm::VPInstruction::Broadcast, llvm::VPValue::getDefiningRecipe(), llvm::VPBlockBase::getParent(), llvm::isa(), llvm::Instruction::isBinaryOp(), llvm::Instruction::isCast(), llvm::VPValue::isLiveIn(), llvm::VPRegionBlock::isReplicator(), isSingleScalar(), llvm::VPUser::operands(), and llvm::VPInstruction::PtrAdd.
Referenced by cloneForLane(), llvm::VPWidenMemoryRecipe::computeCost(), llvm::VPIRPhi::execute(), llvm::VPTransformState::get(), isSingleScalar(), legalizeAndOptimizeInductions(), narrowToSingleScalarRecipes(), llvm::VPlanTransforms::replicateByVF(), and scalarizeInstruction().
Checks if V
is uniform across all VF lanes and UF parts.
It is considered as such if it is either loop invariant (defined outside the vector region) or its operand is known to be uniform across all VFs and UFs (e.g. VPDerivedIV or VPCanonicalIVPHI).
Definition at line 93 of file VPlanUtils.cpp.
References llvm::all_of(), llvm::TypeSwitch< T, ResultT >::Case(), Default, isUniformAcrossVFsAndUFs(), and llvm::PatternMatch::match().
Referenced by isUniformAcrossVFsAndUFs().
Returns true if only the first lane of Def
is used.
Definition at line 17 of file VPlanUtils.cpp.
References llvm::all_of().
Referenced by llvm::VPInstruction::computeCost(), llvm::VPBlendRecipe::computeCost(), llvm::VPInstruction::execute(), llvm::VPPredInstPHIRecipe::execute(), llvm::VPScalarIVStepsRecipe::execute(), llvm::VPTransformState::get(), legalizeAndOptimizeInductions(), llvm::VPlanTransforms::narrowInterleaveGroups(), llvm::VPInstruction::onlyFirstLaneUsed(), llvm::VPWidenPointerInductionRecipe::onlyScalarsGenerated(), removeRedundantCanonicalIVs(), and simplifyRecipe().
Returns true if only the first part of Def
is used.
Definition at line 22 of file VPlanUtils.cpp.
References llvm::all_of().
Referenced by llvm::VPInstruction::onlyFirstPartUsed().
Returns true if only scalar values of Def
are used by all users.
Definition at line 27 of file VPlanUtils.cpp.
References llvm::all_of().
Referenced by llvm::calculateRegisterUsageForPlan(), llvm::VPlanTransforms::materializeBroadcasts(), llvm::VPlanTransforms::materializeVFAndVFxUF(), narrowToSingleScalarRecipes(), removeRedundantCanonicalIVs(), and llvm::VPReplicateRecipe::shouldPack().