LLVM  8.0.1
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...
 
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 334 of file VPlan.h.

Member Typedef Documentation

◆ VPBlocksTy

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

Constructor & Destructor Documentation

◆ VPBlockBase()

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

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

Referenced by llvm::VPBasicBlock::execute(), and llvm::VPlanHCFGTransforms::VPInstructionsToVPRecipes().

◆ getCondBit() [2/2]

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

Definition at line 490 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 97 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 89 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 60 of file VPlan.cpp.

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

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

◆ getEntryBasicBlock() [2/2]

VPBasicBlock * VPBlockBase::getEntryBasicBlock ( )

Definition at line 67 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 75 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 82 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 477 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 461 of file VPlan.h.

References getSuccessors().

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

◆ getName()

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

Definition at line 397 of file VPlan.h.

References Name.

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

◆ getNumPredecessors()

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

Definition at line 442 of file VPlan.h.

References llvm::SmallVectorBase::size().

Referenced by verifyRegion().

◆ getNumSuccessors()

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

Definition at line 441 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 407 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 427 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 483 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 467 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 437 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 431 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 424 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 404 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 542 of file VPlan.h.

◆ print()

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

Definition at line 535 of file VPlan.h.

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

◆ printAsOperand()

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

Definition at line 531 of file VPlan.h.

References getName().

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

◆ setCondBit()

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

Definition at line 492 of file VPlan.h.

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

◆ setName()

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

Definition at line 399 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 497 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 518 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 506 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 335 of file VPlan.h.


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