LLVM 18.0.0git
|
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"
Public Member Functions | |
VPRegionBlock (VPBlockBase *Entry, VPBlockBase *Exiting, const std::string &Name="", bool IsReplicator=false) | |
VPRegionBlock (const std::string &Name="", bool IsReplicator=false) | |
~VPRegionBlock () override | |
const VPBlockBase * | getEntry () const |
VPBlockBase * | getEntry () |
void | setEntry (VPBlockBase *EntryBlock) |
Set EntryBlock as the entry VPBlockBase of this VPRegionBlock. | |
const VPBlockBase * | getExiting () const |
VPBlockBase * | getExiting () |
void | setExiting (VPBlockBase *ExitingBlock) |
Set ExitingBlock as the exiting VPBlockBase of this VPRegionBlock. | |
VPBasicBlock * | getPreheaderVPBB () |
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. | |
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. | |
void | print (raw_ostream &O, const Twine &Indent, VPSlotTracker &SlotTracker) const override |
Print this VPRegionBlock to O (recursively), prefixing all lines with Indent . | |
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 . | |
void | print (raw_ostream &O) const |
Print plain-text dump of this VPlan to O . | |
![]() | |
virtual | ~VPBlockBase ()=default |
const std::string & | getName () const |
void | setName (const Twine &newName) |
unsigned | getVPBlockID () const |
VPRegionBlock * | getParent () |
const VPRegionBlock * | getParent () const |
VPlan * | getPlan () |
const VPlan * | getPlan () const |
void | setPlan (VPlan *ParentPlan) |
Sets the pointer of the plan containing the block. | |
void | setParent (VPRegionBlock *P) |
const VPBasicBlock * | getEntryBasicBlock () const |
VPBasicBlock * | getEntryBasicBlock () |
const VPBasicBlock * | getExitingBasicBlock () const |
VPBasicBlock * | getExitingBasicBlock () |
const VPBlocksTy & | getSuccessors () const |
VPBlocksTy & | getSuccessors () |
iterator_range< VPBlockBase ** > | successors () |
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. | |
VPBlockBase * | getEnclosingBlockWithPredecessors () |
const VPBlocksTy & | getHierarchicalSuccessors () |
VPBlockBase * | getSingleHierarchicalSuccessor () |
const VPBlocksTy & | getHierarchicalPredecessors () |
VPBlockBase * | getSingleHierarchicalPredecessor () |
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 | clearPredecessors () |
Remove all the predecessor of this block. | |
void | clearSuccessors () |
Remove all the successors of this block. | |
virtual void | execute (VPTransformState *State)=0 |
The method which generates the output IR that correspond to this VPBlockBase, thereby "executing" the VPlan. | |
bool | isLegalToHoistInto () |
Return true if it is legal to hoist instructions into this block. | |
virtual void | dropAllReferences (VPValue *NewValue)=0 |
Replace all operands of VPUsers in the block with NewValue and also replaces all uses of VPValues defined in the block with NewValue. | |
void | printAsOperand (raw_ostream &OS, bool PrintType) const |
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 . | |
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. | |
![]() | |
static void | deleteCFG (VPBlockBase *Entry) |
Delete all blocks reachable from a given VPBlockBase, inclusive. | |
Additional Inherited Members | |
![]() | |
using | VPBlockTy = enum { VPBasicBlockSC, VPRegionBlockSC } |
An enumeration for keeping track of the concrete subclass of VPBlockBase that are actually instantiated. | |
using | VPBlocksTy = SmallVectorImpl< VPBlockBase * > |
![]() | |
VPBlockBase (const unsigned char SC, const std::string &N) | |
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.
|
inline |
Definition at line 2430 of file VPlan.h.
References assert(), llvm::SmallVectorBase< Size_T >::empty(), llvm::VPBlockBase::getSuccessors(), and llvm::VPBlockBase::setParent().
|
inlineoverride |
Definition at line 2443 of file VPlan.h.
References llvm::VPBlockBase::deleteCFG().
|
inlinestatic |
|
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 617 of file VPlan.cpp.
References llvm::Block, and llvm::vp_depth_first_shallow().
|
overridevirtual |
The method which generates the output IR instructions that correspond to this VPRegionBlock, thereby "executing" the VPlan.
Implements llvm::VPBlockBase.
Definition at line 624 of file VPlan.cpp.
References llvm::LoopBase< BlockT, LoopT >::addChildLoop(), llvm::LoopInfoBase< BlockT, LoopT >::addTopLevelLoop(), llvm::LoopInfoBase< BlockT, LoopT >::AllocateLoop(), assert(), llvm::Block, llvm::VPTransformState::CFG, llvm::VPTransformState::CurrentVectorLoop, llvm::dbgs(), llvm::VPLane::First, llvm::details::FixedOrScalableQuantity< LeafTy, ValueTy >::getKnownMinValue(), llvm::LoopInfoBase< BlockT, LoopT >::getLoopFor(), llvm::VPTransformState::Instance, llvm::details::FixedOrScalableQuantity< LeafTy, ValueTy >::isScalable(), llvm::VPTransformState::LI, LLVM_DEBUG, llvm::VPTransformState::UF, llvm::VPTransformState::VF, and llvm::VPTransformState::CFGState::VPBB2IRBB.
|
inline |
|
inline |
Definition at line 2456 of file VPlan.h.
Referenced by llvm::VPlanTransforms::adjustFixedOrderRecurrences(), llvm::VPBlockBase::getEnclosingBlockWithPredecessors(), isHeaderVPBB(), and llvm::VPlanVerifier::verifyPlanIsValid().
|
inline |
|
inline |
Definition at line 2468 of file VPlan.h.
Referenced by llvm::VPBlockBase::getEnclosingBlockWithSuccessors(), and llvm::VPlanVerifier::verifyPlanIsValid().
|
inline |
Returns the pre-header VPBasicBlock of the loop region.
Definition at line 2481 of file VPlan.h.
References assert(), llvm::VPBlockBase::getExitingBasicBlock(), llvm::VPBlockBase::getSinglePredecessor(), and isReplicator().
Referenced by llvm::VPTransformState::CFGState::getPreheaderBBFor().
|
inline |
An indicator whether this region is to generate multiple replicated instances of output IR corresponding to its VPBlockBases.
Definition at line 2488 of file VPlan.h.
Referenced by getPreheaderVPBB(), llvm::InnerLoopVectorizer::scalarizeInstruction(), and verifyPhiRecipes().
|
inline |
|
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 676 of file VPlan.cpp.
References getName(), and llvm::vp_depth_first_shallow().
|
virtual |
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.
Implements llvm::VPBlockBase.
|
inline |
Set EntryBlock
as the entry VPBlockBase of this VPRegionBlock.
EntryBlock
must have no predecessors.
Definition at line 2461 of file VPlan.h.
References assert(), llvm::SmallVectorBase< Size_T >::empty(), llvm::VPBlockBase::getPredecessors(), and llvm::VPBlockBase::setParent().
|
inline |
Set ExitingBlock
as the exiting VPBlockBase of this VPRegionBlock.
ExitingBlock
must have no successors.
Definition at line 2473 of file VPlan.h.
References assert(), llvm::SmallVectorBase< Size_T >::empty(), llvm::VPBlockBase::getSuccessors(), and llvm::VPBlockBase::setParent().