LLVM
15.0.0git
|
#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) |
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... | |
Definition at line 27 of file VPlanTransforms.h.
|
static |
Definition at line 215 of file VPlanTransforms.cpp.
References assert(), llvm::VPBlockUtils::connectBlocks(), llvm::SetVector< T, Vector, Set >::contains(), llvm::depth_first(), llvm::VPBlockUtils::disconnectBlocks(), E, llvm::VPlan::getEntry(), llvm::VPBasicBlock::getFirstNonPhi(), getPredicatedMask(), getPredicatedThenBlock(), llvm::VPBlockBase::getSingleSuccessor(), I, llvm::SetVector< T, Vector, Set >::insert(), llvm::make_early_inc_range(), llvm::reverse(), Users, and llvm::VPValue::users().
|
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 381 of file VPlanTransforms.cpp.
References llvm::all_of(), E, llvm::VPlan::getCanonicalIV(), llvm::VPBlockBase::getEntryBasicBlock(), llvm::VPBasicBlock::getFirstNonPhi(), llvm::VPUser::getNumOperands(), llvm::VPUser::getOperand(), llvm::vputils::getOrCreateVPValueForSCEVExpr(), llvm::Value::getType(), llvm::VPlan::getVectorLoopRegion(), I, llvm::VPBasicBlock::insert(), IV, llvm::VPBasicBlock::phis(), llvm::VPUser::setOperand(), ToRemove, Users, and llvm::VPUser::usesScalars().
|
static |
Definition at line 364 of file VPlanTransforms.cpp.
References llvm::any_of(), llvm::VPlan::getEntry(), llvm::make_early_inc_range(), and llvm::reverse().
|
static |
Try to replace VPWidenCanonicalIVRecipes with a widened canonical IV recipe, if it exists.
Definition at line 331 of file VPlanTransforms.cpp.
References llvm::VPRecipeBase::eraseFromParent(), llvm::VPlan::getCanonicalIV(), llvm::VPBlockBase::getEntryBasicBlock(), llvm::VPWidenCanonicalIVRecipe::getScalarType(), llvm::VPlan::getVectorLoopRegion(), llvm::vputils::onlyFirstLaneUsed(), llvm::VPBasicBlock::phis(), llvm::VPValue::replaceAllUsesWith(), and llvm::VPValue::users().
|
static |
Remove redundant EpxandSCEVRecipes in Plan's
entry block by replacing them with already existing recipes expanding the same SCEV expression.
Definition at line 414 of file VPlanTransforms.cpp.
References llvm::VPlan::getEntry(), llvm::VPBlockBase::getEntryBasicBlock(), I, llvm::DenseMapBase< DenseMap< KeyT, ValueT, DenseMapInfo< KeyT >, llvm::detail::DenseMapPair< KeyT, ValueT > >, KeyT, ValueT, DenseMapInfo< KeyT >, llvm::detail::DenseMapPair< KeyT, ValueT > >::insert(), and llvm::make_early_inc_range().
|
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 299 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().
|
static |
Definition at line 104 of file VPlanTransforms.cpp.
References llvm::all_of(), llvm::depth_first(), llvm::SetVector< T, Vector, Set >::empty(), llvm::VPlan::getEntry(), llvm::VPBasicBlock::getFirstNonPhi(), I, llvm::SetVector< T, Vector, Set >::insert(), llvm::SetVector< T, Vector, Set >::pop_back_val(), and Users.
|
static |
Replaces the VPInstructions in Plan
with corresponding widen recipes.
Definition at line 21 of file VPlanTransforms.cpp.
References assert(), llvm::SmallPtrSetImpl< PtrType >::count(), llvm::tgtok::Def, llvm::VPDef::definedValues(), GEP, llvm::getLoadStorePointerOperand(), llvm::VPDef::getNumDefinedValues(), llvm::vputils::getOrCreateVPValueForSCEVExpr(), llvm::ScalarEvolution::getSCEV(), llvm::VPValue::getUnderlyingValue(), llvm::VPDef::getVPSingleValue(), llvm::VPRecipeBase::insertBefore(), llvm::ScalarEvolution::isLoopInvariant(), llvm::SPII::Load, llvm::make_early_inc_range(), llvm::make_range(), llvm::User::operands(), llvm::VPValue::replaceAllUsesWith(), SI, llvm::SPII::Store, and llvm::M68kBeads::Term.