LLVM
15.0.0git
|
Class that provides utilities for VPBlockBases in VPlan. More...
#include "Transforms/Vectorize/VPlan.h"
Public Member Functions | |
VPBlockUtils ()=delete | |
Static Public Member Functions | |
static void | insertBlockAfter (VPBlockBase *NewBlock, VPBlockBase *BlockPtr) |
Insert disconnected VPBlockBase NewBlock after BlockPtr . More... | |
static void | insertTwoBlocksAfter (VPBlockBase *IfTrue, VPBlockBase *IfFalse, VPValue *Condition, VPBlockBase *BlockPtr) |
Insert disconnected VPBlockBases IfTrue and IfFalse after BlockPtr . More... | |
static void | connectBlocks (VPBlockBase *From, VPBlockBase *To) |
Connect VPBlockBases From and To bi-directionally. More... | |
static void | disconnectBlocks (VPBlockBase *From, VPBlockBase *To) |
Disconnect VPBlockBases From and To bi-directionally. More... | |
static VPBasicBlock * | tryToMergeBlockIntoPredecessor (VPBlockBase *Block) |
Try to merge Block into its single predecessor, if Block is a VPBasicBlock and its predecessor has a single successor. More... | |
static bool | isBackEdge (const VPBlockBase *FromBlock, const VPBlockBase *ToBlock, const VPLoopInfo *VPLI) |
Returns true if the edge FromBlock -> ToBlock is a back-edge. More... | |
static bool | blockIsLoopLatch (const VPBlockBase *Block, const VPLoopInfo *VPLInfo) |
Returns true if Block is a loop latch. More... | |
static unsigned | countSuccessorsNoBE (VPBlockBase *PredBlock, VPLoopInfo *VPLI) |
Count and return the number of succesors of PredBlock excluding any backedges. More... | |
template<typename BlockTy , typename T > | |
static auto | blocksOnly (const T &Range) |
Return an iterator range over Range which only includes BlockTy blocks. More... | |
|
delete |
|
inlinestatic |
Returns true if Block
is a loop latch.
Definition at line 2900 of file VPlan.h.
References llvm::LoopInfoBase< BlockT, LoopT >::getLoopFor().
|
inlinestatic |
Return an iterator range over Range
which only includes BlockTy
blocks.
The accesses are casted to BlockTy
.
Definition at line 2923 of file VPlan.h.
References llvm::Filter, llvm::make_filter_range(), llvm::map_range(), and type.
|
inlinestatic |
Connect VPBlockBases From
and To
bi-directionally.
Append To
to the successors of From
and From
to the predecessors of To
. Both VPBlockBases must have the same parent, which can be null. Both VPBlockBases can be already connected to other VPBlockBases.
Definition at line 2843 of file VPlan.h.
References assert(), From, and llvm::VPBlockBase::getParent().
Referenced by llvm::VPRecipeBuilder::handleReplication(), insertBlockAfter(), llvm::VPlanTransforms::mergeReplicateRegions(), llvm::VPBasicBlock::splitAt(), and tryToMergeBlockIntoPredecessor().
|
inlinestatic |
Count and return the number of succesors of PredBlock
excluding any backedges.
Definition at line 2910 of file VPlan.h.
References llvm::VPBlockBase::getSuccessors(), and isBackEdge().
|
inlinestatic |
Disconnect VPBlockBases From
and To
bi-directionally.
Remove To
from the successors of From
and From
from the predecessors of To
.
Definition at line 2854 of file VPlan.h.
References assert(), and From.
Referenced by llvm::VPRecipeBuilder::handleReplication(), insertBlockAfter(), llvm::VPlanTransforms::mergeReplicateRegions(), llvm::VPBasicBlock::splitAt(), and tryToMergeBlockIntoPredecessor().
|
inlinestatic |
Insert disconnected VPBlockBase NewBlock
after BlockPtr
.
Add NewBlock
as successor of BlockPtr
and BlockPtr
as predecessor of NewBlock
, and propagate BlockPtr
parent to NewBlock
. BlockPtr's
successors are moved from BlockPtr
to NewBlock
and BlockPtr's
conditional bit is propagated to NewBlock
. NewBlock
must have neither successors nor predecessors.
Definition at line 2805 of file VPlan.h.
References assert(), connectBlocks(), disconnectBlocks(), llvm::VPBlockBase::getCondBit(), llvm::VPBlockBase::getParent(), llvm::VPBlockBase::getPredecessors(), llvm::VPBlockBase::getSuccessors(), llvm::VPBlockBase::setCondBit(), llvm::VPBlockBase::setParent(), and llvm::VPBlockBase::successors().
Referenced by llvm::VPRecipeBuilder::handleReplication(), and llvm::VPBasicBlock::splitAt().
|
inlinestatic |
Insert disconnected VPBlockBases IfTrue
and IfFalse
after BlockPtr
.
Add IfTrue
and IfFalse
as succesors of BlockPtr
and BlockPtr
as predecessor of IfTrue
and IfFalse
. Propagate BlockPtr
parent to IfTrue
and IfFalse
. Condition
is set as the successor selector. BlockPtr
must have no successors and IfTrue
and IfFalse
must have neither successors nor predecessors.
Definition at line 2826 of file VPlan.h.
References assert(), llvm::VPBlockBase::getParent(), llvm::VPBlockBase::getSuccessors(), llvm::VPBlockBase::setParent(), llvm::VPBlockBase::setPredecessors(), and llvm::VPBlockBase::setTwoSuccessors().
|
inlinestatic |
Returns true if the edge FromBlock
-> ToBlock
is a back-edge.
Definition at line 2886 of file VPlan.h.
References assert(), llvm::LoopBase< BlockT, LoopT >::getHeader(), llvm::LoopInfoBase< BlockT, LoopT >::getLoopFor(), llvm::VPBlockBase::getParent(), and llvm::LoopBase< BlockT, LoopT >::isLoopLatch().
Referenced by countSuccessorsNoBE().
|
inlinestatic |
Try to merge Block
into its single predecessor, if Block
is a VPBasicBlock and its predecessor has a single successor.
Returns a pointer to the predecessor Block
was merged into or nullptr otherwise.
Definition at line 2863 of file VPlan.h.
References connectBlocks(), disconnectBlocks(), and llvm::make_early_inc_range().