|
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, PredicatedScalarEvolution &PSE, VPBuilder &Builder, DenseMap< VPBasicBlock *, VPValue * > &BlockMaskCache, LoopVersioning *LVer) | |
| 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 * | tryToCreateWidenRecipe (VPSingleDefRecipe *R, VFRange &Range) |
Create and return a widened recipe for 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 142 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 7910 of file LoopVectorize.cpp.
References _, llvm::all_of(), llvm::cast(), llvm::PartialReductionChain::ExtendA, llvm::PartialReductionChain::ExtendB, llvm::SmallPtrSetImpl< PtrType >::insert(), llvm::isa(), Range, and llvm::PartialReductionChain::Reduction.
|
inline |
Returns the entry mask for block VPBB or null if the mask is all-true.
Definition at line 181 of file VPRecipeBuilder.h.
Referenced by handleReplication(), and tryToCreatePartialReduction().
|
inline |
Return the recipe created for given ingredient.
Definition at line 186 of file VPRecipeBuilder.h.
Referenced by llvm::VPlanTransforms::createInterleaveGroups().
|
inline |
Definition at line 153 of file VPRecipeBuilder.h.
Referenced by tryToCreateWidenRecipe().
Definition at line 199 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 7845 of file LoopVectorize.cpp.
References assert(), llvm::cast(), llvm::dbgs(), getBlockInMask(), 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 173 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 8169 of file LoopVectorize.cpp.
References AbstractManglingParser< Derived, Alloc >::Ops, Accumulator, assert(), Cond, getBlockInMask(), llvm::VPValue::getDefiningRecipe(), llvm::vputils::getVFScaleFactor(), llvm::isa(), and std::swap().
Referenced by tryToCreateWidenRecipe().
| VPRecipeBase * VPRecipeBuilder::tryToCreateWidenRecipe | ( | VPSingleDefRecipe * | R, |
| VFRange & | Range ) |
Create and return a widened recipe for R if one can be created within the given VF Range.
Definition at line 8080 of file LoopVectorize.cpp.
References llvm::VPUser::addOperand(), assert(), llvm::cast(), llvm::dyn_cast(), llvm::LoopVectorizationPlanner::getDecisionAndClampRange(), llvm::VPBasicBlock::getEnclosingLoopRegion(), llvm::VPRegionBlock::getEntry(), llvm::RecurrenceDescriptor::getLoopExitInstr(), llvm::Instruction::getOpcode(), llvm::VPInstruction::getOpcode(), llvm::VPUser::getOperand(), llvm::VPBlockBase::getParent(), llvm::RecurrenceDescriptor::getRecurrenceKind(), llvm::RecurrenceDescriptor::getRecurrenceStartValue(), getScalingForReduction(), llvm::Value::getType(), llvm::Instruction::isCast(), llvm::ElementCount::isScalar(), Range, and tryToCreatePartialReduction().
|
inline |
Definition at line 207 of file VPRecipeBuilder.h.
References _, and llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::lookup().