LLVM  15.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 (Loop *OrigLoop, VPlanPtr &Plan, function_ref< const InductionDescriptor *(PHINode *)> GetIntOrFpInductionDescriptor, SmallPtrSetImpl< Instruction * > &DeadInstructions, ScalarEvolution &SE)
 Replaces the VPInstructions in Plan with corresponding widen recipes. More...
 
static bool sinkScalarOperands (VPlan &Plan)
 
static bool mergeReplicateRegions (VPlan &Plan)
 
static void removeRedundantInductionCasts (VPlan &Plan)
 Remove redundant casts of inductions. More...
 
static void removeRedundantCanonicalIVs (VPlan &Plan)
 Try to replace VPWidenCanonicalIVRecipes with a widened canonical IV recipe, if it exists. More...
 
static void removeDeadRecipes (VPlan &Plan, Loop &OrigLoop)
 Try to remove dead recipes. More...
 
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. More...
 
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. More...
 

Detailed Description

Definition at line 27 of file VPlanTransforms.h.

Member Function Documentation

◆ mergeReplicateRegions()

bool VPlanTransforms::mergeReplicateRegions ( VPlan Plan)
static

◆ optimizeInductions()

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

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.

This is an optional optimization to reduce the needs of vector extracts.

Definition at line 415 of file VPlanTransforms.cpp.

References E, llvm::VPlan::getCanonicalIV(), llvm::VPBlockBase::getEntryBasicBlock(), llvm::VPBasicBlock::getFirstNonPhi(), llvm::vputils::getOrCreateVPValueForSCEVExpr(), llvm::Value::getType(), llvm::VPlan::getVectorLoopRegion(), I, llvm::VPBasicBlock::insert(), IV, llvm::VPBasicBlock::phis(), ToRemove, and Users.

◆ removeDeadRecipes()

void VPlanTransforms::removeDeadRecipes ( VPlan Plan,
Loop OrigLoop 
)
static

Try to remove dead recipes.

At the moment, only dead header recipes are removed.

Definition at line 387 of file VPlanTransforms.cpp.

References llvm::any_of(), llvm::VPBlockBase::getEntryBasicBlock(), llvm::VPlan::getVectorLoopRegion(), hasOutsideUser(), llvm::make_early_inc_range(), and llvm::reverse().

◆ removeRedundantCanonicalIVs()

void VPlanTransforms::removeRedundantCanonicalIVs ( VPlan Plan)
static

◆ removeRedundantExpandSCEVRecipes()

void VPlanTransforms::removeRedundantExpandSCEVRecipes ( VPlan Plan)
static

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

◆ sinkScalarOperands()

bool VPlanTransforms::sinkScalarOperands ( VPlan Plan)
static

◆ VPInstructionsToVPRecipes()

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

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