LLVM
15.0.0git
|
VPBlockBase is the building block of the Hierarchical Control-Flow Graph. More...
#include "Transforms/Vectorize/VPlan.h"
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 |
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. More... | |
void | setParent (VPRegionBlock *P) |
const VPBasicBlock * | getEntryBasicBlock () const |
VPBasicBlock * | getEntryBasicBlock () |
const VPBasicBlock * | getExitBasicBlock () const |
VPBasicBlock * | getExitBasicBlock () |
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. More... | |
VPBlockBase * | getEnclosingBlockWithPredecessors () |
const VPBlocksTy & | getHierarchicalSuccessors () |
VPBlockBase * | getSingleHierarchicalSuccessor () |
const VPBlocksTy & | getHierarchicalPredecessors () |
VPBlockBase * | getSingleHierarchicalPredecessor () |
VPValue * | getCondBit () |
const VPValue * | getCondBit () const |
void | setCondBit (VPValue *CV) |
Set the condition bit selecting the successor. More... | |
VPValue * | getPredicate () |
const VPValue * | getPredicate () 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... | |
virtual void | execute (struct VPTransformState *State)=0 |
The method which generates the output IR that correspond to this VPBlockBase, thereby "executing" the VPlan. More... | |
bool | isLegalToHoistInto () |
Return true if it is legal to hoist instructions into this block. More... | |
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. More... | |
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 . More... | |
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 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 |
VPBlockBase is the building block of the Hierarchical Control-Flow Graph.
A VPBlockBase can be either a VPBasicBlock or a VPRegionBlock.
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.
|
virtualdefault |
|
inline |
Remove all the predecessor of this block.
Definition at line 613 of file VPlan.h.
References llvm::SmallVectorImpl< T >::clear().
|
inline |
Remove all the successors of this block and set to null its condition bit.
Definition at line 616 of file VPlan.h.
References llvm::SmallVectorImpl< T >::clear(), and setCondBit().
|
static |
Delete all blocks reachable from a given VPBlockBase, inclusive.
Definition at line 213 of file VPlan.cpp.
Referenced by llvm::VPRegionBlock::~VPRegionBlock().
|
pure virtual |
Replace all operands of VPUsers in the block with NewValue
and also replaces all uses of VPValues defined in the block with NewValue.
Implemented in llvm::VPRegionBlock, and llvm::VPBasicBlock.
|
inline |
Dump this VPBlockBase to dbgs().
Definition at line 664 of file VPlan.h.
References llvm::dbgs(), and print().
|
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.
Definition at line 191 of file VPlan.cpp.
References llvm::VPBlockUser::getSingleOperandOrNull().
Referenced by llvm::VPBlockUtils::insertBlockAfter().
VPBlockBase * VPBlockBase::getEnclosingBlockWithPredecessors | ( | ) |
Definition at line 183 of file VPlan.cpp.
References assert(), getEnclosingBlockWithPredecessors(), and llvm::VPRegionBlock::getEntry().
Referenced by getEnclosingBlockWithPredecessors(), getHierarchicalPredecessors(), and getSingleHierarchicalPredecessor().
VPBlockBase * VPBlockBase::getEnclosingBlockWithSuccessors | ( | ) |
An Enclosing Block of a block B is any block containing B, including B itself.
Definition at line 175 of file VPlan.cpp.
References assert(), getEnclosingBlockWithSuccessors(), and llvm::VPRegionBlock::getExit().
Referenced by getEnclosingBlockWithSuccessors(), getHierarchicalSuccessors(), and getSingleHierarchicalSuccessor().
VPBasicBlock* llvm::VPBlockBase::getEntryBasicBlock | ( | ) |
VPBasicBlock * VPBlockBase::getEntryBasicBlock | ( | ) | const |
Definition at line 140 of file VPlan.cpp.
References llvm::RegionBase< Tr >::getEntry().
Referenced by addCanonicalIVRecipes(), llvm::VPRecipeBuilder::createBlockInMask(), llvm::LoopVectorizationPlanner::executePlan(), llvm::InnerLoopVectorizer::fixCrossIterationPHIs(), llvm::VPlan::getCanonicalIV(), llvm::vputils::getOrCreateVPValueForSCEVExpr(), llvm::VPlanTransforms::optimizeInductions(), llvm::LoopVectorizePass::processLoop(), llvm::VPlanTransforms::removeDeadRecipes(), llvm::VPlanTransforms::removeRedundantCanonicalIVs(), llvm::VPlanTransforms::removeRedundantExpandSCEVRecipes(), and llvm::VPlanTransforms::removeRedundantInductionCasts().
VPBasicBlock* llvm::VPBlockBase::getExitBasicBlock | ( | ) |
VPBasicBlock * VPBlockBase::getExitBasicBlock | ( | ) | const |
Definition at line 161 of file VPlan.cpp.
References llvm::RegionBase< Tr >::getExit().
Referenced by addCanonicalIVRecipes(), llvm::VPBasicBlock::execute(), llvm::InnerLoopVectorizer::fixReduction(), llvm::InnerLoopVectorizer::fixVectorizedLoop(), and llvm::VPRegionBlock::getPreheaderVPBB().
|
inline |
Definition at line 558 of file VPlan.h.
References getEnclosingBlockWithPredecessors(), and getPredecessors().
|
inline |
Definition at line 542 of file VPlan.h.
References getEnclosingBlockWithSuccessors(), and getSuccessors().
|
inline |
Definition at line 468 of file VPlan.h.
Referenced by printAsOperand().
|
inline |
|
inline |
Definition at line 477 of file VPlan.h.
Referenced by llvm::VPBlockUtils::connectBlocks(), llvm::VPBasicBlock::execute(), llvm::VPBlockUtils::insertBlockAfter(), llvm::VPBlockUtils::insertTwoBlocksAfter(), llvm::VPBlockUtils::isBackEdge(), and llvm::VPlanVerifier::verifyHierarchicalCFG().
|
inline |
Definition at line 135 of file VPlan.cpp.
References getPlanEntry().
Referenced by llvm::VPValue::dump(), llvm::VPDef::dump(), llvm::operator<<(), and print().
|
inline |
|
inline |
Definition at line 507 of file VPlan.h.
Referenced by getHierarchicalPredecessors(), llvm::VPBlockUtils::insertBlockAfter(), and llvm::VPRegionBlock::setEntry().
Definition at line 201 of file VPlan.cpp.
References llvm::VPBlockUser::getSingleOperandOrNull().
|
inline |
Definition at line 564 of file VPlan.h.
References getEnclosingBlockWithPredecessors(), and getSinglePredecessor().
|
inline |
Definition at line 548 of file VPlan.h.
References getEnclosingBlockWithSuccessors(), and getSingleSuccessor().
Referenced by llvm::VPBasicBlock::execute().
|
inline |
Definition at line 518 of file VPlan.h.
Referenced by llvm::VPRegionBlock::getPreheaderVPBB(), and getSingleHierarchicalPredecessor().
|
inline |
Definition at line 512 of file VPlan.h.
Referenced by llvm::VPlan::getCanonicalIV(), getSingleHierarchicalSuccessor(), llvm::VPRecipeBuilder::handleReplication(), and llvm::VPlanTransforms::mergeReplicateRegions().
|
inline |
|
inline |
Definition at line 502 of file VPlan.h.
Referenced by llvm::VPBlockUtils::countSuccessorsNoBE(), getHierarchicalSuccessors(), llvm::VPBlockUtils::insertBlockAfter(), llvm::VPBlockUtils::insertTwoBlocksAfter(), llvm::VPRegionBlock::setExit(), and llvm::VPRegionBlock::VPRegionBlock().
|
inline |
Definition at line 475 of file VPlan.h.
Referenced by llvm::VPBasicBlock::classof(), and llvm::VPRegionBlock::classof().
|
inline |
|
inline |
|
pure 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.
Implemented in llvm::VPRegionBlock, and llvm::VPBasicBlock.
|
inline |
void VPBlockBase::printSuccessors | ( | raw_ostream & | O, |
const Twine & | Indent | ||
) | const |
Print the successors of this block to O
, prefixing all lines with Indent
.
Definition at line 445 of file VPlan.cpp.
References llvm::empty(), llvm::AArch64CC::LS, and llvm::RISCVFenceField::O.
void VPBlockBase::setCondBit | ( | VPValue * | CV | ) |
Set the condition bit selecting the successor.
Definition at line 199 of file VPlan.cpp.
References llvm::VPBlockUser::resetSingleOpUser().
Referenced by addCanonicalIVRecipes(), clearSuccessors(), llvm::VPBlockUtils::insertBlockAfter(), and setTwoSuccessors().
Definition at line 470 of file VPlan.h.
References llvm::Twine::str().
Referenced by llvm::LoopVectorizePass::processLoop().
|
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 585 of file VPlan.h.
References assert(), and llvm::Successor.
|
inline |
Definition at line 488 of file VPlan.h.
References P.
Referenced by llvm::VPBlockUtils::insertBlockAfter(), llvm::VPBlockUtils::insertTwoBlocksAfter(), llvm::VPRegionBlock::setEntry(), llvm::VPRegionBlock::setExit(), and llvm::VPRegionBlock::VPRegionBlock().
void VPBlockBase::setPlan | ( | VPlan * | ParentPlan | ) |
Sets the pointer of the plan containing the block.
The block must be the entry block into the VPlan.
Definition at line 154 of file VPlan.cpp.
References assert(), and llvm::VPlan::getEntry().
|
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 606 of file VPlan.h.
References assert().
Referenced by llvm::VPBlockUtils::insertTwoBlocksAfter().
void VPBlockBase::setPredicate | ( | VPValue * | Pred | ) |
Set the block's predicate.
Definition at line 209 of file VPlan.cpp.
References llvm::VPBlockUser::resetSingleOpUser().
|
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 594 of file VPlan.h.
References assert(), and setCondBit().
Referenced by llvm::VPBlockUtils::insertTwoBlocksAfter().
|
inline |
Definition at line 505 of file VPlan.h.
Referenced by llvm::VPBlockUtils::insertBlockAfter().
|
friend |