LLVM 22.0.0git
llvm::VPRegionBlock Class Reference

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

#include "Transforms/Vectorize/VPlan.h"

Inheritance diagram for llvm::VPRegionBlock:
[legend]

Public Member Functions

 ~VPRegionBlock () override
const VPBlockBasegetEntry () const
VPBlockBasegetEntry ()
void setEntry (VPBlockBase *EntryBlock)
 Set EntryBlock as the entry VPBlockBase of this VPRegionBlock.
const VPBlockBasegetExiting () const
VPBlockBasegetExiting ()
void setExiting (VPBlockBase *ExitingBlock)
 Set ExitingBlock as the exiting VPBlockBase of this VPRegionBlock.
VPBasicBlockgetPreheaderVPBB ()
 Returns the pre-header VPBasicBlock of the loop region.
bool isReplicator () const
 An indicator whether this region is to generate multiple replicated instances of output IR corresponding to its VPBlockBases.
void execute (VPTransformState *State) override
 The method which generates the output IR instructions that correspond to this VPRegionBlock, thereby "executing" the VPlan.
InstructionCost cost (ElementCount VF, VPCostContext &Ctx) override
 Return the cost of the block.
void print (raw_ostream &O, const Twine &Indent, VPSlotTracker &SlotTracker) const override
 Print this VPRegionBlock to O (recursively), prefixing all lines with Indent.
VPRegionBlockclone () override
 Clone all blocks in the single-entry single-exit region of the block and their recipes without updating the operands of the cloned recipes.
void dissolveToCFGLoop ()
 Remove the current region from its VPlan, connecting its predecessor to its entry, and its exiting block to its successor.
void print (raw_ostream &O) const
 Print plain-text dump of this VPlan to O.
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.
void setParent (VPRegionBlock *P)
const VPBasicBlockgetEntryBasicBlock () const
VPBasicBlockgetEntryBasicBlock ()
const VPBasicBlockgetExitingBasicBlock () const
VPBasicBlockgetExitingBasicBlock ()
const VPBlocksTygetSuccessors () const
VPBlocksTygetSuccessors ()
iterator_range< VPBlockBase ** > successors ()
iterator_range< VPBlockBase ** > predecessors ()
const VPBlocksTygetPredecessors () const
VPBlocksTygetPredecessors ()
VPBlockBasegetSingleSuccessor () const
VPBlockBasegetSinglePredecessor () const
size_t getNumSuccessors () const
size_t getNumPredecessors () const
bool hasPredecessors () const
 Returns true if this block has any predecessors.
VPBlockBasegetEnclosingBlockWithSuccessors ()
 An Enclosing Block of a block B is any block containing B, including B itself.
VPBlockBasegetEnclosingBlockWithPredecessors ()
const VPBlocksTygetHierarchicalSuccessors ()
VPBlockBasegetSingleHierarchicalSuccessor ()
const VPBlocksTygetHierarchicalPredecessors ()
VPBlockBasegetSingleHierarchicalPredecessor ()
void setOneSuccessor (VPBlockBase *Successor)
 Set a given VPBlockBase Successor as the single successor of this VPBlockBase.
void setTwoSuccessors (VPBlockBase *IfTrue, VPBlockBase *IfFalse)
 Set two given VPBlockBases IfTrue and IfFalse to be the two successors of this VPBlockBase.
void setPredecessors (ArrayRef< VPBlockBase * > NewPreds)
 Set each VPBasicBlock in NewPreds as predecessor of this VPBlockBase.
void setSuccessors (ArrayRef< VPBlockBase * > NewSuccs)
 Set each VPBasicBlock in NewSuccss as successor of this VPBlockBase.
void clearPredecessors ()
 Remove all the predecessor of this block.
void clearSuccessors ()
 Remove all the successors of this block.
void swapPredecessors ()
 Swap predecessors of the block.
void swapSuccessors ()
 Swap successors of the block. The block must have exactly 2 successors.
unsigned getIndexForPredecessor (const VPBlockBase *Pred) const
 Returns the index for Pred in the blocks predecessors list.
unsigned getIndexForSuccessor (const VPBlockBase *Succ) const
 Returns the index for Succ in the blocks successor list.
bool isLegalToHoistInto ()
 Return true if it is legal to hoist instructions into this block.
void printAsOperand (raw_ostream &OS, bool PrintType=false) const
void print (raw_ostream &O) const
 Print plain-text dump of this VPlan to O.
void printSuccessors (raw_ostream &O, const Twine &Indent) const
 Print the successors of this block to O, prefixing all lines with Indent.
LLVM_DUMP_METHOD void dump () const
 Dump this VPBlockBase to dbgs().

Static Public Member Functions

static bool classof (const VPBlockBase *V)
 Method to support type inquiry through isa, cast, and dyn_cast.

Friends

class VPlan

Additional Inherited Members

Public Types inherited from llvm::VPBlockBase
using VPBlockTy = enum { VPRegionBlockSC, VPBasicBlockSC, VPIRBasicBlockSC }
 An enumeration for keeping track of the concrete subclass of VPBlockBase that are actually instantiated.
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-Exiting 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 3942 of file VPlan.h.

Constructor & Destructor Documentation

◆ ~VPRegionBlock()

llvm::VPRegionBlock::~VPRegionBlock ( )
inlineoverride

Definition at line 3971 of file VPlan.h.

Member Function Documentation

◆ classof()

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

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

Definition at line 3974 of file VPlan.h.

References llvm::VPBlockBase::VPBlockBase().

◆ clone()

VPRegionBlock * VPRegionBlock::clone ( )
overridevirtual

Clone all blocks in the single-entry single-exit region of the block and their recipes without updating the operands of the cloned recipes.

Implements llvm::VPBlockBase.

Definition at line 785 of file VPlan.cpp.

References llvm::Block, cloneFrom(), llvm::VPlan::createVPRegionBlock(), getEntry(), llvm::VPBlockBase::getName(), llvm::VPBlockBase::getPlan(), isReplicator(), llvm::vp_depth_first_shallow(), and llvm::VPBlockBase::VPBlockBase().

◆ cost()

◆ dissolveToCFGLoop()

◆ execute()

void VPRegionBlock::execute ( VPTransformState * State)
overridevirtual

The method which generates the output IR instructions that correspond to this VPRegionBlock, thereby "executing" the VPlan.

Implements llvm::VPBlockBase.

Definition at line 794 of file VPlan.cpp.

References assert(), llvm::Block, llvm::dbgs(), llvm::VPLane::First, isReplicator(), LLVM_DEBUG, and llvm::VPBlockBase::VPBlockBase().

◆ getEntry() [1/2]

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

Definition at line 3979 of file VPlan.h.

References llvm::VPBlockBase::VPBlockBase().

◆ getEntry() [2/2]

◆ getExiting() [1/2]

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

Definition at line 3991 of file VPlan.h.

References llvm::VPBlockBase::VPBlockBase().

◆ getExiting() [2/2]

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

◆ getPreheaderVPBB()

VPBasicBlock * llvm::VPRegionBlock::getPreheaderVPBB ( )
inline

Returns the pre-header VPBasicBlock of the loop region.

Definition at line 4003 of file VPlan.h.

References assert(), llvm::VPBlockBase::getSinglePredecessor(), and isReplicator().

Referenced by transformRecipestoEVLRecipes().

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

Referenced by clone(), cost(), execute(), getPreheaderVPBB(), hasConditionalTerminator(), llvm::vputils::isSingleScalar(), and print().

◆ print() [1/2]

void VPBlockBase::print ( raw_ostream & O) const

Print plain-text dump of this VPlan to O.

Definition at line 370 of file VPlan.cpp.

◆ print() [2/2]

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

References llvm::VPBlockBase::getName(), isReplicator(), llvm::VPBlockBase::printSuccessors(), and llvm::vp_depth_first_shallow().

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

References assert(), llvm::SmallVectorTemplateCommon< T, typename >::empty(), llvm::VPBlockBase::getPredecessors(), llvm::VPBlockBase::setParent(), and llvm::VPBlockBase::VPBlockBase().

◆ setExiting()

void llvm::VPRegionBlock::setExiting ( VPBlockBase * ExitingBlock)
inline

Set ExitingBlock as the exiting VPBlockBase of this VPRegionBlock.

ExitingBlock must have no successors.

Definition at line 3995 of file VPlan.h.

References assert(), llvm::SmallVectorTemplateCommon< T, typename >::empty(), llvm::VPBlockBase::getSuccessors(), llvm::VPBlockBase::setParent(), and llvm::VPBlockBase::VPBlockBase().

Referenced by addReplicateRegions().

◆ VPlan

friend class VPlan
friend

Definition at line 3943 of file VPlan.h.

References llvm::VPBlockBase::VPBlockBase(), and VPlan.

Referenced by VPlan.


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