LLVM  6.0.0svn
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | 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
 
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
 
VPBlockBasegetEnclosingBlockWithSuccessors ()
 An Enclosing Block of a block B is any block containing B, including B itself. More...
 
VPBlockBasegetEnclosingBlockWithPredecessors ()
 
const VPBlocksTygetHierarchicalSuccessors ()
 
VPBlockBasegetSingleHierarchicalSuccessor ()
 
const VPBlocksTygetHierarchicalPredecessors ()
 
VPBlockBasegetSingleHierarchicalPredecessor ()
 
VPBlockBasesetOneSuccessor (VPBlockBase *Successor)
 Sets a given VPBlockBase Successor as the single successor and. More...
 
void setTwoSuccessors (VPBlockBase *IfTrue, VPBlockBase *IfFalse)
 Sets two given VPBlockBases IfTrue and IfFalse to be the two successors. More...
 
void disconnectSuccessor (VPBlockBase *Successor)
 
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)
 

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

Member Typedef Documentation

◆ VPBlocksTy

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

Constructor & Destructor Documentation

◆ VPBlockBase()

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

Definition at line 300 of file VPlan.h.

◆ ~VPBlockBase()

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

Member Function Documentation

◆ deleteCFG()

void VPBlockBase::deleteCFG ( VPBlockBase Entry)
static

◆ disconnectSuccessor()

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

Definition at line 424 of file VPlan.h.

References assert().

Referenced by llvm::InnerLoopVectorizer::createBlockInMask().

◆ 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.

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

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

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

◆ getEntryBasicBlock() [2/2]

VPBasicBlock * VPBlockBase::getEntryBasicBlock ( )

Definition at line 57 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 65 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 72 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 390 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 374 of file VPlan.h.

References getSuccessors().

◆ getName()

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

Definition at line 314 of file VPlan.h.

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

◆ getParent()

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

Definition at line 323 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 343 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 396 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 380 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 353 of file VPlan.h.

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

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

Referenced by llvm::InnerLoopVectorizer::createBlockInMask(), and getSingleHierarchicalSuccessor().

◆ getSuccessors() [1/2]

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

◆ getSuccessors() [2/2]

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

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

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

◆ setName()

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

Definition at line 316 of file VPlan.h.

References llvm::Twine::str().

Referenced by llvm::InnerLoopVectorizer::createBlockInMask().

◆ setOneSuccessor()

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

Sets a given VPBlockBase Successor as the single successor and.

Returns
Successor. The parent of this Block is copied to be the parent of Successor.

Definition at line 403 of file VPlan.h.

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

Referenced by llvm::InnerLoopVectorizer::createBlockInMask().

◆ setParent()

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

Definition at line 325 of file VPlan.h.

References P.

Referenced by llvm::VPRegionBlock::VPRegionBlock().

◆ setTwoSuccessors()

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

Sets two given VPBlockBases IfTrue and IfFalse to be the two successors.

The parent of this Block is copied to be the parent of both IfTrue and IfFalse.

Definition at line 414 of file VPlan.h.

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


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