LLVM  14.0.0git
Public Member Functions | Static Public Member Functions | List of all members
llvm::VPRegionBlock Class Reference

VPRegionBlock represents a collection of VPBasicBlocks and VPRegionBlocks which form a Single-Entry-Single-Exit subgraph of the output IR CFG. More...

#include "Transforms/Vectorize/VPlan.h"

Inheritance diagram for llvm::VPRegionBlock:
Inheritance graph
[legend]
Collaboration diagram for llvm::VPRegionBlock:
Collaboration graph
[legend]

Public Member Functions

 VPRegionBlock (VPBlockBase *Entry, VPBlockBase *Exit, const std::string &Name="", bool IsReplicator=false)
 
 VPRegionBlock (const std::string &Name="", bool IsReplicator=false)
 
 ~VPRegionBlock () override
 
const VPBlockBasegetEntry () const
 
VPBlockBasegetEntry ()
 
void setEntry (VPBlockBase *EntryBlock)
 Set EntryBlock as the entry VPBlockBase of this VPRegionBlock. More...
 
VPBlockBasefront () const
 
const VPBlockBasegetExit () const
 
VPBlockBasegetExit ()
 
void setExit (VPBlockBase *ExitBlock)
 Set ExitBlock as the exit VPBlockBase of this VPRegionBlock. More...
 
bool isReplicator () const
 An indicator whether this region is to generate multiple replicated instances of output IR corresponding to its VPBlockBases. More...
 
void execute (struct VPTransformState *State) override
 The method which generates the output IR instructions that correspond to this VPRegionBlock, thereby "executing" the VPlan. More...
 
void dropAllReferences (VPValue *NewValue) override
 Replace all operands of VPUsers in the block with NewValue and also replaces all uses of VPValues defined in the block with NewValue. More...
 
void print (raw_ostream &O, const Twine &Indent, VPSlotTracker &SlotTracker) const override
 Print this VPRegionBlock to O (recursively), prefixing all lines with Indent. More...
 
virtual void print (raw_ostream &O, const Twine &Indent, VPSlotTracker &SlotTracker) const=0
 Print plain-text dump of this VPBlockBase to O, prefixing all lines with Indent. More...
 
void print (raw_ostream &O) const
 Print plain-text dump of this VPlan to O. More...
 
- Public Member Functions inherited from llvm::VPBlockBase
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)
 Set the condition bit selecting the successor. More...
 
VPValuegetPredicate ()
 
const VPValuegetPredicate () const
 
void setPredicate (VPValue *Pred)
 Set the block's predicate. More...
 
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...
 
bool isLegalToHoistInto ()
 Return true if it is legal to hoist instructions into this block. More...
 
void printAsOperand (raw_ostream &OS, bool PrintType) const
 
void print (raw_ostream &O) const
 Print plain-text dump of this VPlan to O. More...
 
void printSuccessors (raw_ostream &O, const Twine &Indent) const
 Print the successors of this block to O, prefixing all lines with Indent. More...
 
LLVM_DUMP_METHOD void dump () const
 Dump this VPBlockBase to dbgs(). More...
 

Static Public Member Functions

static bool classof (const VPBlockBase *V)
 Method to support type inquiry through isa, cast, and dyn_cast. More...
 
- Static Public Member Functions inherited from llvm::VPBlockBase
static void deleteCFG (VPBlockBase *Entry)
 Delete all blocks reachable from a given VPBlockBase, inclusive. More...
 

Additional Inherited Members

- Public Types inherited from llvm::VPBlockBase
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 * >
 
- Protected Member Functions inherited from llvm::VPBlockBase
 VPBlockBase (const unsigned char SC, const std::string &N)
 

Detailed Description

VPRegionBlock represents a collection of VPBasicBlocks and VPRegionBlocks which form a Single-Entry-Single-Exit subgraph of the output IR CFG.

A VPRegionBlock may indicate that its contents are to be replicated several times. This is designed to support predicated scalarization, in which a scalar if-then code structure needs to be generated VF * UF times. Having this replication indicator helps to keep a single model for multiple candidate VF's. The actual replication takes place only once the desired VF and UF have been determined.

Definition at line 1720 of file VPlan.h.

Constructor & Destructor Documentation

◆ VPRegionBlock() [1/2]

llvm::VPRegionBlock::VPRegionBlock ( VPBlockBase Entry,
VPBlockBase Exit,
const std::string &  Name = "",
bool  IsReplicator = false 
)
inline

◆ VPRegionBlock() [2/2]

llvm::VPRegionBlock::VPRegionBlock ( const std::string &  Name = "",
bool  IsReplicator = false 
)
inline

Definition at line 1741 of file VPlan.h.

◆ ~VPRegionBlock()

llvm::VPRegionBlock::~VPRegionBlock ( )
inlineoverride

Definition at line 1745 of file VPlan.h.

References llvm::VPBlockBase::deleteCFG().

Member Function Documentation

◆ classof()

static bool llvm::VPRegionBlock::classof ( const VPBlockBase V)
inlinestatic

Method to support type inquiry through isa, cast, and dyn_cast.

Definition at line 1754 of file VPlan.h.

References llvm::VPBlockBase::getVPBlockID().

◆ dropAllReferences()

void VPRegionBlock::dropAllReferences ( VPValue NewValue)
overridevirtual

Replace all operands of VPUsers in the block with NewValue and also replaces all uses of VPValues defined in the block with NewValue.

Implements llvm::VPBlockBase.

Definition at line 441 of file VPlan.cpp.

References llvm::depth_first().

◆ execute()

void VPRegionBlock::execute ( struct VPTransformState State)
overridevirtual

◆ front()

VPBlockBase& llvm::VPRegionBlock::front ( ) const
inline

Definition at line 1774 of file VPlan.h.

◆ getEntry() [1/2]

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

Definition at line 1759 of file VPlan.h.

◆ getEntry() [2/2]

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

Definition at line 1758 of file VPlan.h.

Referenced by llvm::VPBlockBase::getEnclosingBlockWithPredecessors().

◆ getExit() [1/2]

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

Definition at line 1777 of file VPlan.h.

◆ getExit() [2/2]

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

Definition at line 1776 of file VPlan.h.

Referenced by llvm::VPBlockBase::getEnclosingBlockWithSuccessors().

◆ isReplicator()

bool llvm::VPRegionBlock::isReplicator ( ) const
inline

An indicator whether this region is to generate multiple replicated instances of output IR corresponding to its VPBlockBases.

Definition at line 1790 of file VPlan.h.

Referenced by execute(), and print().

◆ print() [1/3]

void llvm::VPBlockBase::print
inline

Print plain-text dump of this VPlan to O.

Definition at line 645 of file VPlan.h.

◆ print() [2/3]

void VPRegionBlock::print ( raw_ostream O,
const Twine Indent,
VPSlotTracker SlotTracker 
) const
overridevirtual

Print this VPRegionBlock to O (recursively), prefixing all lines with Indent.

SlotTracker is used to print unnamed VPValue's using consequtive numbers.

Note that the numbering is applied to the whole VPlan, so printing individual regions is consistent with the whole VPlan printing.

Implements llvm::VPBlockBase.

Definition at line 498 of file VPlan.cpp.

References llvm::depth_first(), llvm::VPBlockBase::getName(), isReplicator(), llvm::RISCVFenceField::O, and llvm::VPBlockBase::printSuccessors().

◆ print() [3/3]

virtual void llvm::VPBlockBase::print

Print plain-text dump of this VPBlockBase to O, prefixing all lines with Indent.

SlotTracker is used to print unnamed VPValue's using consequtive numbers.

Note that the numbering is applied to the whole VPlan, so printing individual blocks is consistent with the whole VPlan printing.

◆ setEntry()

void llvm::VPRegionBlock::setEntry ( VPBlockBase EntryBlock)
inline

Set EntryBlock as the entry VPBlockBase of this VPRegionBlock.

EntryBlock must have no predecessors.

Definition at line 1763 of file VPlan.h.

References assert(), llvm::VPBlockBase::getPredecessors(), and llvm::VPBlockBase::setParent().

◆ setExit()

void llvm::VPRegionBlock::setExit ( VPBlockBase ExitBlock)
inline

Set ExitBlock as the exit VPBlockBase of this VPRegionBlock.

ExitBlock must have no successors.

Definition at line 1781 of file VPlan.h.

References assert(), llvm::VPBlockBase::getSuccessors(), and llvm::VPBlockBase::setParent().


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