LLVM 22.0.0git
llvm::vputils Namespace Reference

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.
VPValuegetOrCreateVPValueForSCEVExpr (VPlan &Plan, const SCEV *Expr)
 Get or create a VPValue that corresponds to the expansion of Expr.
const SCEVgetSCEVExprForVPValue (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.
VPBasicBlockgetFirstLoopHeader (VPlan &Plan, VPDominatorTree &VPDT)
 Returns the header block of the first, top-level loop, or null if none exist.
std::optional< VPValue * > getRecipesForUncountableExit (VPlan &Plan, SmallVectorImpl< VPRecipeBase * > &Recipes, SmallVectorImpl< VPRecipeBase * > &GEPs)
 Returns the VPValue representing the uncountable exit comparison used by AnyOf if the recipes it depends on can be traced back to live-ins and the addresses (in GEP/PtrAdd form) of any (non-masked) load used in generating the values for the comparison.

Function Documentation

◆ getFirstLoopHeader()

VPBasicBlock * llvm::vputils::getFirstLoopHeader ( VPlan & Plan,
VPDominatorTree & VPDT )

◆ getOrCreateVPValueForSCEVExpr()

VPValue * llvm::vputils::getOrCreateVPValueForSCEVExpr ( VPlan & Plan,
const SCEV * Expr )

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::dyn_cast(), llvm::VPValue::getDefiningRecipe(), llvm::VPlan::getEntry(), llvm::VPlan::getOrAddLiveIn(), llvm::VPlan::getSCEVExpansion(), and llvm::isa().

Referenced by addInitialSkeleton(), createWidenInductionRecipes(), and llvm::VPlanTransforms::tryToConvertVPInstructionsToVPRecipes().

◆ getRecipesForUncountableExit()

std::optional< VPValue * > llvm::vputils::getRecipesForUncountableExit ( VPlan & Plan,
SmallVectorImpl< VPRecipeBase * > & Recipes,
SmallVectorImpl< VPRecipeBase * > & GEPs )

Returns the VPValue representing the uncountable exit comparison used by AnyOf if the recipes it depends on can be traced back to live-ins and the addresses (in GEP/PtrAdd form) of any (non-masked) load used in generating the values for the comparison.

The recipes are stored in Recipes, and recipes forming an address for a load are also added to GEPs.

Definition at line 145 of file VPlanUtils.cpp.

References llvm::dyn_cast(), llvm::SmallVectorTemplateCommon< T, typename >::empty(), GEP, llvm::VPlan::getVectorLoopRegion(), llvm::VPlanPatternMatch::m_AnyOf(), llvm::VPlanPatternMatch::m_BranchOnCond(), llvm::VPlanPatternMatch::m_c_BinaryOr(), llvm::VPlanPatternMatch::m_GetElementPtr(), llvm::PatternMatch::m_ICmp(), llvm::VPlanPatternMatch::m_LiveIn(), llvm::MIPatternMatch::m_OneUse(), llvm::VPlanPatternMatch::m_VPValue(), llvm::PatternMatch::match(), llvm::SmallVectorImpl< T >::pop_back_val(), and llvm::SmallVectorTemplateBase< T, bool >::push_back().

◆ getSCEVExprForVPValue()

◆ isHeaderMask()

◆ isSingleScalar()

◆ isUniformAcrossVFsAndUFs()

bool llvm::vputils::isUniformAcrossVFsAndUFs ( VPValue * V)

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 92 of file VPlanUtils.cpp.

References llvm::all_of(), llvm::TypeSwitch< T, ResultT >::Case(), llvm::Default, llvm::isa(), isUniformAcrossVFsAndUFs(), and llvm::PatternMatch::match().

Referenced by isUniformAcrossVFsAndUFs().

◆ onlyFirstLaneUsed()

◆ onlyFirstPartUsed()

bool llvm::vputils::onlyFirstPartUsed ( const VPValue * Def)

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().

◆ onlyScalarValuesUsed()

bool llvm::vputils::onlyScalarValuesUsed ( const VPValue * Def)