LLVM: llvm::VPBlockBase Class Reference (original) (raw)

VPBlockBase is the building block of the Hierarchical Control-Flow Graph. More...

#include "[Transforms/Vectorize/VPlan.h](VPlan%5F8h%5Fsource.html)"

Public Types
using VPBlockTy = enum { VPRegionBlockSC, VPBasicBlockSC, VPIRBasicBlockSC }
An enumeration for keeping track of the concrete subclass of VPBlockBase that are actually instantiated.
using VPBlocksTy = SmallVectorImpl<VPBlockBase *>
Public Member Functions
virtual ~VPBlockBase ()=default
const std::string & getName () const
void setName (const Twine &newName)
unsigned getVPBlockID () const
VPRegionBlock * getParent ()
const VPRegionBlock * getParent () const
VPlan * getPlan ()
const VPlan * getPlan () const
void setPlan (VPlan *ParentPlan)
Sets the pointer of the plan containing the block.
void setParent (VPRegionBlock *P)
const VPBasicBlock * getEntryBasicBlock () const
VPBasicBlock * getEntryBasicBlock ()
const VPBasicBlock * getExitingBasicBlock () const
VPBasicBlock * getExitingBasicBlock ()
const VPBlocksTy & getSuccessors () const
VPBlocksTy & getSuccessors ()
iterator_range< VPBlockBase ** > successors ()
iterator_range< VPBlockBase ** > predecessors ()
const VPBlocksTy & getPredecessors () const
VPBlocksTy & getPredecessors ()
VPBlockBase * getSingleSuccessor () const
VPBlockBase * getSinglePredecessor () const
size_t getNumSuccessors () const
size_t getNumPredecessors () const
bool hasPredecessors () const
Returns true if this block has any predecessors.
VPBlockBase * getEnclosingBlockWithSuccessors ()
An Enclosing Block of a block B is any block containing B, including B itself.
VPBlockBase * getEnclosingBlockWithPredecessors ()
const VPBlocksTy & getHierarchicalSuccessors ()
VPBlockBase * getSingleHierarchicalSuccessor ()
const VPBlocksTy & getHierarchicalPredecessors ()
VPBlockBase * getSingleHierarchicalPredecessor ()
void setOneSuccessor (VPBlockBase *Successor)
Set a given VPBlockBase Successor as the single successor of this VPBlockBase.
void setTwoSuccessors (VPBlockBase *IfTrue, VPBlockBase *IfFalse)
Set two given VPBlockBases IfTrue and IfFalse to be the two successors of this VPBlockBase.
void setPredecessors (ArrayRef< VPBlockBase * > NewPreds)
Set each VPBasicBlock in NewPreds as predecessor of this VPBlockBase.
void setSuccessors (ArrayRef< VPBlockBase * > NewSuccs)
Set each VPBasicBlock in NewSuccss as successor of this VPBlockBase.
void clearPredecessors ()
Remove all the predecessor of this block.
void clearSuccessors ()
Remove all the successors of this block.
void swapPredecessors ()
Swap predecessors of the block.
void swapSuccessors ()
Swap successors of the block. The block must have exactly 2 successors.
unsigned getIndexForPredecessor (const VPBlockBase *Pred) const
Returns the index for Pred in the blocks predecessors list.
unsigned getIndexForSuccessor (const VPBlockBase *Succ) const
Returns the index for Succ in the blocks successor list.
virtual void execute (VPTransformState *State)=0
The method which generates the output IR that correspond to this VPBlockBase, thereby "executing" the VPlan.
virtual InstructionCost cost (ElementCount VF, VPCostContext &Ctx)=0
Return the cost of the block.
void printAsOperand (raw_ostream &OS, bool PrintType=false) const
virtual void print (raw_ostream &O, const Twine &Indent, VPSlotTracker &SlotTracker) const =0
Print plain-text dump of this VPBlockBase to O, prefixing all lines with Indent.
void print (raw_ostream &O) const
Print plain-text dump of this VPlan to O.
void printSuccessors (raw_ostream &O, const Twine &Indent) const
Print the successors of this block to O, prefixing all lines with Indent.
LLVM_DUMP_METHOD void dump () const
Dump this VPBlockBase to dbgs().
virtual VPBlockBase * clone ()=0
Clone the current block and it's recipes without updating the operands of the cloned recipes, including all blocks in the single-entry single-exit region for VPRegionBlocks.
Friends
class VPBlockUtils

VPBlockBase is the building block of the Hierarchical Control-Flow Graph.

A VPBlockBase can be either a VPBasicBlock or a VPRegionBlock.

Definition at line 81 of file VPlan.h.

VPBlocksTy

VPBlockTy

using llvm::VPBlockBase::VPBlockTy = enum { VPRegionBlockSC, VPBasicBlockSC, VPIRBasicBlockSC }

An enumeration for keeping track of the concrete subclass of VPBlockBase that are actually instantiated.

Values of this enumeration are kept in the SubclassID field of the VPBlockBase objects. They are used for concrete type identification.

Definition at line 158 of file VPlan.h.

Definition at line 150 of file VPlan.h.

References N.

Referenced by llvm::VPBasicBlock::classof(), llvm::VPRegionBlock::classof(), clone(), llvm::VPRegionBlock::clone(), llvm::VPBasicBlock::connectToPredecessors(), llvm::VPRegionBlock::cost(), llvm::VPRegionBlock::dissolveToCFGLoop(), llvm::VPBasicBlock::execute(), llvm::VPRegionBlock::execute(), llvm::VPBasicBlock::getCFGPredecessor(), getEnclosingBlockWithPredecessors(), getEnclosingBlockWithSuccessors(), llvm::VPRegionBlock::getEntry(), llvm::VPRegionBlock::getEntry(), getEntryBasicBlock(), getEntryBasicBlock(), llvm::VPRegionBlock::getExiting(), llvm::VPRegionBlock::getExiting(), getExitingBasicBlock(), getExitingBasicBlock(), getIndexForPredecessor(), getIndexForSuccessor(), getSingleHierarchicalPredecessor(), getSingleHierarchicalSuccessor(), getSinglePredecessor(), getSingleSuccessor(), llvm::VPRegionBlock::setEntry(), llvm::VPRegionBlock::setExiting(), setOneSuccessor(), setTwoSuccessors(), llvm::VPBasicBlock::VPBasicBlock(), VPBlockUtils, llvm::VPBasicBlock::VPlan, and llvm::VPRegionBlock::VPlan.

~VPBlockBase()

virtual llvm::VPBlockBase::~VPBlockBase ( ) virtualdefault

clearPredecessors()

void llvm::VPBlockBase::clearPredecessors ( ) inline

clearSuccessors()

void llvm::VPBlockBase::clearSuccessors ( ) inline

clone()

virtual VPBlockBase * llvm::VPBlockBase::clone ( ) pure virtual

cost()

dump()

execute()

virtual void llvm::VPBlockBase::execute ( VPTransformState * State) pure virtual

getEnclosingBlockWithPredecessors()

VPBlockBase * VPBlockBase::getEnclosingBlockWithPredecessors ( )

getEnclosingBlockWithSuccessors()

VPBlockBase * VPBlockBase::getEnclosingBlockWithSuccessors ( )

getEntryBasicBlock() [1/2]

getEntryBasicBlock() [2/2]

Returns

the VPBasicBlock that is the entry of this VPBlockBase, recursively, if the latter is a VPRegionBlock. Otherwise, if this VPBlockBase is a VPBasicBlock, it is returned.

the VPBasicBlock that is the entry of Block, possibly indirectly.

Definition at line 166 of file VPlan.cpp.

References llvm::Block, llvm::cast(), llvm::dyn_cast(), llvm::RegionBase< Tr >::getEntry(), and VPBlockBase().

Referenced by llvm::VPlanTransforms::addExitUsersForFirstOrderRecurrences(), llvm::VPlanTransforms::addExplicitVectorLength(), llvm::VPlanTransforms::adjustFixedOrderRecurrences(), llvm::calculateRegisterUsageForPlan(), llvm::VPlanTransforms::clearReductionWrapFlags(), llvm::VPlanTransforms::createLoopRegions(), createScalarIVSteps(), findHeaderMask(), llvm::VPRegionBlock::getCanonicalIV(), llvm::VPlanTransforms::handleMaxMinNumReductions(), llvm::VPlanTransforms::handleMultiUseReductions(), llvm::VPlanTransforms::introduceMasksAndLinearize(), legalizeAndOptimizeInductions(), llvm::VPlanTransforms::narrowInterleaveGroups(), optimizeVectorInductionWidthForTCAndVFUF(), preparePlanForEpilogueVectorLoop(), preparePlanForMainVectorLoop(), removeRedundantCanonicalIVs(), removeRedundantExpandSCEVRecipes(), removeRedundantInductionCasts(), llvm::LoopVectorizationPlanner::selectInterleaveCount(), sinkScalarOperands(), transformRecipestoEVLRecipes(), and llvm::VPlanTransforms::unrollByUF().

getExitingBasicBlock() [1/2]

getExitingBasicBlock() [2/2]

Returns

the VPBasicBlock that is the exiting this VPBlockBase, recursively, if the latter is a VPRegionBlock. Otherwise, if this VPBlockBase is a VPBasicBlock, it is returned.

the VPBasicBlock that is the exit of Block, possibly indirectly.

Definition at line 186 of file VPlan.cpp.

References llvm::Block, llvm::cast(), llvm::dyn_cast(), and VPBlockBase().

Referenced by addVPLaneMaskPhiAndUpdateExitBranch(), expandVPWidenIntOrFpInduction(), expandVPWidenPointerInduction(), llvm::VPlanTransforms::handleMaxMinNumReductions(), llvm::VPBasicBlock::isExiting(), simplifyBranchConditionForVFAndUF(), sinkScalarOperands(), and tryToReplaceALMWithWideALM().

getHierarchicalPredecessors()

const VPBlocksTy & llvm::VPBlockBase::getHierarchicalPredecessors ( ) inline

getHierarchicalSuccessors()

const VPBlocksTy & llvm::VPBlockBase::getHierarchicalSuccessors ( ) inline

getIndexForPredecessor()

getIndexForSuccessor()

getName()

const std::string & llvm::VPBlockBase::getName ( ) const inline

getNumPredecessors()

size_t llvm::VPBlockBase::getNumPredecessors ( ) const inline

getNumSuccessors()

size_t llvm::VPBlockBase::getNumSuccessors ( ) const inline

getParent() [1/2]

Definition at line 173 of file VPlan.h.

Referenced by addReplicateRegions(), cloneFrom(), llvm::VPBlockUtils::connectBlocks(), llvm::VPRegionBlock::dissolveToCFGLoop(), llvm::VPBasicBlock::execute(), llvm::VPBasicBlock::getCFGPredecessor(), llvm::VPBasicBlock::getEnclosingLoopRegion(), llvm::VPBasicBlock::getEnclosingLoopRegion(), llvm::VPRecipeBase::getRegion(), llvm::VPRecipeBase::getRegion(), hasConditionalTerminator(), llvm::VPlanTransforms::hoistPredicatedLoads(), llvm::VPBlockUtils::insertBlockAfter(), llvm::VPBlockUtils::insertBlockBefore(), llvm::VPBlockUtils::insertTwoBlocksAfter(), llvm::VPBasicBlock::isExiting(), setOneSuccessor(), and llvm::VPRecipeBuilder::tryToCreateWidenRecipe().

getParent() [2/2]

getPlan() [1/2]

VPlan * VPBlockBase::getPlan ( )

Returns

A pointer to the plan containing the current block.

Definition at line 161 of file VPlan.cpp.

References getPlanEntry().

Referenced by llvm::VPBasicBlock::clone(), llvm::VPIRBasicBlock::clone(), llvm::VPRegionBlock::clone(), llvm::VPBasicBlock::connectToPredecessors(), llvm::VPBuilder::createElementCount(), llvm::VPRegionBlock::dissolveToCFGLoop(), expandVPWidenIntOrFpInduction(), llvm::VPSlotTracker::getOrCreateName(), llvm::operator<<(), optimizeMaskToEVL(), print(), replaceVPBBWithIRVPBB(), scalarizeInstruction(), and llvm::VPBasicBlock::splitAt().

getPlan() [2/2]

getPredecessors() [1/2]

VPBlocksTy & llvm::VPBlockBase::getPredecessors ( ) inline

getPredecessors() [2/2]

const VPBlocksTy & llvm::VPBlockBase::getPredecessors ( ) const inline

Definition at line 204 of file VPlan.h.

Referenced by llvm::VPlanTransforms::addMiddleCheck(), canonicalHeaderAndLatch(), llvm::VPlanTransforms::canonicalizeEVLLoops(), cloneFrom(), llvm::VPBlockUtils::connectBlocks(), llvm::VPBasicBlock::connectToPredecessors(), createLoopRegion(), llvm::VPIRPhi::execute(), llvm::VPBasicBlock::getCFGPredecessor(), llvm::VPlanTransforms::handleEarlyExits(), llvm::VPlanTransforms::handleUncountableEarlyExit(), llvm::VPBlockUtils::insertBlockAfter(), llvm::VPBlockUtils::insertBlockBefore(), llvm::VPBlockUtils::isHeader(), llvm::VPBlockUtils::reassociateBlocks(), llvm::VPlanTransforms::removeBranchOnConst(), and llvm::VPRegionBlock::setEntry().

getSingleHierarchicalPredecessor()

VPBlockBase * llvm::VPBlockBase::getSingleHierarchicalPredecessor ( ) inline

getSingleHierarchicalSuccessor()

VPBlockBase * llvm::VPBlockBase::getSingleHierarchicalSuccessor ( ) inline

getSinglePredecessor()

VPBlockBase * llvm::VPBlockBase::getSinglePredecessor ( ) const inline

Returns

the predecessor of this VPBlockBase if it has a single predecessor. Otherwise return a null pointer.

Definition at line 215 of file VPlan.h.

References VPBlockBase().

Referenced by llvm::VPlanTransforms::addMiddleCheck(), llvm::VPlanTransforms::attachCheckBlock(), llvm::VPRegionBlock::dissolveToCFGLoop(), llvm::VPRegionBlock::getPreheaderVPBB(), llvm::VPlan::getVectorPreheader(), llvm::VPlanTransforms::handleEarlyExits(), llvm::VPlanTransforms::handleUncountableEarlyExit(), llvm::VPlan::hasScalarTail(), llvm::VPlanTransforms::replaceSymbolicStrides(), simplifyBranchConditionForVFAndUF(), and llvm::VPlanTransforms::updateScalarResumePhis().

getSingleSuccessor()

VPBlockBase * llvm::VPBlockBase::getSingleSuccessor ( ) const inline

Returns

the successor of this VPBlockBase if it has a single successor. Otherwise return a null pointer.

Definition at line 209 of file VPlan.h.

References VPBlockBase().

Referenced by llvm::VPlanTransforms::addExitUsersForFirstOrderRecurrences(), addInitialSkeleton(), llvm::VPBasicBlock::connectToPredecessors(), createLoopRegion(), llvm::VPRegionBlock::dissolveToCFGLoop(), llvm::VPIRBasicBlock::execute(), llvm::LoopVectorizationPlanner::executePlan(), llvm::VPRegionBlock::getCanonicalIV(), llvm::VPlan::getMiddleBlock(), licm(), llvm::VPlanTransforms::materializeConstantVectorTripCount(), mergeReplicateRegionsIntoSuccessors(), simplifyBranchConditionForVFAndUF(), sinkScalarOperands(), and llvm::VPlanTransforms::updateScalarResumePhis().

getSuccessors() [1/2]

VPBlocksTy & llvm::VPBlockBase::getSuccessors ( ) inline

getSuccessors() [2/2]

const VPBlocksTy & llvm::VPBlockBase::getSuccessors ( ) const inline

Definition at line 198 of file VPlan.h.

Referenced by addInitialSkeleton(), llvm::VPBlockUtils::connectBlocks(), llvm::VPRegionBlock::cost(), createCondBranch(), llvm::VPlanTransforms::handleUncountableEarlyExit(), llvm::VPBlockUtils::insertBlockAfter(), llvm::VPBlockUtils::insertBlockBefore(), llvm::VPBlockUtils::insertTwoBlocksAfter(), llvm::EpilogueVectorizerMainLoop::introduceCheckBlockInVPlan(), llvm::VPlanTransforms::introduceMasksAndLinearize(), llvm::VPBlockUtils::isLatch(), printSuccessors(), llvm::VPBlockUtils::reassociateBlocks(), llvm::VPRegionBlock::setExiting(), and sinkScalarOperands().

getVPBlockID()

unsigned llvm::VPBlockBase::getVPBlockID ( ) const inline

Returns

an ID for the concrete type of this object. This is used to implement the classof checks. This should not be used for any other purpose, as the values may change as LLVM evolves.

Definition at line 171 of file VPlan.h.

hasPredecessors()

bool llvm::VPBlockBase::hasPredecessors ( ) const inline

predecessors()

print() [1/2]

print() [2/2]

printAsOperand()

void llvm::VPBlockBase::printAsOperand ( raw_ostream & OS, bool PrintType = false ) const inline

printSuccessors()

setName()

void llvm::VPBlockBase::setName ( const Twine & newName) inline

setOneSuccessor()

void llvm::VPBlockBase::setOneSuccessor ( VPBlockBase * Successor) inline

setParent()

setPlan()

void VPBlockBase::setPlan ( VPlan * ParentPlan )

setPredecessors()

setSuccessors()

setTwoSuccessors()

successors()

swapPredecessors()

void llvm::VPBlockBase::swapPredecessors ( ) inline

swapSuccessors()

void llvm::VPBlockBase::swapSuccessors ( ) inline

VPBlockUtils


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