LLVM 17.0.0git
Static Public Member Functions | List of all members
llvm::VPlanTransforms Struct Reference

#include "Transforms/Vectorize/VPlanTransforms.h"

Static Public Member Functions

static void VPInstructionsToVPRecipes (VPlanPtr &Plan, function_ref< const InductionDescriptor *(PHINode *)> GetIntOrFpInductionDescriptor, SmallPtrSetImpl< Instruction * > &DeadInstructions, ScalarEvolution &SE, const TargetLibraryInfo &TLI)
 Replaces the VPInstructions in Plan with corresponding widen recipes.
 
static void createAndOptimizeReplicateRegions (VPlan &Plan)
 Wrap predicated VPReplicateRecipes with a mask operand in an if-then region block and remove the mask operand.
 
static bool mergeBlocksIntoPredecessors (VPlan &Plan)
 Remove redundant VPBasicBlocks by merging them into their predecessor if the predecessor has a single successor.
 
static void removeRedundantInductionCasts (VPlan &Plan)
 Remove redundant casts of inductions.
 
static void removeRedundantCanonicalIVs (VPlan &Plan)
 Try to replace VPWidenCanonicalIVRecipes with a widened canonical IV recipe, if it exists.
 
static void removeDeadRecipes (VPlan &Plan)
 
static void optimizeInductions (VPlan &Plan, ScalarEvolution &SE)
 If any user of a VPWidenIntOrFpInductionRecipe needs scalar values, provide them by building scalar steps off of the canonical scalar IV and update the original IV's users.
 
static void removeRedundantExpandSCEVRecipes (VPlan &Plan)
 Remove redundant EpxandSCEVRecipes in Plan's entry block by replacing them with already existing recipes expanding the same SCEV expression.
 
static void adjustFixedOrderRecurrences (VPlan &Plan, VPBuilder &Builder)
 Sink users of fixed-order recurrences after the recipe defining their previous value.
 
static void optimizeForVFAndUF (VPlan &Plan, ElementCount BestVF, unsigned BestUF, PredicatedScalarEvolution &PSE)
 Optimize Plan based on BestVF and BestUF.
 

Detailed Description

Definition at line 31 of file VPlanTransforms.h.

Member Function Documentation

◆ adjustFixedOrderRecurrences()

void VPlanTransforms::adjustFixedOrderRecurrences ( VPlan Plan,
VPBuilder Builder 
)
static

Sink users of fixed-order recurrences after the recipe defining their previous value.

Then introduce FirstOrderRecurrenceSplice VPInstructions to combine the value from the recurrence phis and previous values. The current implementation assumes all users can be sunk after the previous value, which is enforced by earlier legality checks.

Definition at line 706 of file VPlanTransforms.cpp.

References assert(), Builder, llvm::VPInstruction::FirstOrderRecurrenceSplice, llvm::VPRegionBlock::getEntry(), llvm::VPBlockBase::getEntryBasicBlock(), llvm::VPBasicBlock::getFirstNonPhi(), llvm::ilist_node_impl< OptionsT >::getIterator(), llvm::VPRecipeBase::getParent(), llvm::VPlan::getVectorLoopRegion(), llvm::SmallPtrSetImpl< PtrType >::insert(), llvm::VPBasicBlock::phis(), llvm::SmallVectorTemplateBase< T, bool >::push_back(), llvm::DominatorTreeBase< NodeT, IsPostDom >::recalculate(), and sinkRecurrenceUsersAfterPrevious().

◆ createAndOptimizeReplicateRegions()

void VPlanTransforms::createAndOptimizeReplicateRegions ( VPlan Plan)
static

Wrap predicated VPReplicateRecipes with a mask operand in an if-then region block and remove the mask operand.

Optimize the created regions by iteratively sinking scalar operands into the region, followed by merging regions until no improvements are remaining.

Definition at line 381 of file VPlanTransforms.cpp.

References addReplicateRegions(), mergeBlocksIntoPredecessors(), mergeReplicateRegionsIntoSuccessors(), and sinkScalarOperands().

◆ mergeBlocksIntoPredecessors()

bool VPlanTransforms::mergeBlocksIntoPredecessors ( VPlan Plan)
static

◆ optimizeForVFAndUF()

void VPlanTransforms::optimizeForVFAndUF ( VPlan Plan,
ElementCount  BestVF,
unsigned  BestUF,
PredicatedScalarEvolution PSE 
)
static

◆ optimizeInductions()

void VPlanTransforms::optimizeInductions ( VPlan Plan,
ScalarEvolution SE 
)
static

◆ removeDeadRecipes()

void VPlanTransforms::removeDeadRecipes ( VPlan Plan)
static

◆ removeRedundantCanonicalIVs()

void VPlanTransforms::removeRedundantCanonicalIVs ( VPlan Plan)
static

◆ removeRedundantExpandSCEVRecipes()

void VPlanTransforms::removeRedundantExpandSCEVRecipes ( VPlan Plan)
static

Remove redundant EpxandSCEVRecipes in Plan's entry block by replacing them with already existing recipes expanding the same SCEV expression.

Definition at line 547 of file VPlanTransforms.cpp.

References llvm::VPlan::getEntry(), llvm::VPBlockBase::getEntryBasicBlock(), I, llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::insert(), and llvm::make_early_inc_range().

◆ removeRedundantInductionCasts()

void VPlanTransforms::removeRedundantInductionCasts ( VPlan Plan)
static

Remove redundant casts of inductions.

Such redundant casts are casts of induction variables that can be ignored, because we already proved that the casted phi is equal to the uncasted phi in the vectorized loop. There is no need to vectorize the cast - the same value can be used for both the phi and casts in the vector loop.

Definition at line 419 of file VPlanTransforms.cpp.

References llvm::VPBlockBase::getEntryBasicBlock(), llvm::VPlan::getVectorLoopRegion(), llvm::VPDef::getVPSingleValue(), IV, llvm::VPBasicBlock::phis(), llvm::VPValue::replaceAllUsesWith(), llvm::reverse(), and llvm::VPValue::users().

◆ VPInstructionsToVPRecipes()

void VPlanTransforms::VPInstructionsToVPRecipes ( VPlanPtr Plan,
function_ref< const InductionDescriptor *(PHINode *)>  GetIntOrFpInductionDescriptor,
SmallPtrSetImpl< Instruction * > &  DeadInstructions,
ScalarEvolution SE,
const TargetLibraryInfo TLI 
)
static

The documentation for this struct was generated from the following files: