LLVM  14.0.0git
Public Types | Public Member Functions | Static Public Member Functions | List of all members
llvm::VPBasicBlock Class Reference

VPBasicBlock serves as the leaf of the Hierarchical Control-Flow Graph. More...

#include "Transforms/Vectorize/VPlan.h"

Inheritance diagram for llvm::VPBasicBlock:
Inheritance graph
[legend]
Collaboration diagram for llvm::VPBasicBlock:
Collaboration graph
[legend]

Public Types

using RecipeListTy = iplist< VPRecipeBase >
 
using iterator = RecipeListTy::iterator
 Instruction iterators... More...
 
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 { VPBasicBlockSC, VPRegionBlockSC }
 An enumeration for keeping track of the concrete subclass of VPBlockBase that are actually instantiated. More...
 
using VPBlocksTy = SmallVectorImpl< VPBlockBase * >
 

Public Member Functions

 VPBasicBlock (const Twine &Name="", VPRecipeBase *Recipe=nullptr)
 
 ~VPBasicBlock () override
 
iterator begin ()
 Recipe iterator methods. More...
 
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 VPRecipeBasefront () const
 
VPRecipeBasefront ()
 
const VPRecipeBaseback () const
 
VPRecipeBaseback ()
 
RecipeListTygetRecipeList ()
 Returns a reference to the list of recipes. More...
 
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. More...
 
void execute (struct VPTransformState *State) override
 The method which generates the output IR instructions that correspond to this VPBasicBlock, thereby "executing" the VPlan. More...
 
iterator getFirstNonPhi ()
 Return the position of the first non-phi node recipe in the block. More...
 
iterator_range< iteratorphis ()
 Returns an iterator range over the PHI-like recipes in the block. More...
 
void dropAllReferences (VPValue *NewValue) override
 Replace all operands of VPUsers in the block with NewValue and also replaces all uses of VPValues defined in the block with NewValue. More...
 
VPBasicBlocksplitAt (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. More...
 
void print (raw_ostream &O, const Twine &Indent, VPSlotTracker &SlotTracker) const override
 Print this VPBsicBlock to O, prefixing all lines with Indent. More...
 
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. More...
 
void print (raw_ostream &O) const
 Print plain-text dump of this VPlan to O. More...
 
- Public Member Functions inherited from llvm::VPBlockBase
virtual ~VPBlockBase ()=default
 
const std::string & getName () const
 
void setName (const Twine &newName)
 
unsigned getVPBlockID () const
 
VPRegionBlockgetParent ()
 
const VPRegionBlockgetParent () const
 
VPlangetPlan ()
 
const VPlangetPlan () const
 
void setPlan (VPlan *ParentPlan)
 Sets the pointer of the plan containing the block. More...
 
void setParent (VPRegionBlock *P)
 
const VPBasicBlockgetEntryBasicBlock () const
 
VPBasicBlockgetEntryBasicBlock ()
 
const VPBasicBlockgetExitBasicBlock () const
 
VPBasicBlockgetExitBasicBlock ()
 
const VPBlocksTygetSuccessors () const
 
VPBlocksTygetSuccessors ()
 
const VPBlocksTygetPredecessors () const
 
VPBlocksTygetPredecessors ()
 
VPBlockBasegetSingleSuccessor () const
 
VPBlockBasegetSinglePredecessor () const
 
size_t getNumSuccessors () const
 
size_t getNumPredecessors () const
 
VPBlockBasegetEnclosingBlockWithSuccessors ()
 An Enclosing Block of a block B is any block containing B, including B itself. More...
 
VPBlockBasegetEnclosingBlockWithPredecessors ()
 
const VPBlocksTygetHierarchicalSuccessors ()
 
VPBlockBasegetSingleHierarchicalSuccessor ()
 
const VPBlocksTygetHierarchicalPredecessors ()
 
VPBlockBasegetSingleHierarchicalPredecessor ()
 
VPValuegetCondBit ()
 
const VPValuegetCondBit () const
 
void setCondBit (VPValue *CV)
 Set the condition bit selecting the successor. More...
 
VPValuegetPredicate ()
 
const VPValuegetPredicate () const
 
void setPredicate (VPValue *Pred)
 Set the block's predicate. More...
 
void setOneSuccessor (VPBlockBase *Successor)
 Set a given VPBlockBase Successor as the single successor of this VPBlockBase. More...
 
void setTwoSuccessors (VPBlockBase *IfTrue, VPBlockBase *IfFalse, VPValue *Condition)
 Set two given VPBlockBases IfTrue and IfFalse to be the two successors of this VPBlockBase. More...
 
void setPredecessors (ArrayRef< VPBlockBase * > NewPreds)
 Set each VPBasicBlock in NewPreds as predecessor of this VPBlockBase. More...
 
void clearPredecessors ()
 Remove all the predecessor of this block. More...
 
void clearSuccessors ()
 Remove all the successors of this block and set to null its condition bit. More...
 
bool isLegalToHoistInto ()
 Return true if it is legal to hoist instructions into this block. More...
 
void printAsOperand (raw_ostream &OS, bool PrintType) const
 
void print (raw_ostream &O) const
 Print plain-text dump of this VPlan to O. More...
 
void printSuccessors (raw_ostream &O, const Twine &Indent) const
 Print the successors of this block to O, prefixing all lines with Indent. More...
 
LLVM_DUMP_METHOD void dump () const
 Dump this VPBlockBase to dbgs(). More...
 

Static Public Member Functions

static RecipeListTy VPBasicBlock::* getSublistAccess (VPRecipeBase *)
 Returns a pointer to a member of the recipe list. More...
 
static bool classof (const VPBlockBase *V)
 Method to support type inquiry through isa, cast, and dyn_cast. More...
 
- Static Public Member Functions inherited from llvm::VPBlockBase
static void deleteCFG (VPBlockBase *Entry)
 Delete all blocks reachable from a given VPBlockBase, inclusive. More...
 

Additional Inherited Members

- Protected Member Functions inherited from llvm::VPBlockBase
 VPBlockBase (const unsigned char SC, const std::string &N)
 

Detailed Description

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 1624 of file VPlan.h.

Member Typedef Documentation

◆ const_iterator

Definition at line 1646 of file VPlan.h.

◆ const_reverse_iterator

Definition at line 1648 of file VPlan.h.

◆ iterator

using llvm::VPBasicBlock::iterator = RecipeListTy::iterator

Instruction iterators...

Definition at line 1645 of file VPlan.h.

◆ RecipeListTy

Definition at line 1626 of file VPlan.h.

◆ reverse_iterator

Definition at line 1647 of file VPlan.h.

Constructor & Destructor Documentation

◆ VPBasicBlock()

llvm::VPBasicBlock::VPBasicBlock ( const Twine Name = "",
VPRecipeBase Recipe = nullptr 
)
inline

Definition at line 1633 of file VPlan.h.

References appendRecipe().

Referenced by splitAt().

◆ ~VPBasicBlock()

llvm::VPBasicBlock::~VPBasicBlock ( )
inlineoverride

Member Function Documentation

◆ appendRecipe()

void llvm::VPBasicBlock::appendRecipe ( VPRecipeBase Recipe)
inline

Augment the existing recipes of a VPBasicBlock with an additional Recipe as the last recipe.

Definition at line 1692 of file VPlan.h.

References end(), and insert().

Referenced by llvm::VPRecipeBuilder::handleReplication(), and VPBasicBlock().

◆ back() [1/2]

VPRecipeBase& llvm::VPBasicBlock::back ( )
inline

Definition at line 1668 of file VPlan.h.

◆ back() [2/2]

const VPRecipeBase& llvm::VPBasicBlock::back ( ) const
inline

Definition at line 1667 of file VPlan.h.

◆ begin() [1/2]

iterator llvm::VPBasicBlock::begin ( )
inline

Recipe iterator methods.

Definition at line 1653 of file VPlan.h.

Referenced by getFirstNonPhi(), phis(), and splitAt().

◆ begin() [2/2]

const_iterator llvm::VPBasicBlock::begin ( ) const
inline

Definition at line 1654 of file VPlan.h.

◆ classof()

static bool llvm::VPBasicBlock::classof ( const VPBlockBase V)
inlinestatic

Method to support type inquiry through isa, cast, and dyn_cast.

Definition at line 1679 of file VPlan.h.

References llvm::VPBlockBase::getVPBlockID().

◆ dropAllReferences()

void VPBasicBlock::dropAllReferences ( VPValue NewValue)
overridevirtual

Replace all operands of VPUsers in the block with NewValue and also replaces all uses of VPValues defined in the block with NewValue.

Implements llvm::VPBlockBase.

Definition at line 363 of file VPlan.cpp.

References llvm::tgtok::Def, E, and I.

◆ empty()

bool llvm::VPBasicBlock::empty ( ) const
inline

Definition at line 1664 of file VPlan.h.

Referenced by execute().

◆ end() [1/2]

iterator llvm::VPBasicBlock::end ( )
inline

Definition at line 1655 of file VPlan.h.

Referenced by appendRecipe(), getFirstNonPhi(), and splitAt().

◆ end() [2/2]

const_iterator llvm::VPBasicBlock::end ( ) const
inline

Definition at line 1656 of file VPlan.h.

◆ execute()

void VPBasicBlock::execute ( struct VPTransformState State)
overridevirtual

◆ front() [1/2]

VPRecipeBase& llvm::VPBasicBlock::front ( )
inline

Definition at line 1666 of file VPlan.h.

◆ front() [2/2]

const VPRecipeBase& llvm::VPBasicBlock::front ( ) const
inline

Definition at line 1665 of file VPlan.h.

◆ getFirstNonPhi()

VPBasicBlock::iterator VPBasicBlock::getFirstNonPhi ( )

Return the position of the first non-phi node recipe in the block.

Definition at line 220 of file VPlan.cpp.

References begin(), and end().

Referenced by llvm::VPlanTransforms::mergeReplicateRegions(), phis(), and llvm::VPlanTransforms::sinkScalarOperands().

◆ getRecipeList()

RecipeListTy& llvm::VPBasicBlock::getRecipeList ( )
inline

◆ getSublistAccess()

static RecipeListTy VPBasicBlock::* llvm::VPBasicBlock::getSublistAccess ( VPRecipeBase )
inlinestatic

Returns a pointer to a member of the recipe list.

Definition at line 1674 of file VPlan.h.

◆ insert()

void llvm::VPBasicBlock::insert ( VPRecipeBase Recipe,
iterator  InsertPt 
)
inline

Definition at line 1683 of file VPlan.h.

References assert(), and llvm::iplist_impl< IntrusiveListT, TraitsT >::insert().

Referenced by appendRecipe().

◆ phis()

iterator_range<iterator> llvm::VPBasicBlock::phis ( )
inline

Returns an iterator range over the PHI-like recipes in the block.

Definition at line 1702 of file VPlan.h.

References begin(), getFirstNonPhi(), and llvm::make_range().

Referenced by llvm::VPlan::execute(), and llvm::InnerLoopVectorizer::fixCrossIterationPHIs().

◆ print() [1/3]

void llvm::VPBlockBase::print
inline

Print plain-text dump of this VPlan to O.

Definition at line 645 of file VPlan.h.

◆ print() [2/3]

void VPBasicBlock::print ( raw_ostream O,
const Twine Indent,
VPSlotTracker SlotTracker 
) const
overridevirtual

Print this VPBsicBlock to O, prefixing all lines with Indent.

SlotTracker is used to print unnamed VPValue's using consequtive numbers.

Note that the numbering is applied to the whole VPlan, so printing individual blocks is consistent with the whole VPlan printing.

Implements llvm::VPBlockBase.

Definition at line 412 of file VPlan.cpp.

References llvm::VPBlockBase::getCondBit(), llvm::VPBlockBase::getName(), llvm::VPBlockBase::getPredicate(), llvm::RISCVFenceField::O, llvm::VPDef::print(), and llvm::VPBlockBase::printSuccessors().

◆ print() [3/3]

virtual void llvm::VPBlockBase::print

Print plain-text dump of this VPBlockBase to O, prefixing all lines with Indent.

SlotTracker is used to print unnamed VPValue's using consequtive numbers.

Note that the numbering is applied to the whole VPlan, so printing individual blocks is consistent with the whole VPlan printing.

◆ rbegin() [1/2]

reverse_iterator llvm::VPBasicBlock::rbegin ( )
inline

Definition at line 1658 of file VPlan.h.

◆ rbegin() [2/2]

const_reverse_iterator llvm::VPBasicBlock::rbegin ( ) const
inline

Definition at line 1659 of file VPlan.h.

◆ rend() [1/2]

reverse_iterator llvm::VPBasicBlock::rend ( )
inline

Definition at line 1660 of file VPlan.h.

◆ rend() [2/2]

const_reverse_iterator llvm::VPBasicBlock::rend ( ) const
inline

Definition at line 1661 of file VPlan.h.

◆ size()

size_t llvm::VPBasicBlock::size ( ) const
inline

Definition at line 1663 of file VPlan.h.

◆ splitAt()

VPBasicBlock * 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.

Returns the new block.

Definition at line 373 of file VPlan.cpp.

References assert(), begin(), llvm::VPBlockUtils::connectBlocks(), llvm::VPBlockUtils::disconnectBlocks(), llvm::BasicBlock::end(), end(), llvm::VPBlockBase::getName(), llvm::VPBlockBase::getSuccessors(), llvm::VPBlockUtils::insertBlockAfter(), llvm::make_early_inc_range(), llvm::make_range(), llvm::SplitBlock(), and VPBasicBlock().


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