LLVM  7.0.0svn
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
 
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)
 
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...
 
virtual void execute (struct VPTransformState *State)=0
 The method which generates the output IR that correspond to this VPBlockBase, thereby "executing" the VPlan. 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 323 of file VPlan.h.

Member Typedef Documentation

◆ VPBlocksTy

Definition at line 382 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 380 of file VPlan.h.

Constructor & Destructor Documentation

◆ VPBlockBase()

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

Definition at line 372 of file VPlan.h.

◆ ~VPBlockBase()

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

Member Function Documentation

◆ deleteCFG()

void VPBlockBase::deleteCFG ( VPBlockBase Entry)
static

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

◆ getCondBit() [2/2]

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

Definition at line 479 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 95 of file VPlan.cpp.

References assert(), getEnclosingBlockWithPredecessors(), and llvm::VPRegionBlock::getEntry().

Referenced by getEnclosingBlockWithPredecessors().

◆ 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 87 of file VPlan.cpp.

References assert(), getEnclosingBlockWithSuccessors(), and llvm::VPRegionBlock::getExit().

Referenced by getEnclosingBlockWithSuccessors().

◆ 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 58 of file VPlan.cpp.

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

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

◆ getEntryBasicBlock() [2/2]

VPBasicBlock * VPBlockBase::getEntryBasicBlock ( )

Definition at line 65 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 73 of file VPlan.cpp.

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

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

◆ getExitBasicBlock() [2/2]

VPBasicBlock * VPBlockBase::getExitBasicBlock ( )

Definition at line 80 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 466 of file VPlan.h.

References getPredecessors().

Referenced by deleteCFG().

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

References getSuccessors().

◆ getName()

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

Definition at line 386 of file VPlan.h.

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

◆ getNumPredecessors()

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

Definition at line 431 of file VPlan.h.

References llvm::SmallVectorBase::size().

Referenced by verifyRegion().

◆ getNumSuccessors()

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

Definition at line 430 of file VPlan.h.

References llvm::SmallVectorBase::size().

Referenced by llvm::VPBlockUtils::connectBlocks(), and verifyRegion().

◆ getParent() [1/2]

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

◆ getParent() [2/2]

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

Definition at line 396 of file VPlan.h.

◆ getPredecessors() [1/2]

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

◆ getPredecessors() [2/2]

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

Definition at line 416 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 472 of file VPlan.h.

References getSinglePredecessor().

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

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

References llvm::SmallVectorTemplateCommon< T >::begin(), and llvm::SmallVectorBase::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 420 of file VPlan.h.

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

Referenced by getSingleHierarchicalSuccessor(), and llvm::VPRecipeBuilder::tryToCreateRecipe().

◆ getSuccessors() [1/2]

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

◆ getSuccessors() [2/2]

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

Definition at line 413 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 393 of file VPlan.h.

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

◆ setCondBit()

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

Definition at line 481 of file VPlan.h.

◆ setName()

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

Definition at line 388 of file VPlan.h.

References llvm::Twine::str().

Referenced by llvm::VPRecipeBuilder::tryToCreateRecipe().

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

References assert(), and llvm::SmallVectorBase::empty().

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

◆ setParent()

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

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

References assert(), and llvm::SmallVectorBase::empty().

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

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

References assert(), and llvm::SmallVectorBase::empty().

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

Friends And Related Function Documentation

◆ VPBlockUtils

friend class VPBlockUtils
friend

Definition at line 324 of file VPlan.h.


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