LLVM  11.0.0git
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Friends | List of all members
llvm::VPBlockBase Class Referenceabstract

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

#include "Transforms/Vectorize/VPlan.h"

Inheritance diagram for llvm::VPBlockBase:
Inheritance graph
[legend]

Public Types

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

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)
 
VPValuegetPredicate ()
 
const VPValuegetPredicate () const
 
void setPredicate (VPValue *Pred)
 
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...
 
virtual void execute (struct VPTransformState *State)=0
 The method which generates the output IR that correspond to this VPBlockBase, thereby "executing" the VPlan. More...
 
void printAsOperand (raw_ostream &OS, bool PrintType) const
 
void print (raw_ostream &OS) const
 
bool isLegalToHoistInto ()
 Return true if it is legal to hoist instructions into this block. More...
 

Static Public Member Functions

static void deleteCFG (VPBlockBase *Entry)
 Delete all blocks reachable from a given VPBlockBase, inclusive. More...
 

Protected Member Functions

 VPBlockBase (const unsigned char SC, const std::string &N)
 

Friends

class VPBlockUtils
 

Detailed Description

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

A VPBlockBase can be either a VPBasicBlock or a VPRegionBlock.

Definition at line 355 of file VPlan.h.

Member Typedef Documentation

◆ VPBlocksTy

Definition at line 420 of file VPlan.h.

◆ VPBlockTy

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

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

Constructor & Destructor Documentation

◆ VPBlockBase()

llvm::VPBlockBase::VPBlockBase ( const unsigned char  SC,
const std::string &  N 
)
inlineprotected

Definition at line 410 of file VPlan.h.

◆ ~VPBlockBase()

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

Member Function Documentation

◆ clearPredecessors()

void llvm::VPBlockBase::clearPredecessors ( )
inline

Remove all the predecessor of this block.

Definition at line 566 of file VPlan.h.

References llvm::SmallVectorImpl< T >::clear().

◆ clearSuccessors()

void llvm::VPBlockBase::clearSuccessors ( )
inline

Remove all the successors of this block and set to null its condition bit.

Definition at line 569 of file VPlan.h.

References llvm::SmallVectorImpl< T >::clear().

◆ deleteCFG()

void VPBlockBase::deleteCFG ( VPBlockBase Entry)
static

Delete all blocks reachable from a given VPBlockBase, inclusive.

Definition at line 144 of file VPlan.cpp.

Referenced by llvm::VPlan::~VPlan().

◆ execute()

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

The method which generates the output IR that correspond to this VPBlockBase, thereby "executing" the VPlan.

Implemented in llvm::VPRegionBlock, and llvm::VPBasicBlock.

◆ getCondBit() [1/2]

VPValue* llvm::VPBlockBase::getCondBit ( )
inline
Returns
the condition bit selecting the successor.

Definition at line 523 of file VPlan.h.

Referenced by llvm::VPlanTransforms::VPInstructionsToVPRecipes().

◆ getCondBit() [2/2]

const VPValue* llvm::VPBlockBase::getCondBit ( ) const
inline

Definition at line 525 of file VPlan.h.

◆ getEnclosingBlockWithPredecessors()

VPBlockBase * VPBlockBase::getEnclosingBlockWithPredecessors ( )
Returns
the closest enclosing block starting from "this", which has predecessors.
the root enclosing block if all enclosing blocks have no predecessors.

Definition at line 136 of file VPlan.cpp.

References assert().

◆ getEnclosingBlockWithSuccessors()

VPBlockBase * VPBlockBase::getEnclosingBlockWithSuccessors ( )

An Enclosing Block of a block B is any block containing B, including B itself.

Returns
the closest enclosing block starting from "this", which has successors.
the root enclosing block if all enclosing blocks have no successors.

Definition at line 128 of file VPlan.cpp.

References assert().

◆ getEntryBasicBlock() [1/2]

const VPBasicBlock * VPBlockBase::getEntryBasicBlock ( ) const
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 93 of file VPlan.cpp.

References llvm::RegionBase< Tr >::getEntry().

Referenced by llvm::VPlan::dump().

◆ getEntryBasicBlock() [2/2]

VPBasicBlock * VPBlockBase::getEntryBasicBlock ( )

Definition at line 100 of file VPlan.cpp.

References llvm::RegionBase< Tr >::getEntry().

◆ getExitBasicBlock() [1/2]

const VPBasicBlock * VPBlockBase::getExitBasicBlock ( ) const
Returns
the VPBasicBlock that is the exit 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 exit of Block, possibly indirectly.

Definition at line 114 of file VPlan.cpp.

References llvm::RegionBase< Tr >::getExit().

Referenced by llvm::VPlan::dump(), and llvm::VPBasicBlock::execute().

◆ getExitBasicBlock() [2/2]

VPBasicBlock * VPBlockBase::getExitBasicBlock ( )

Definition at line 121 of file VPlan.cpp.

References llvm::RegionBase< Tr >::getExit().

◆ getHierarchicalPredecessors()

const VPBlocksTy& llvm::VPBlockBase::getHierarchicalPredecessors ( )
inline
Returns
the predecessors either attached directly to this VPBlockBase or, if this VPBlockBase is the entry block of a VPRegionBlock and has no predecessors of its own, search recursively for the first enclosing VPRegionBlock that has predecessors and return them. If no such VPRegionBlock exists, return the (empty) predecessors of the topmost VPBlockBase reached.

Definition at line 512 of file VPlan.h.

References getPredecessors().

◆ getHierarchicalSuccessors()

const VPBlocksTy& llvm::VPBlockBase::getHierarchicalSuccessors ( )
inline
Returns
the successors either attached directly to this VPBlockBase or, if this VPBlockBase is the exit block of a VPRegionBlock and has no successors of its own, search recursively for the first enclosing VPRegionBlock that has successors and return them. If no such VPRegionBlock exists, return the (empty) successors of the topmost VPBlockBase reached.

Definition at line 496 of file VPlan.h.

References getSuccessors().

◆ getName()

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

Definition at line 424 of file VPlan.h.

References Name.

Referenced by llvm::VPlan::dump().

◆ getNumPredecessors()

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

◆ getNumSuccessors()

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

◆ getParent() [1/2]

VPRegionBlock* llvm::VPBlockBase::getParent ( )
inline

◆ getParent() [2/2]

const VPRegionBlock* llvm::VPBlockBase::getParent ( ) const
inline

Definition at line 434 of file VPlan.h.

◆ getPlan() [1/2]

VPlan * VPBlockBase::getPlan ( )
Returns
A pointer to the plan containing the current block.

Definition at line 88 of file VPlan.cpp.

References getPlanEntry().

Referenced by llvm::operator<<().

◆ getPlan() [2/2]

const VPlan * VPBlockBase::getPlan ( ) const

Definition at line 90 of file VPlan.cpp.

References getPlanEntry().

◆ getPredecessors() [1/2]

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

◆ getPredecessors() [2/2]

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

Definition at line 462 of file VPlan.h.

◆ getPredicate() [1/2]

VPValue* llvm::VPBlockBase::getPredicate ( )
inline

Definition at line 529 of file VPlan.h.

Referenced by llvm::VPlan::dump().

◆ getPredicate() [2/2]

const VPValue* llvm::VPBlockBase::getPredicate ( ) const
inline

Definition at line 531 of file VPlan.h.

◆ getSingleHierarchicalPredecessor()

VPBlockBase* llvm::VPBlockBase::getSingleHierarchicalPredecessor ( )
inline
Returns
the hierarchical predecessor of this VPBlockBase if it has a single hierarchical predecessor. Otherwise return a null pointer.

Definition at line 518 of file VPlan.h.

References getSinglePredecessor().

◆ getSingleHierarchicalSuccessor()

VPBlockBase* llvm::VPBlockBase::getSingleHierarchicalSuccessor ( )
inline
Returns
the hierarchical successor of this VPBlockBase if it has a single hierarchical successor. Otherwise return a null pointer.

Definition at line 502 of file VPlan.h.

References getSingleSuccessor().

Referenced by llvm::VPBasicBlock::execute().

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

References llvm::SmallVectorTemplateCommon< T >::begin(), and llvm::SmallVectorBase< SmallVectorSizeType< T > >::size().

Referenced by getSingleHierarchicalPredecessor().

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

References llvm::SmallVectorTemplateCommon< T >::begin(), and llvm::SmallVectorBase< SmallVectorSizeType< T > >::size().

Referenced by getSingleHierarchicalSuccessor().

◆ getSuccessors() [1/2]

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

◆ getSuccessors() [2/2]

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

Definition at line 459 of file VPlan.h.

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

Referenced by llvm::VPBasicBlock::classof(), and llvm::VPRegionBlock::classof().

◆ isLegalToHoistInto()

bool llvm::VPBlockBase::isLegalToHoistInto ( )
inline

Return true if it is legal to hoist instructions into this block.

Definition at line 592 of file VPlan.h.

◆ print()

void llvm::VPBlockBase::print ( raw_ostream OS) const
inline

Definition at line 585 of file VPlan.h.

◆ printAsOperand()

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

Definition at line 581 of file VPlan.h.

References getName().

◆ setCondBit()

void llvm::VPBlockBase::setCondBit ( VPValue CV)
inline

Definition at line 527 of file VPlan.h.

Referenced by llvm::VPlanTransforms::VPInstructionsToVPRecipes().

◆ setName()

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

Definition at line 426 of file VPlan.h.

References llvm::Twine::str().

◆ setOneSuccessor()

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

Set a given VPBlockBase Successor as the single successor of this VPBlockBase.

This VPBlockBase is not added as predecessor of Successor. This VPBlockBase must have no successors.

Definition at line 538 of file VPlan.h.

References assert(), and llvm::SmallVectorBase< SmallVectorSizeType< T > >::empty().

Referenced by llvm::VPBlockUtils::insertBlockAfter().

◆ setParent()

void llvm::VPBlockBase::setParent ( VPRegionBlock P)
inline

◆ setPlan()

void VPBlockBase::setPlan ( VPlan ParentPlan)

Sets the pointer of the plan containing the block.

The block must be the entry block into the VPlan.

Definition at line 107 of file VPlan.cpp.

References assert(), and llvm::VPlan::getEntry().

Referenced by llvm::VPlan::setEntry(), and llvm::VPlan::VPlan().

◆ setPredecessors()

void llvm::VPBlockBase::setPredecessors ( ArrayRef< VPBlockBase *>  NewPreds)
inline

Set each VPBasicBlock in NewPreds as predecessor of this VPBlockBase.

This VPBlockBase must have no predecessors. This VPBlockBase is not added as successor of any VPBasicBlock in NewPreds.

Definition at line 559 of file VPlan.h.

References assert(), and llvm::SmallVectorBase< SmallVectorSizeType< T > >::empty().

Referenced by llvm::VPBlockUtils::insertBlockAfter(), and llvm::VPBlockUtils::insertTwoBlocksAfter().

◆ setPredicate()

void llvm::VPBlockBase::setPredicate ( VPValue Pred)
inline

Definition at line 533 of file VPlan.h.

◆ setTwoSuccessors()

void llvm::VPBlockBase::setTwoSuccessors ( VPBlockBase IfTrue,
VPBlockBase IfFalse,
VPValue Condition 
)
inline

Set two given VPBlockBases IfTrue and IfFalse to be the two successors of this VPBlockBase.

Condition is set as the successor selector. This VPBlockBase is not added as predecessor of IfTrue or IfFalse. This VPBlockBase must have no successors.

Definition at line 547 of file VPlan.h.

References assert(), and llvm::SmallVectorBase< SmallVectorSizeType< T > >::empty().

Referenced by llvm::VPBlockUtils::insertTwoBlocksAfter().

Friends And Related Function Documentation

◆ VPBlockUtils

friend class VPBlockUtils
friend

Definition at line 356 of file VPlan.h.


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