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, 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... | |
Definition at line 27 of file VPlanTransforms.h.
|
static |
Definition at line 217 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 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.
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().
|
static |
Try to replace VPWidenCanonicalIVRecipes with a widened canonical IV recipe, if it exists.
Definition at line 333 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 455 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 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().
|
static |
Definition at line 106 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::sampleprof::Base, 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::User::operands(), llvm::VPValue::replaceAllUsesWith(), SI, and llvm::SPII::Store.