|
LLVM 22.0.0git
|
Helper class to create VPRecipies from IR instructions. More...
#include "Transforms/Vectorize/VPRecipeBuilder.h"
Public Member Functions | |
| VPRecipeBuilder (VPlan &Plan, Loop *OrigLoop, const TargetLibraryInfo *TLI, const TargetTransformInfo *TTI, LoopVectorizationLegality *Legal, LoopVectorizationCostModel &CM, VPBuilder &Builder, DenseMap< VPBasicBlock *, VPValue * > &BlockMaskCache) | |
| std::optional< unsigned > | getScalingForReduction (const Instruction *ExitInst) |
| void | collectScaledReductions (VFRange &Range) |
| Find all possible partial reductions in the loop and track all of those that are valid so recipes can be formed later. | |
| VPRecipeBase * | tryToCreateWidenNonPhiRecipe (VPSingleDefRecipe *R, VFRange &Range) |
Create and return a widened recipe for a non-phi recipe R if one can be created within the given VF Range. | |
| VPRecipeBase * | tryToCreatePartialReduction (VPInstruction *Reduction, unsigned ScaleFactor) |
| Create and return a partial reduction recipe for a reduction instruction along with binary operation and reduction phi operands. | |
| void | setRecipe (Instruction *I, VPRecipeBase *R) |
| Set the recipe created for given ingredient. | |
| VPValue * | getBlockInMask (VPBasicBlock *VPBB) const |
Returns the entry mask for block VPBB or null if the mask is all-true. | |
| VPRecipeBase * | getRecipe (Instruction *I) |
| Return the recipe created for given ingredient. | |
| VPReplicateRecipe * | handleReplication (VPInstruction *VPI, VFRange &Range) |
Build a VPReplicationRecipe for VPI. | |
| VPValue * | getVPValueOrAddLiveIn (Value *V) |
| void | updateBlockMaskCache (DenseMap< VPValue *, VPValue * > &Old2New) |
Helper class to create VPRecipies from IR instructions.
Definition at line 47 of file VPRecipeBuilder.h.
|
inline |
Definition at line 131 of file VPRecipeBuilder.h.
| void VPRecipeBuilder::collectScaledReductions | ( | VFRange & | Range | ) |
Find all possible partial reductions in the loop and track all of those that are valid so recipes can be formed later.
Definition at line 7979 of file LoopVectorize.cpp.
References _, llvm::all_of(), llvm::cast(), llvm::SmallPtrSetImpl< PtrType >::insert(), llvm::isa(), and Range.
|
inline |
Returns the entry mask for block VPBB or null if the mask is all-true.
Definition at line 168 of file VPRecipeBuilder.h.
Referenced by handleReplication(), and tryToCreatePartialReduction().
|
inline |
Return the recipe created for given ingredient.
Definition at line 173 of file VPRecipeBuilder.h.
Referenced by llvm::VPlanTransforms::createInterleaveGroups().
|
inline |
Definition at line 139 of file VPRecipeBuilder.h.
Referenced by tryToCreateWidenNonPhiRecipe().
Definition at line 186 of file VPRecipeBuilder.h.
References llvm::dyn_cast(), and I.
| VPReplicateRecipe * VPRecipeBuilder::handleReplication | ( | VPInstruction * | VPI, |
| VFRange & | Range ) |
Build a VPReplicationRecipe for VPI.
If it is predicated, add the mask as last operand. Range.End may be decreased to ensure same recipe behavior from Range.Start to Range.End.
Definition at line 7913 of file LoopVectorize.cpp.
References assert(), llvm::cast(), llvm::dbgs(), getBlockInMask(), llvm::VPRecipeBase::getDebugLoc(), llvm::LoopVectorizationPlanner::getDecisionAndClampRange(), getIntrinsicID(), llvm::VPSingleDefRecipe::getUnderlyingInstr(), I, llvm::isa(), LLVM_DEBUG, llvm::VPUser::operands(), and Range.
|
inline |
Set the recipe created for given ingredient.
Definition at line 160 of file VPRecipeBuilder.h.
| VPRecipeBase * VPRecipeBuilder::tryToCreatePartialReduction | ( | VPInstruction * | Reduction, |
| unsigned | ScaleFactor ) |
Create and return a partial reduction recipe for a reduction instruction along with binary operation and reduction phi operands.
Definition at line 8231 of file LoopVectorize.cpp.
References AbstractManglingParser< Derived, Alloc >::Ops, Accumulator, llvm::Add, assert(), llvm::cast(), Cond, llvm::dyn_cast(), getBlockInMask(), llvm::VPValue::getDefiningRecipe(), llvm::vputils::getVFScaleFactor(), llvm::isa(), and std::swap().
Referenced by tryToCreateWidenNonPhiRecipe().
| VPRecipeBase * VPRecipeBuilder::tryToCreateWidenNonPhiRecipe | ( | VPSingleDefRecipe * | R, |
| VFRange & | Range ) |
Create and return a widened recipe for a non-phi recipe R if one can be created within the given VF Range.
Definition at line 8176 of file LoopVectorize.cpp.
References assert(), llvm::cast(), llvm::VPRecipeBase::getDebugLoc(), llvm::LoopVectorizationPlanner::getDecisionAndClampRange(), llvm::Instruction::getOpcode(), llvm::VPInstruction::getOpcode(), llvm::VPUser::getOperand(), getScalingForReduction(), llvm::Instruction::isCast(), llvm::ElementCount::isScalar(), Range, and tryToCreatePartialReduction().
|
inline |
Definition at line 194 of file VPRecipeBuilder.h.
References _, and llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::lookup().