LLVM 22.0.0git
|
VPlan models a candidate for vectorization, encoding various decisions take to produce efficient output IR, including which branches, basic-blocks and output IR instructions to generate, and their cost. More...
#include "Transforms/Vectorize/VPlan.h"
Public Member Functions | |
VPlan (Loop *L) | |
Construct a VPlan for L . | |
VPlan (BasicBlock *ScalarHeaderBB, VPValue *TC) | |
Construct a VPlan with a new VPBasicBlock as entry, a VPIRBasicBlock wrapping ScalarHeaderBB and a trip count of TC . | |
LLVM_ABI_FOR_TEST | ~VPlan () |
void | setEntry (VPBasicBlock *VPBB) |
void | execute (VPTransformState *State) |
Generate the IR code for this VPlan. | |
InstructionCost | cost (ElementCount VF, VPCostContext &Ctx) |
Return the cost of this plan. | |
VPBasicBlock * | getEntry () |
const VPBasicBlock * | getEntry () const |
VPBasicBlock * | getVectorPreheader () |
Returns the preheader of the vector loop region, if one exists, or null otherwise. | |
LLVM_ABI_FOR_TEST VPRegionBlock * | getVectorLoopRegion () |
Returns the VPRegionBlock of the vector loop. | |
LLVM_ABI_FOR_TEST const VPRegionBlock * | getVectorLoopRegion () const |
VPBasicBlock * | getMiddleBlock () |
Returns the 'middle' block of the plan, that is the block that selects whether to execute the scalar tail loop or the exit block from the loop latch. | |
const VPBasicBlock * | getMiddleBlock () const |
VPBasicBlock * | getScalarPreheader () const |
Return the VPBasicBlock for the preheader of the scalar loop. | |
VPIRBasicBlock * | getScalarHeader () const |
Return the VPIRBasicBlock wrapping the header of the scalar loop. | |
ArrayRef< VPIRBasicBlock * > | getExitBlocks () const |
Return an ArrayRef containing VPIRBasicBlocks wrapping the exit blocks of the original scalar loop. | |
VPIRBasicBlock * | getExitBlock (BasicBlock *IRBB) const |
Return the VPIRBasicBlock corresponding to IRBB . | |
bool | isExitBlock (VPBlockBase *VPBB) |
Returns true if VPBB is an exit block. | |
VPValue * | getTripCount () const |
The trip count of the original loop. | |
void | setTripCount (VPValue *NewTripCount) |
Set the trip count assuming it is currently null; if it is not - use resetTripCount(). | |
void | resetTripCount (VPValue *NewTripCount) |
Resets the trip count for the VPlan. | |
VPValue * | getOrCreateBackedgeTakenCount () |
The backedge taken count of the original loop. | |
VPValue & | getVectorTripCount () |
The vector trip count. | |
VPValue & | getVF () |
Returns the VF of the vector loop region. | |
VPValue & | getVFxUF () |
Returns VF * UF of the vector loop region. | |
LLVMContext & | getContext () const |
void | addVF (ElementCount VF) |
void | setVF (ElementCount VF) |
bool | hasVF (ElementCount VF) const |
bool | hasScalableVF () const |
iterator_range< SmallSetVector< ElementCount, 2 >::iterator > | vectorFactors () const |
Returns an iterator range over all VFs of the plan. | |
bool | hasScalarVFOnly () const |
bool | hasUF (unsigned UF) const |
unsigned | getUF () const |
void | setUF (unsigned UF) |
bool | isUnrolled () const |
Returns true if the VPlan already has been unrolled, i.e. | |
std::string | getName () const |
Return a string with the name of the plan and the applicable VFs and UFs. | |
void | setName (const Twine &newName) |
VPValue * | getOrAddLiveIn (Value *V) |
Gets the live-in VPValue for V or adds a new live-in (if none exists yet) for V . | |
VPValue * | getTrue () |
Return a VPValue wrapping i1 true. | |
VPValue * | getFalse () |
Return a VPValue wrapping i1 false. | |
VPValue * | getLiveIn (Value *V) const |
Return the live-in VPValue for V , if there is one or nullptr otherwise. | |
ArrayRef< VPValue * > | getLiveIns () const |
Return the list of live-in VPValues available in the VPlan. | |
void | printLiveIns (raw_ostream &O) const |
Print the live-ins of this VPlan to O . | |
void | print (raw_ostream &O) const |
Print this VPlan to O . | |
void | printDOT (raw_ostream &O) const |
Print this VPlan in DOT format to O . | |
LLVM_DUMP_METHOD void | dump () const |
Dump the plan to stderr (for debugging). | |
VPCanonicalIVPHIRecipe * | getCanonicalIV () |
Returns the canonical induction recipe of the vector loop. | |
VPValue * | getSCEVExpansion (const SCEV *S) const |
void | addSCEVExpansion (const SCEV *S, VPValue *V) |
VPlan * | duplicate () |
Clone the current VPlan, update all VPValues of the new VPlan and cloned recipes to refer to the clones, and return it. | |
VPBasicBlock * | createVPBasicBlock (const Twine &Name, VPRecipeBase *Recipe=nullptr) |
Create a new VPBasicBlock with Name and containing Recipe if present. | |
VPRegionBlock * | createVPRegionBlock (VPBlockBase *Entry, VPBlockBase *Exiting, const std::string &Name="", bool IsReplicator=false) |
Create a new VPRegionBlock with Entry , Exiting and Name . | |
VPRegionBlock * | createVPRegionBlock (const std::string &Name="") |
Create a new loop VPRegionBlock with Name and entry and exiting blocks set to nullptr. | |
VPIRBasicBlock * | createEmptyVPIRBasicBlock (BasicBlock *IRBB) |
Create a VPIRBasicBlock wrapping IRBB , but do not create VPIRInstructions wrapping the instructions in tIRBB . | |
LLVM_ABI_FOR_TEST VPIRBasicBlock * | createVPIRBasicBlock (BasicBlock *IRBB) |
Create a VPIRBasicBlock from IRBB containing VPIRInstructions for all instructions in IRBB , except its terminator which is managed by the successors of the block in VPlan. | |
bool | hasEarlyExit () const |
Returns true if the VPlan is based on a loop with an early exit. | |
bool | hasScalarTail () const |
Returns true if the scalar tail may execute after the vector loop. | |
Friends | |
class | VPlanPrinter |
class | VPSlotTracker |
VPlan models a candidate for vectorization, encoding various decisions take to produce efficient output IR, including which branches, basic-blocks and output IR instructions to generate, and their cost.
VPlan holds a Hierarchical-CFG of VPBasicBlocks and VPRegionBlocks rooted at an Entry VPBasicBlock.
VPlan::VPlan | ( | Loop * | L | ) |
Construct a VPlan for L
.
This will create VPIRBasicBlocks wrapping the original preheader and scalar header of L
, to be used as entry and scalar header blocks of the new VPlan.
Definition at line 907 of file VPlan.cpp.
References createVPIRBasicBlock(), and setEntry().
|
inline |
Construct a VPlan with a new VPBasicBlock as entry, a VPIRBasicBlock wrapping ScalarHeaderBB
and a trip count of TC
.
Definition at line 4010 of file VPlan.h.
References createVPBasicBlock(), createVPIRBasicBlock(), and setEntry().
VPlan::~VPlan | ( | ) |
Definition at line 917 of file VPlan.cpp.
References getLiveIns(), and I.
Definition at line 4248 of file VPlan.h.
References assert(), and llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::contains().
Referenced by llvm::vputils::getOrCreateVPValueForSCEVExpr().
|
inline |
Definition at line 4131 of file VPlan.h.
References llvm::SetVector< T, Vector, Set, N >::insert().
InstructionCost VPlan::cost | ( | ElementCount | VF, |
VPCostContext & | Ctx | ||
) |
Return the cost of this plan.
Definition at line 1019 of file VPlan.cpp.
References llvm::any_of(), llvm::VPBasicBlock::cost(), llvm::VPRegionBlock::cost(), getEntry(), llvm::InstructionCost::getInvalid(), getVectorLoopRegion(), llvm::InstructionCost::isValid(), isValid(), and llvm::vp_depth_first_shallow().
VPIRBasicBlock * VPlan::createEmptyVPIRBasicBlock | ( | BasicBlock * | IRBB | ) |
Create a VPIRBasicBlock wrapping IRBB
, but do not create VPIRInstructions wrapping the instructions in tIRBB
.
The returned block is owned by the VPlan and deleted once the VPlan is destroyed.
Definition at line 1246 of file VPlan.cpp.
Referenced by llvm::VPIRBasicBlock::clone(), and createVPIRBasicBlock().
|
inline |
Create a new VPBasicBlock with Name
and containing Recipe
if present.
The returned block is owned by the VPlan and deleted once the VPlan is destroyed.
Definition at line 4260 of file VPlan.h.
References Name, and llvm::SmallVectorTemplateBase< T, bool >::push_back().
Referenced by addInitialSkeleton(), llvm::VPBasicBlock::clone(), createReplicateRegion(), llvm::VPlanTransforms::handleUncountableEarlyExit(), llvm::VPBasicBlock::splitAt(), and VPlan().
VPIRBasicBlock * VPlan::createVPIRBasicBlock | ( | BasicBlock * | IRBB | ) |
Create a VPIRBasicBlock from IRBB
containing VPIRInstructions for all instructions in IRBB
, except its terminator which is managed by the successors of the block in VPlan.
The returned block is owned by the VPlan and deleted once the VPlan is destroyed.
Definition at line 1252 of file VPlan.cpp.
References llvm::BasicBlock::begin(), llvm::VPIRInstruction::create(), createEmptyVPIRBasicBlock(), llvm::ilist_node_impl< OptionsT >::getIterator(), llvm::BasicBlock::getTerminator(), I, and llvm::make_range().
Referenced by llvm::VPlanTransforms::attachCheckBlock(), duplicate(), llvm::EpilogueVectorizerEpilogueLoop::emitMinimumVectorEpilogueIterCountCheck(), llvm::EpilogueVectorizerMainLoop::introduceCheckBlockInVPlan(), replaceVPBBWithIRVPBB(), and VPlan().
|
inline |
Create a new loop VPRegionBlock with Name
and entry and exiting blocks set to nullptr.
The returned block is owned by the VPlan and deleted once the VPlan is destroyed.
Definition at line 4281 of file VPlan.h.
References Name, and llvm::SmallVectorTemplateBase< T, bool >::push_back().
|
inline |
Create a new VPRegionBlock with Entry
, Exiting
and Name
.
If IsReplicator
is true, the region is a replicate region. The returned block is owned by the VPlan and deleted once the VPlan is destroyed.
Definition at line 4270 of file VPlan.h.
References Name, and llvm::SmallVectorTemplateBase< T, bool >::push_back().
Referenced by llvm::VPRegionBlock::clone(), createLoopRegion(), and createReplicateRegion().
LLVM_DUMP_METHOD void VPlan::dump | ( | ) | const |
Dump the plan to stderr (for debugging).
Definition at line 1138 of file VPlan.cpp.
References llvm::dbgs(), and print().
Referenced by execute().
VPlan * VPlan::duplicate | ( | ) |
Clone the current VPlan, update all VPValues of the new VPlan and cloned recipes to refer to the clones, and return it.
Definition at line 1179 of file VPlan.cpp.
References assert(), cloneFrom(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::contains(), createVPIRBasicBlock(), llvm::find_if(), llvm::VPIRBasicBlock::getIRBasicBlock(), llvm::VPValue::getLiveInIRValue(), getLiveIns(), llvm::VPBlockBase::getNumSuccessors(), getScalarHeader(), I, llvm::VPValue::isLiveIn(), remapOperands(), and llvm::vp_depth_first_shallow().
Referenced by llvm::LoopVectorizePass::processLoop().
void VPlan::execute | ( | VPTransformState * | State | ) |
Generate the IR code for this VPlan.
Generate the code inside the preheader and body of the vectorized loop.
Assumes a single pre-header basic-block was created for this. Introduce additional basic-blocks as needed, and fill them all.
Definition at line 955 of file VPlan.cpp.
References llvm::GenericDomTreeUpdater< DerivedT, DomTreeT, PostDomTreeT >::applyUpdates(), llvm::Block, llvm::VPTransformState::CFG, llvm::dbgs(), llvm::DominatorTreeBase< BasicBlock, false >::Delete, llvm::VPTransformState::CFGState::DTU, dump(), llvm::VPTransformState::CFGState::ExitBB, llvm::GenericDomTreeUpdater< DerivedT, DomTreeT, PostDomTreeT >::flush(), llvm::VPTransformState::get(), llvm::vputils::getFirstLoopHeader(), llvm::BasicBlock::getSingleSuccessor(), llvm::BasicBlock::getTerminator(), getUF(), LLVM_DEBUG, llvm::VPTransformState::CFGState::PrevBB, llvm::VPTransformState::CFGState::PrevVPBB, llvm::DominatorTreeBase< NodeT, IsPostDom >::recalculate(), setName(), llvm::VPTransformState::VF, llvm::VPTransformState::CFGState::VPBB2IRBB, and llvm::VPTransformState::VPDT.
Referenced by llvm::LoopVectorizationPlanner::executePlan().
|
inline |
Returns the canonical induction recipe of the vector loop.
Definition at line 4235 of file VPlan.h.
References llvm::VPBasicBlock::begin(), llvm::VPBasicBlock::empty(), llvm::VPBlockBase::getEntryBasicBlock(), llvm::VPBlockBase::getSingleSuccessor(), and getVectorLoopRegion().
Referenced by llvm::VPlanTransforms::addActiveLaneMask(), llvm::VPlanTransforms::addExplicitVectorLength(), addVPLaneMaskPhiAndUpdateExitBranch(), llvm::VPlanTransforms::attachCheckBlock(), createScalarIVSteps(), findHeaderMask(), llvm::VPlanTransforms::handleMaxMinNumReductions(), isConditionTrueViaVFAndUF(), llvm::vputils::isHeaderMask(), llvm::VPlanTransforms::narrowInterleaveGroups(), optimizeEarlyExitInductionUser(), preparePlanForMainVectorLoop(), and removeRedundantCanonicalIVs().
|
inline |
Definition at line 4127 of file VPlan.h.
References llvm::BasicBlock::getContext(), llvm::VPIRBasicBlock::getIRBasicBlock(), and getScalarHeader().
Referenced by llvm::VPlanTransforms::addBranchWeightToMiddleTerminator(), llvm::VPlanTransforms::addExplicitVectorLength(), llvm::VPlanTransforms::addMiddleCheck(), llvm::VPlanTransforms::addMinimumIterationCheck(), llvm::VPlanTransforms::attachCheckBlock(), llvm::VPlanTransforms::createInterleaveGroups(), expandVPWidenIntOrFpInduction(), getFalse(), getTrue(), optimizeVectorInductionWidthForTCAndVFUF(), transformRecipestoEVLRecipes(), and llvm::VPlanTransforms::truncateToMinimalBitwidths().
|
inline |
Definition at line 4029 of file VPlan.h.
Referenced by addInitialSkeleton(), llvm::VPlanTransforms::addMinimumIterationCheck(), addReplicateRegions(), llvm::VPlanTransforms::canonicalizeEVLLoops(), llvm::VPlanTransforms::convertToConcreteRecipes(), cost(), llvm::VPlanTransforms::createLoopRegions(), llvm::VPlanTransforms::dissolveLoopRegions(), llvm::VPlanPrinter::dump(), llvm::EpilogueVectorizerEpilogueLoop::emitMinimumVectorEpilogueIterCountCheck(), llvm::LoopVectorizationPlanner::executePlan(), llvm::VPlanTransforms::expandSCEVs(), llvm::InnerLoopVectorizer::fixNonInductionPHIs(), llvm::DomTreeNodeTraits< VPBlockBase >::getEntryNode(), llvm::vputils::getFirstLoopHeader(), llvm::vputils::getOrCreateVPValueForSCEVExpr(), getVectorLoopRegion(), hasScalarTail(), llvm::VPlanTransforms::materializeBroadcasts(), llvm::VPlanTransforms::materializeBuildVectors(), mergeBlocksIntoPredecessors(), mergeReplicateRegionsIntoSuccessors(), preparePlanForEpilogueVectorLoop(), preparePlanForMainVectorLoop(), print(), llvm::VPlanTransforms::removeBranchOnConst(), llvm::VPlanTransforms::removeDeadRecipes(), removeRedundantExpandSCEVRecipes(), llvm::VPlanTransforms::replicateByVF(), llvm::VPBlockBase::setPlan(), llvm::VPlanTransforms::simplifyRecipes(), sinkScalarOperands(), and llvm::VPlanTransforms::unrollByUF().
|
inline |
VPIRBasicBlock * VPlan::getExitBlock | ( | BasicBlock * | IRBB | ) | const |
Return the VPIRBasicBlock corresponding to IRBB
.
IRBB
must be an exit block.
Definition at line 940 of file VPlan.cpp.
References assert(), llvm::find_if(), getExitBlocks(), and llvm::VPIRBasicBlock::getIRBasicBlock().
|
inline |
Return an ArrayRef containing VPIRBasicBlocks wrapping the exit blocks of the original scalar loop.
Definition at line 4081 of file VPlan.h.
Referenced by calculateEarlyExitCost(), createExtractsForLiveOuts(), llvm::LoopVectorizationPlanner::executePlan(), getExitBlock(), llvm::VPlanTransforms::handleEarlyExits(), and llvm::VPlanTransforms::optimizeInductionExitUsers().
|
inline |
Return a VPValue wrapping i1 false.
Definition at line 4202 of file VPlan.h.
References getContext(), llvm::ConstantInt::getFalse(), and getOrAddLiveIn().
Referenced by llvm::VPlanTransforms::addMiddleCheck(), and llvm::VPlanTransforms::addMinimumIterationCheck().
Return the live-in VPValue for V
, if there is one or nullptr otherwise.
Definition at line 4208 of file VPlan.h.
References llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::lookup().
Return the list of live-in VPValues available in the VPlan.
Definition at line 4211 of file VPlan.h.
References llvm::all_of(), assert(), llvm::is_contained(), and P.
Referenced by duplicate(), llvm::VPlanTransforms::materializeBroadcasts(), and ~VPlan().
|
inline |
Returns the 'middle' block of the plan, that is the block that selects whether to execute the scalar tail loop or the exit block from the loop latch.
If there is an early exit from the vector loop, the middle block conceptully has the early exit block as third successor, split accross 2 VPBBs. In that case, the second VPBB selects whether to execute the scalar tail loop or the exit bock. If the scalar tail loop or exit block are known to always execute, the middle block may branch directly to that block. This function cannot be called once the vector loop region has been removed.
Definition at line 4054 of file VPlan.h.
References assert(), getScalarPreheader(), llvm::VPBlockBase::getSingleSuccessor(), getVectorLoopRegion(), and llvm::is_contained().
Referenced by llvm::VPlanTransforms::addBranchWeightToMiddleTerminator(), addExitUsersForFirstOrderRecurrences(), addScalarResumePhis(), calculateEarlyExitCost(), getMiddleBlock(), llvm::VPlanTransforms::handleMaxMinNumReductions(), llvm::VPlanTransforms::materializeConstantVectorTripCount(), llvm::VPlanTransforms::optimizeInductionExitUsers(), preparePlanForMainVectorLoop(), and llvm::LoopVectorizePass::processLoop().
|
inline |
Definition at line 4067 of file VPlan.h.
References getMiddleBlock().
std::string VPlan::getName | ( | ) | const |
Return a string with the name of the plan and the applicable VFs and UFs.
Definition at line 1108 of file VPlan.cpp.
References llvm::drop_begin(), and llvm::SetVector< T, Vector, Set, N >::empty().
Referenced by llvm::VPlanPrinter::dump(), and print().
Gets the live-in VPValue for V
or adds a new live-in (if none exists yet) for V
.
Definition at line 4181 of file VPlan.h.
References assert(), llvm::VPValue::isLiveIn(), llvm::SmallVectorTemplateBase< T, bool >::push_back(), and llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::try_emplace().
Referenced by addCanonicalIVRecipes(), llvm::VPlanTransforms::addExplicitVectorLength(), llvm::VPlanTransforms::addMiddleCheck(), llvm::VPlanTransforms::addMinimumIterationCheck(), llvm::VPlanTransforms::attachCheckBlock(), llvm::VPlanTransforms::canonicalizeEVLLoops(), cloneForLane(), llvm::VPBuilder::createElementCount(), llvm::VPlanTransforms::createInterleaveGroups(), llvm::VPlanTransforms::expandSCEVs(), getFalse(), llvm::vputils::getOrCreateVPValueForSCEVExpr(), getTrue(), llvm::VPRecipeBuilder::getVPValueOrAddLiveIn(), legalizeAndOptimizeInductions(), llvm::VPlanTransforms::materializeBackedgeTakenCount(), llvm::VPlanTransforms::materializeVectorTripCount(), llvm::VPlanTransforms::materializeVFAndVFxUF(), llvm::VPlanTransforms::narrowInterleaveGroups(), optimizeEarlyExitInductionUser(), optimizeLatchExitInductionUser(), optimizeVectorInductionWidthForTCAndVFUF(), preparePlanForEpilogueVectorLoop(), simplifyRecipe(), transformRecipestoEVLRecipes(), and llvm::VPRecipeBuilder::tryToCreatePartialReduction().
|
inline |
The backedge taken count of the original loop.
Definition at line 4112 of file VPlan.h.
Referenced by llvm::vputils::isHeaderMask(), llvm::VPlanTransforms::materializeBackedgeTakenCount(), llvm::VPlanTransforms::materializeBroadcasts(), and optimizeVectorInductionWidthForTCAndVFUF().
|
inline |
Return the VPIRBasicBlock wrapping the header of the scalar loop.
Definition at line 4077 of file VPlan.h.
Referenced by addInitialSkeleton(), llvm::VPlanTransforms::addMiddleCheck(), addScalarResumePhis(), duplicate(), getContext(), getScalarPreheader(), llvm::VPlanTransforms::handleEarlyExits(), preparePlanForMainVectorLoop(), llvm::VPlanTransforms::replicateByVF(), and simplifyRecipe().
|
inline |
Return the VPBasicBlock for the preheader of the scalar loop.
Definition at line 4072 of file VPlan.h.
References getScalarHeader().
Referenced by addExitUsersForFirstOrderRecurrences(), llvm::VPlanTransforms::addMiddleCheck(), addScalarResumePhis(), llvm::VPlanTransforms::attachCheckBlock(), llvm::LoopVectorizationPlanner::executePlan(), getMiddleBlock(), llvm::VPlanTransforms::handleMaxMinNumReductions(), hasScalarTail(), llvm::EpilogueVectorizerMainLoop::introduceCheckBlockInVPlan(), llvm::VPlanTransforms::materializeConstantVectorTripCount(), and preparePlanForMainVectorLoop().
Definition at line 4244 of file VPlan.h.
References llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::lookup().
Referenced by llvm::vputils::getOrCreateVPValueForSCEVExpr().
|
inline |
The trip count of the original loop.
Definition at line 4091 of file VPlan.h.
References assert().
Referenced by llvm::VPlanTransforms::addActiveLaneMask(), llvm::VPlanTransforms::addExplicitVectorLength(), llvm::VPlanTransforms::addMiddleCheck(), llvm::VPlanTransforms::addMinimumIterationCheck(), addVPLaneMaskPhiAndUpdateExitBranch(), llvm::VPlanTransforms::canonicalizeEVLLoops(), llvm::LoopVectorizationPlanner::executePlan(), llvm::VPlanTransforms::expandSCEVs(), isConditionTrueViaVFAndUF(), llvm::vputils::isHeaderMask(), llvm::VPlanTransforms::materializeBackedgeTakenCount(), llvm::VPlanTransforms::materializeConstantVectorTripCount(), llvm::VPlanTransforms::materializeVectorTripCount(), llvm::VPlanTransforms::materializeVFAndVFxUF(), optimizeVectorInductionWidthForTCAndVFUF(), preparePlanForEpilogueVectorLoop(), simplifyBranchConditionForVFAndUF(), and llvm::VPTypeAnalysis::VPTypeAnalysis().
|
inline |
Return a VPValue wrapping i1 true.
Definition at line 4196 of file VPlan.h.
References getContext(), getOrAddLiveIn(), and llvm::ConstantInt::getTrue().
Referenced by llvm::VPlanTransforms::addMinimumIterationCheck(), simplifyBranchConditionForVFAndUF(), and transformRecipestoEVLRecipes().
|
inline |
Definition at line 4159 of file VPlan.h.
References assert(), and llvm::SetVector< T, Vector, Set, N >::size().
Referenced by llvm::VPlanTransforms::addBranchWeightToMiddleTerminator(), execute(), llvm::VPlanTransforms::materializeVFAndVFxUF(), llvm::VPlanTransforms::narrowInterleaveGroups(), llvm::VPlanTransforms::optimizeForVFAndUF(), and llvm::VPTransformState::setDebugLocFrom().
VPRegionBlock * VPlan::getVectorLoopRegion | ( | ) |
Returns the VPRegionBlock of the vector loop.
Definition at line 1037 of file VPlan.cpp.
References B, getEntry(), and llvm::vp_depth_first_shallow().
Referenced by addExitUsersForFirstOrderRecurrences(), llvm::VPlanTransforms::addExplicitVectorLength(), addScalarResumePhis(), addVPLaneMaskPhiAndUpdateExitBranch(), llvm::VPlanTransforms::adjustFixedOrderRecurrences(), llvm::LoopVectorizationPlanner::buildVPlans(), llvm::calculateRegisterUsageForPlan(), llvm::VPlanTransforms::clearReductionWrapFlags(), llvm::collectEphemeralRecipesForVPlan(), llvm::VPlanTransforms::convertToAbstractRecipes(), cost(), llvm::VPlanTransforms::createLoopRegions(), createScalarIVSteps(), llvm::LoopVectorizationPlanner::emitInvalidCostRemarks(), expandVPWidenIntOrFpInduction(), expandVPWidenPointerInduction(), findHeaderMask(), getCanonicalIV(), getMiddleBlock(), getVectorPreheader(), llvm::VPlanTransforms::handleMaxMinNumReductions(), hasReplicatorRegion(), llvm::VPlanTransforms::introduceMasksAndLinearize(), isDefinedInsideLoopRegions(), legalizeAndOptimizeInductions(), licm(), llvm::VPlanTransforms::materializeBuildVectors(), llvm::VPlanTransforms::narrowInterleaveGroups(), narrowToSingleScalarRecipes(), optimizeVectorInductionWidthForTCAndVFUF(), planContainsAdditionalSimplifications(), preparePlanForEpilogueVectorLoop(), preparePlanForMainVectorLoop(), removeRedundantCanonicalIVs(), removeRedundantInductionCasts(), llvm::VPlanTransforms::replicateByVF(), scalarizeInstruction(), llvm::LoopVectorizationPlanner::selectInterleaveCount(), simplifyBlends(), simplifyBranchConditionForVFAndUF(), transformRecipestoEVLRecipes(), llvm::VPlanTransforms::truncateToMinimalBitwidths(), llvm::VPlanTransforms::unrollByUF(), llvm::VPInterleavedAccessInfo::VPInterleavedAccessInfo(), llvm::VPTypeAnalysis::VPTypeAnalysis(), and willGenerateVectors().
const VPRegionBlock * VPlan::getVectorLoopRegion | ( | ) | const |
Definition at line 1045 of file VPlan.cpp.
References B, getEntry(), and llvm::vp_depth_first_shallow().
|
inline |
Returns the preheader of the vector loop region, if one exists, or null otherwise.
Definition at line 4034 of file VPlan.h.
References llvm::VPBlockBase::getSinglePredecessor(), and getVectorLoopRegion().
Referenced by addVPLaneMaskPhiAndUpdateExitBranch(), llvm::VPlanTransforms::attachCheckBlock(), llvm::LoopVectorizationPlanner::executePlan(), expandVPWidenIntOrFpInduction(), licm(), llvm::VPlanTransforms::materializeBroadcasts(), optimizeVectorInductionWidthForTCAndVFUF(), simplifyBranchConditionForVFAndUF(), and llvm::VPlanTransforms::truncateToMinimalBitwidths().
|
inline |
The vector trip count.
Definition at line 4119 of file VPlan.h.
Referenced by addCanonicalIVRecipes(), llvm::VPlanTransforms::addMiddleCheck(), addScalarResumePhis(), llvm::calculateRegisterUsageForPlan(), llvm::VPlanTransforms::canonicalizeEVLLoops(), llvm::VPlanTransforms::handleMaxMinNumReductions(), isConditionTrueViaVFAndUF(), llvm::VPlanTransforms::materializeConstantVectorTripCount(), llvm::VPlanTransforms::materializeVectorTripCount(), and preparePlanForMainVectorLoop().
|
inline |
Returns the VF of the vector loop region.
Definition at line 4122 of file VPlan.h.
Referenced by llvm::VPlanTransforms::createInterleaveGroups(), createScalarIVSteps(), createWidenInductionRecipes(), llvm::vputils::isHeaderMask(), llvm::VPlanTransforms::materializeVFAndVFxUF(), llvm::VPlanTransforms::narrowInterleaveGroups(), and transformRecipestoEVLRecipes().
|
inline |
Returns VF * UF of the vector loop region.
Definition at line 4125 of file VPlan.h.
Referenced by addCanonicalIVRecipes(), llvm::VPlanTransforms::canonicalizeEVLLoops(), llvm::VPlanTransforms::materializeVectorTripCount(), llvm::VPlanTransforms::materializeVFAndVFxUF(), and transformRecipestoEVLRecipes().
|
inline |
Returns true if the VPlan is based on a loop with an early exit.
That is the case if the VPlan has either more than one exit block or a single exit block with multiple predecessors (one for the exit via the latch and one via the other early exit).
Definition at line 4302 of file VPlan.h.
References llvm::count_if(), llvm::VPBlockBase::getNumPredecessors(), and llvm::SmallVectorBase< Size_T >::size().
Referenced by llvm::LoopVectorizationPlanner::computeBestVF(), llvm::LoopVectorizationPlanner::executePlan(), and llvm::LoopVectorizationPlanner::selectInterleaveCount().
|
inline |
Definition at line 4140 of file VPlan.h.
References llvm::any_of(), and llvm::details::FixedOrScalableQuantity< LeafTy, ValueTy >::isScalable().
Referenced by expandVPWidenPointerInduction(), and legalizeAndOptimizeInductions().
|
inline |
Returns true if the scalar tail may execute after the vector loop.
Note that this relies on unneeded branches to the scalar tail loop being removed.
Definition at line 4313 of file VPlan.h.
References getEntry(), llvm::VPBlockBase::getNumPredecessors(), getScalarPreheader(), and llvm::VPBlockBase::getSinglePredecessor().
Referenced by llvm::VPlanTransforms::handleMaxMinNumReductions(), and llvm::VPlanTransforms::materializeConstantVectorTripCount().
|
inline |
Definition at line 4150 of file VPlan.h.
References assert(), llvm::ElementCount::getFixed(), hasVF(), and llvm::SetVector< T, Vector, Set, N >::size().
Referenced by legalizeAndOptimizeInductions(), llvm::VPlanTransforms::materializeBroadcasts(), llvm::VPlanTransforms::materializeBuildVectors(), narrowToSingleScalarRecipes(), and sinkScalarOperands().
Definition at line 4157 of file VPlan.h.
References llvm::SetVector< T, Vector, Set, N >::contains(), and llvm::SetVector< T, Vector, Set, N >::empty().
Referenced by llvm::LoopVectorizationPlanner::executePlan(), llvm::VPlanTransforms::materializeConstantVectorTripCount(), llvm::VPlanTransforms::optimizeForVFAndUF(), and setUF().
|
inline |
Definition at line 4139 of file VPlan.h.
References llvm::SetVector< T, Vector, Set, N >::count().
Referenced by llvm::LoopVectorizationPlanner::executePlan(), hasScalarVFOnly(), llvm::VPlanTransforms::materializeConstantVectorTripCount(), llvm::VPlanTransforms::optimizeForVFAndUF(), and setVF().
bool VPlan::isExitBlock | ( | VPBlockBase * | VPBB | ) |
Returns true if VPBB
is an exit block.
Definition at line 948 of file VPlan.cpp.
References llvm::is_contained().
Referenced by llvm::VPBasicBlock::connectToPredecessors().
|
inline |
Returns true if the VPlan already has been unrolled, i.e.
it has a single concrete UF.
Definition at line 4172 of file VPlan.h.
References llvm::SetVector< T, Vector, Set, N >::size().
Referenced by simplifyRecipe().
LLVM_DUMP_METHOD void VPlan::print | ( | raw_ostream & | O | ) | const |
Print this VPlan to O
.
Definition at line 1091 of file VPlan.cpp.
References llvm::Block, getEntry(), getName(), and printLiveIns().
Referenced by dump(), llvm::operator<<(), and llvm::LoopVectorizationPlanner::printPlans().
LLVM_DUMP_METHOD void VPlan::printDOT | ( | raw_ostream & | O | ) | const |
Print this VPlan in DOT format to O
.
Definition at line 1132 of file VPlan.cpp.
References llvm::Metadata::dump(), and Printer.
Referenced by llvm::LoopVectorizationPlanner::printPlans().
void VPlan::printLiveIns | ( | raw_ostream & | O | ) | const |
Print the live-ins of this VPlan to O
.
Definition at line 1053 of file VPlan.cpp.
References llvm::VPValue::getNumUsers(), llvm::VPValue::isLiveIn(), and llvm::VPValue::printAsOperand().
Referenced by llvm::VPlanPrinter::dump(), and print().
|
inline |
Resets the trip count for the VPlan.
The caller must make sure all uses of the original trip count have been replaced.
Definition at line 4105 of file VPlan.h.
References assert(), and llvm::VPValue::getNumUsers().
Referenced by llvm::VPlanTransforms::expandSCEVs(), and preparePlanForEpilogueVectorLoop().
|
inline |
Definition at line 4018 of file VPlan.h.
References llvm::VPBlockBase::setPlan().
Referenced by llvm::EpilogueVectorizerEpilogueLoop::emitMinimumVectorEpilogueIterCountCheck(), and VPlan().
Definition at line 4177 of file VPlan.h.
References Name, and llvm::Twine::str().
Referenced by execute().
|
inline |
Set the trip count assuming it is currently null; if it is not - use resetTripCount().
Definition at line 4098 of file VPlan.h.
References assert().
Referenced by addInitialSkeleton().
|
inline |
Definition at line 4164 of file VPlan.h.
References assert(), llvm::SetVector< T, Vector, Set, N >::clear(), hasUF(), and llvm::SetVector< T, Vector, Set, N >::insert().
Referenced by llvm::VPlanTransforms::addExplicitVectorLength(), and llvm::VPlanTransforms::unrollByUF().
|
inline |
Definition at line 4133 of file VPlan.h.
References assert(), llvm::SetVector< T, Vector, Set, N >::clear(), hasVF(), and llvm::SetVector< T, Vector, Set, N >::insert().
Referenced by llvm::VPlanTransforms::optimizeForVFAndUF().
|
inline |
Returns an iterator range over all VFs of the plan.
Definition at line 4146 of file VPlan.h.
Referenced by llvm::LoopVectorizationPlanner::computeBestVF(), and llvm::LoopVectorizationPlanner::emitInvalidCostRemarks().
|
friend |
|
friend |