LLVM: llvm::VPBasicBlock Class Reference (original) (raw)
VPBasicBlock serves as the leaf of the Hierarchical Control-Flow Graph. More...
#include "[Transforms/Vectorize/VPlan.h](VPlan%5F8h%5Fsource.html)"
| Public Types | |
|---|---|
| using | RecipeListTy = iplist<VPRecipeBase> |
| using | iterator = RecipeListTy::iterator |
| Instruction iterators... | |
| using | const_iterator = RecipeListTy::const_iterator |
| using | reverse_iterator = RecipeListTy::reverse_iterator |
| using | const_reverse_iterator = RecipeListTy::const_reverse_iterator |
| Public Types inherited from llvm::VPBlockBase | |
| 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 | |
|---|---|
| ~VPBasicBlock () override | |
| iterator | begin () |
| Recipe iterator methods. | |
| const_iterator | begin () const |
| iterator | end () |
| const_iterator | end () const |
| reverse_iterator | rbegin () |
| const_reverse_iterator | rbegin () const |
| reverse_iterator | rend () |
| const_reverse_iterator | rend () const |
| size_t | size () const |
| bool | empty () const |
| const VPRecipeBase & | front () const |
| VPRecipeBase & | front () |
| const VPRecipeBase & | back () const |
| VPRecipeBase & | back () |
| RecipeListTy & | getRecipeList () |
| Returns a reference to the list of recipes. | |
| void | insert (VPRecipeBase *Recipe, iterator InsertPt) |
| void | appendRecipe (VPRecipeBase *Recipe) |
| Augment the existing recipes of a VPBasicBlock with an additional Recipe as the last recipe. | |
| void | execute (VPTransformState *State) override |
| The method which generates the output IR instructions that correspond to this VPBasicBlock, thereby "executing" the VPlan. | |
| InstructionCost | cost (ElementCount VF, VPCostContext &Ctx) override |
| Return the cost of this VPBasicBlock. | |
| iterator | getFirstNonPhi () |
| Return the position of the first non-phi node recipe in the block. | |
| iterator_range< iterator > | phis () |
| Returns an iterator range over the PHI-like recipes in the block. | |
| VPBasicBlock * | splitAt (iterator SplitAt) |
| Split current block at SplitAt by inserting a new block between the current block and its successors and moving all recipes starting at SplitAt to the new block. | |
| VPRegionBlock * | getEnclosingLoopRegion () |
| const VPRegionBlock * | getEnclosingLoopRegion () const |
| void | print (raw_ostream &O, const Twine &Indent, VPSlotTracker &SlotTracker) const override |
| Print this VPBsicBlock to O, prefixing all lines with Indent. | |
| VPRecipeBase * | getTerminator () |
| If the block has multiple successors, return the branch recipe terminating the block. | |
| const VPRecipeBase * | getTerminator () const |
| bool | isExiting () const |
| Returns true if the block is exiting it's parent region. | |
| VPBasicBlock * | clone () override |
| Clone the current block and it's recipes, without updating the operands of the cloned recipes. | |
| const VPBasicBlock * | getCFGPredecessor (unsigned Idx) const |
| Returns the predecessor block at index Idx with the predecessors as per the corresponding plain CFG. | |
| void | print (raw_ostream &O) const |
| Print plain-text dump of this VPlan to O. | |
| Public Member Functions inherited from llvm::VPBlockBase | |
| 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. | |
| void | printAsOperand (raw_ostream &OS, bool PrintType=false) const |
| 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(). |
| Static Public Member Functions | |
|---|---|
| static RecipeListTy VPBasicBlock::* | getSublistAccess (VPRecipeBase *) |
| Returns a pointer to a member of the recipe list. | |
| static bool | classof (const VPBlockBase *V) |
| Method to support type inquiry through isa, cast, and dyn_cast. |
| Protected Member Functions | |
|---|---|
| VPBasicBlock (const unsigned char BlockSC, const Twine &Name="") | |
| void | executeRecipes (VPTransformState *State, BasicBlock *BB) |
| Execute the recipes in the IR basic block BB. | |
| void | connectToPredecessors (VPTransformState &State) |
| Connect the VPBBs predecessors' in the VPlan CFG to the IR basic block generated for this VPBB. | |
| Protected Member Functions inherited from llvm::VPBlockBase | |
| VPBlockBase (const unsigned char SC, const std::string &N) |
| Protected Attributes | |
|---|---|
| RecipeListTy | Recipes |
| The VPRecipes held in the order of output instructions to generate. |
VPBasicBlock serves as the leaf of the Hierarchical Control-Flow Graph.
It holds a sequence of zero or more VPRecipe's each representing a sequence of output IR instructions. All PHI-like recipes must come before any non-PHI recipes.
Definition at line 3966 of file VPlan.h.
◆ const_iterator
◆ const_reverse_iterator
◆ iterator
◆ RecipeListTy
◆ reverse_iterator
◆ ~VPBasicBlock()
| llvm::VPBasicBlock::~VPBasicBlock ( ) | inlineoverride |
|---|
◆ appendRecipe()
| void llvm::VPBasicBlock::appendRecipe ( VPRecipeBase * Recipe) | inline |
|---|
◆ back() [1/2]
◆ back() [2/2]
◆ begin() [1/2]
| iterator llvm::VPBasicBlock::begin ( ) | inline |
|---|
Recipe iterator methods.
Definition at line 4001 of file VPlan.h.
References Recipes.
Referenced by addCanonicalIVRecipes(), llvm::VPlanTransforms::canonicalizeEVLLoops(), llvm::VPRegionBlock::getCanonicalIV(), getFirstNonPhi(), llvm::VPlanTransforms::handleMaxMinNumReductions(), llvm::VPlanTransforms::materializeBackedgeTakenCount(), llvm::VPlanTransforms::materializeBroadcasts(), llvm::VPlanTransforms::materializeVectorTripCount(), llvm::VPlanTransforms::materializeVFAndVFxUF(), phis(), preparePlanForMainVectorLoop(), and replaceVPBBWithIRVPBB().
◆ begin() [2/2]
| const_iterator llvm::VPBasicBlock::begin ( ) const | inline |
|---|
◆ classof()
◆ clone()
◆ connectToPredecessors()
Connect the VPBBs predecessors' in the VPlan CFG to the IR basic block generated for this VPBB.
Definition at line 378 of file VPlan.cpp.
References llvm::LoopBase< BlockT, LoopT >::addBasicBlockToLoop(), assert(), llvm::cast(), CFG, llvm::BranchInst::Create(), llvm::dbgs(), DL, llvm::dyn_cast(), llvm::VPBlockBase::getHierarchicalSuccessors(), llvm::Value::getName(), llvm::VPBlockBase::getPlan(), llvm::VPBlockBase::getPredecessors(), llvm::VPBlockBase::getSingleSuccessor(), llvm::BasicBlock::getTerminator(), llvm::DominatorTreeBase< BasicBlock, false >::Insert, llvm::isa(), llvm::VPBlockUtils::isHeader(), LLVM_DEBUG, llvm::to_vector(), and llvm::VPBlockBase::VPBlockBase().
Referenced by execute(), and llvm::VPIRBasicBlock::execute().
◆ cost()
◆ empty()
| bool llvm::VPBasicBlock::empty ( ) const | inline |
|---|
◆ end() [1/2]
| iterator llvm::VPBasicBlock::end ( ) | inline |
|---|
◆ end() [2/2]
| const_iterator llvm::VPBasicBlock::end ( ) const | inline |
|---|
◆ execute()
The method which generates the output IR instructions that correspond to this VPBasicBlock, thereby "executing" the VPlan.
Implements llvm::VPBlockBase.
Reimplemented in llvm::VPIRBasicBlock.
Definition at line 478 of file VPlan.cpp.
References llvm::LoopBase< BlockT, LoopT >::addChildLoop(), assert(), connectToPredecessors(), llvm::dyn_cast_or_null(), executeRecipes(), llvm::VPBlockBase::getParent(), llvm::VPBlockBase::getSingleHierarchicalPredecessor(), llvm::VPBlockUtils::isHeader(), llvm::VPBlockUtils::isLatch(), and llvm::VPBlockBase::VPBlockBase().
◆ executeRecipes()
◆ front() [1/2]
◆ front() [2/2]
◆ getCFGPredecessor()
◆ getEnclosingLoopRegion() [1/2]
◆ getEnclosingLoopRegion() [2/2]
◆ getFirstNonPhi()
| VPBasicBlock::iterator VPBasicBlock::getFirstNonPhi | ( | ) |
|---|
◆ getRecipeList()
| RecipeListTy & llvm::VPBasicBlock::getRecipeList ( ) | inline |
|---|
◆ getSublistAccess()
| RecipeListTy VPBasicBlock::* llvm::VPBasicBlock::getSublistAccess ( VPRecipeBase * ) | inlinestatic |
|---|
Returns a pointer to a member of the recipe list.
Definition at line 4022 of file VPlan.h.
References Recipes.
◆ getTerminator() [1/2]
If the block has multiple successors, return the branch recipe terminating the block.
If there are no or only a single successor, return nullptr;
Definition at line 623 of file VPlan.cpp.
References back(), and hasConditionalTerminator().
Referenced by llvm::VPlanTransforms::addBranchWeightToMiddleTerminator(), addCanonicalIVRecipes(), addVPLaneMaskPhiAndUpdateExitBranch(), llvm::VPlanTransforms::canonicalizeEVLLoops(), expandVPWidenIntOrFpInduction(), expandVPWidenPointerInduction(), llvm::VPlanTransforms::handleMaxMinNumReductions(), llvm::VPlanTransforms::handleUncountableEarlyExit(), and llvm::VPlanTransforms::introduceMasksAndLinearize().
◆ getTerminator() [2/2]
◆ insert()
| void llvm::VPBasicBlock::insert ( VPRecipeBase * Recipe, iterator InsertPt ) | inline |
|---|
◆ isExiting()
| bool VPBasicBlock::isExiting | ( | ) | const |
|---|
◆ phis()
Returns an iterator range over the PHI-like recipes in the block.
Definition at line 4054 of file VPlan.h.
References begin(), getFirstNonPhi(), and llvm::make_range().
Referenced by llvm::VPlanTransforms::addExitUsersForFirstOrderRecurrences(), addInitialSkeleton(), llvm::VPlanTransforms::adjustFixedOrderRecurrences(), llvm::calculateRegisterUsageForPlan(), llvm::VPlanTransforms::clearReductionWrapFlags(), findHeaderMask(), llvm::VPlanTransforms::handleMaxMinNumReductions(), llvm::VPlanTransforms::handleMultiUseReductions(), llvm::VPlanTransforms::handleUncountableEarlyExit(), legalizeAndOptimizeInductions(), optimizeVectorInductionWidthForTCAndVFUF(), preparePlanForMainVectorLoop(), llvm::VPlanTransforms::removeBranchOnConst(), removeRedundantCanonicalIVs(), removeRedundantInductionCasts(), replaceVPBBWithIRVPBB(), llvm::LoopVectorizationPlanner::selectInterleaveCount(), llvm::VPlanTransforms::unrollByUF(), and llvm::VPlanTransforms::updateScalarResumePhis().
◆ print() [1/2]
◆ print() [2/2]
◆ rbegin() [1/2]
| reverse_iterator llvm::VPBasicBlock::rbegin ( ) | inline |
|---|
◆ rbegin() [2/2]
| const_reverse_iterator llvm::VPBasicBlock::rbegin ( ) const | inline |
|---|
◆ rend() [1/2]
| reverse_iterator llvm::VPBasicBlock::rend ( ) | inline |
|---|
◆ rend() [2/2]
| const_reverse_iterator llvm::VPBasicBlock::rend ( ) const | inline |
|---|
◆ size()
| size_t llvm::VPBasicBlock::size ( ) const | inline |
|---|
◆ splitAt()
◆ VPlan
◆ Recipes
| RecipeListTy llvm::VPBasicBlock::Recipes | protected |
|---|
The VPRecipes held in the order of output instructions to generate.
Definition at line 3981 of file VPlan.h.
Referenced by back(), back(), begin(), begin(), llvm::VPIRBasicBlock::clone(), cost(), empty(), end(), end(), executeRecipes(), front(), front(), getRecipeList(), getSublistAccess(), insert(), rbegin(), rbegin(), rend(), rend(), size(), and ~VPBasicBlock().
The documentation for this class was generated from the following files: