LLVM  7.0.0
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:
[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
 
VPRegionBlock * getParent ()
 
const VPRegionBlock * getParent () const
 
void setParent (VPRegionBlock *P)
 
const VPBasicBlock * getEntryBasicBlock () const
 
VPBasicBlock * getEntryBasicBlock ()
 
const VPBasicBlock * getExitBasicBlock () const
 
VPBasicBlock * getExitBasicBlock ()
 
const VPBlocksTy & getSuccessors () const
 
VPBlocksTy & getSuccessors ()
 
const VPBlocksTy & getPredecessors () const
 
VPBlocksTy & getPredecessors ()
 
VPBlockBase * getSingleSuccessor () const
 
VPBlockBase * getSinglePredecessor () const
 
size_t getNumSuccessors () const
 
size_t getNumPredecessors () const
 
VPBlockBase * getEnclosingBlockWithSuccessors ()
 An Enclosing Block of a block B is any block containing B, including B itself. More...
 
VPBlockBase * getEnclosingBlockWithPredecessors ()
 
const VPBlocksTy & getHierarchicalSuccessors ()
 
VPBlockBase * getSingleHierarchicalSuccessor ()
 
const VPBlocksTy & getHierarchicalPredecessors ()
 
VPBlockBase * getSingleHierarchicalPredecessor ()
 
VPValue * getCondBit ()
 
const VPValue * getCondBit () 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...
 
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 324 of file VPlan.h.

Member Typedef Documentation

◆ VPBlocksTy

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

Constructor & Destructor Documentation

◆ VPBlockBase()

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

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

◆ getCondBit() [2/2]

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

Definition at line 480 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 96 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 88 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 59 of file VPlan.cpp.

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

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

◆ getEntryBasicBlock() [2/2]

VPBasicBlock * VPBlockBase::getEntryBasicBlock ( )

Definition at line 66 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 74 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 81 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 467 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 451 of file VPlan.h.

References getSuccessors().

◆ getName()

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

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

References llvm::SmallVectorBase::size().

Referenced by verifyRegion().

◆ getNumSuccessors()

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

Definition at line 431 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 397 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 417 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 473 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 457 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 427 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 421 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 414 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 394 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 532 of file VPlan.h.

◆ print()

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

Definition at line 525 of file VPlan.h.

Referenced by llvm::VPInstruction::print().

◆ printAsOperand()

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

Definition at line 521 of file VPlan.h.

References getName().

Referenced by llvm::VPInstruction::print().

◆ setCondBit()

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

Definition at line 482 of file VPlan.h.

◆ setName()

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

Definition at line 389 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 487 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 508 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 496 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 325 of file VPlan.h.


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