LLVM
15.0.0git
|
VPBasicBlock serves as the leaf of the Hierarchical Control-Flow Graph. More...
#include "Transforms/Vectorize/VPlan.h"
Public Types | |
using | RecipeListTy = iplist< VPRecipeBase > |
using | iterator = RecipeListTy::iterator |
Instruction iterators... More... | |
using | const_iterator = RecipeListTy::const_iterator |
using | reverse_iterator = RecipeListTy::reverse_iterator |
using | const_reverse_iterator = RecipeListTy::const_reverse_iterator |
![]() | |
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 | |
VPBasicBlock (const Twine &Name="", VPRecipeBase *Recipe=nullptr) | |
~VPBasicBlock () override | |
iterator | begin () |
Recipe iterator methods. More... | |
const_iterator | begin () const |
iterator | end () |
const_iterator | end () const |
reverse_iterator | rbegin () |
const_reverse_iterator | rbegin () const |
reverse_iterator | rend () |
const_reverse_iterator | rend () const |
size_t | size () const |
bool | empty () const |
const VPRecipeBase & | front () const |
VPRecipeBase & | front () |
const VPRecipeBase & | back () const |
VPRecipeBase & | back () |
RecipeListTy & | getRecipeList () |
Returns a reference to the list of recipes. More... | |
void | insert (VPRecipeBase *Recipe, iterator InsertPt) |
void | appendRecipe (VPRecipeBase *Recipe) |
Augment the existing recipes of a VPBasicBlock with an additional Recipe as the last recipe. More... | |
void | execute (struct VPTransformState *State) override |
The method which generates the output IR instructions that correspond to this VPBasicBlock, thereby "executing" the VPlan. More... | |
iterator | getFirstNonPhi () |
Return the position of the first non-phi node recipe in the block. More... | |
iterator_range< iterator > | phis () |
Returns an iterator range over the PHI-like recipes in the block. 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... | |
VPBasicBlock * | splitAt (iterator SplitAt) |
Split current block at SplitAt by inserting a new block between the current block and its successors and moving all recipes starting at SplitAt to the new block. More... | |
VPRegionBlock * | getEnclosingLoopRegion () |
void | print (raw_ostream &O, const Twine &Indent, VPSlotTracker &SlotTracker) const override |
Print this VPBsicBlock to O , 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... | |
![]() | |
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... | |
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 RecipeListTy VPBasicBlock::* | getSublistAccess (VPRecipeBase *) |
Returns a pointer to a member of the recipe list. More... | |
static bool | classof (const VPBlockBase *V) |
Method to support type inquiry through isa, cast, and dyn_cast. More... | |
![]() | |
static void | deleteCFG (VPBlockBase *Entry) |
Delete all blocks reachable from a given VPBlockBase, inclusive. More... | |
Additional Inherited Members | |
![]() | |
VPBlockBase (const unsigned char SC, const std::string &N) | |
VPBasicBlock serves as the leaf of the Hierarchical Control-Flow Graph.
It holds a sequence of zero or more VPRecipe's each representing a sequence of output IR instructions. All PHI-like recipes must come before any non-PHI recipes.
using llvm::VPBasicBlock::iterator = RecipeListTy::iterator |
Instruction iterators...
|
inline |
Definition at line 1982 of file VPlan.h.
References appendRecipe().
|
inlineoverride |
Definition at line 1988 of file VPlan.h.
References llvm::iplist_impl< IntrusiveListT, TraitsT >::pop_back().
|
inline |
Augment the existing recipes of a VPBasicBlock with an additional Recipe
as the last recipe.
Definition at line 2041 of file VPlan.h.
References end(), and insert().
Referenced by addCanonicalIVRecipes(), llvm::vputils::getOrCreateVPValueForSCEVExpr(), llvm::VPRecipeBuilder::handleReplication(), and VPBasicBlock().
|
inline |
|
inline |
|
inline |
Recipe iterator methods.
Definition at line 2002 of file VPlan.h.
Referenced by addCanonicalIVRecipes(), llvm::VPlan::getCanonicalIV(), getFirstNonPhi(), and phis().
|
inline |
|
inlinestatic |
Method to support type inquiry through isa, cast, and dyn_cast.
Definition at line 2028 of file VPlan.h.
References llvm::VPBlockBase::getVPBlockID().
|
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 399 of file VPlan.cpp.
References llvm::tgtok::Def, E, and I.
|
inline |
Definition at line 2013 of file VPlan.h.
Referenced by llvm::VPlan::getCanonicalIV().
|
inline |
Definition at line 2004 of file VPlan.h.
Referenced by appendRecipe(), and getFirstNonPhi().
|
inline |
|
overridevirtual |
The method which generates the output IR instructions that correspond to this VPBasicBlock, thereby "executing" the VPlan.
Implements llvm::VPBlockBase.
Definition at line 319 of file VPlan.cpp.
References llvm::LoopBase< BlockT, LoopT >::addBasicBlockToLoop(), assert(), BB, llvm::VPTransformState::Builder, llvm::VPTransformState::CFG, llvm::BranchInst::Create(), llvm::IRBuilderBase::CreateUnreachable(), llvm::VPTransformState::CurrentVectorLoop, llvm::dbgs(), llvm::empty(), EnableVPlanNativePath, execute(), llvm::VPTransformState::CFGState::ExitBB, llvm::VPTransformState::get(), llvm::VPBlockBase::getExitBasicBlock(), getName(), llvm::Value::getName(), llvm::VPBlockBase::getParent(), llvm::VPBlockBase::getSingleHierarchicalSuccessor(), llvm::BasicBlock::getTerminator(), llvm::VPValue::getUnderlyingValue(), llvm::VPTransformState::Instance, llvm::VPTransformState::LI, LLVM_DEBUG, llvm::VPTransformState::CFGState::PrevBB, llvm::VPTransformState::CFGState::PrevVPBB, llvm::ReplaceInstWithInst(), llvm::IRBuilderBase::SetInsertPoint(), llvm::MCID::Terminator, and llvm::VPTransformState::CFGState::VPBB2IRBB.
Referenced by execute().
|
inline |
|
inline |
VPRegionBlock * VPBasicBlock::getEnclosingLoopRegion | ( | ) |
Definition at line 434 of file VPlan.cpp.
References assert(), getParent(), and P.
Referenced by llvm::InnerLoopVectorizer::fixReduction().
VPBasicBlock::iterator VPBasicBlock::getFirstNonPhi | ( | ) |
Return the position of the first non-phi node recipe in the block.
Definition at line 220 of file VPlan.cpp.
References begin(), and end().
Referenced by llvm::VPRecipeBuilder::createBlockInMask(), llvm::VPlanTransforms::mergeReplicateRegions(), llvm::VPlanTransforms::optimizeInductions(), phis(), and llvm::VPlanTransforms::sinkScalarOperands().
|
inline |
Returns a reference to the list of recipes.
Definition at line 2020 of file VPlan.h.
Referenced by llvm::VPRecipeBase::insertAfter(), and llvm::VPRecipeBase::insertBefore().
|
inlinestatic |
|
inline |
Definition at line 2032 of file VPlan.h.
References assert(), and llvm::iplist_impl< IntrusiveListT, TraitsT >::insert().
Referenced by addCanonicalIVRecipes(), appendRecipe(), llvm::VPRecipeBuilder::createBlockInMask(), and llvm::VPlanTransforms::optimizeInductions().
|
inline |
Returns an iterator range over the PHI-like recipes in the block.
Definition at line 2051 of file VPlan.h.
References begin(), getFirstNonPhi(), and llvm::make_range().
Referenced by llvm::InnerLoopVectorizer::fixCrossIterationPHIs(), llvm::VPlanTransforms::optimizeInductions(), llvm::LoopVectorizePass::processLoop(), llvm::VPlanTransforms::removeRedundantCanonicalIVs(), and llvm::VPlanTransforms::removeRedundantInductionCasts().
|
inline |
|
overridevirtual |
Print this VPBsicBlock 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.
Definition at line 457 of file VPlan.cpp.
References getName(), llvm::PPC::getPredicate(), llvm::RISCVFenceField::O, and llvm::VPDef::print().
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.
|
inline |
|
inline |
|
inline |
|
inline |
VPBasicBlock * VPBasicBlock::splitAt | ( | iterator | SplitAt | ) |
Split current block at SplitAt
by inserting a new block between the current block and its successors and moving all recipes starting at SplitAt to the new block.
Returns the new block.
Definition at line 409 of file VPlan.cpp.
References assert(), llvm::VPBlockUtils::connectBlocks(), llvm::VPBlockUtils::disconnectBlocks(), llvm::sys::path::end(), llvm::BasicBlock::end(), getName(), llvm::VPBlockUtils::insertBlockAfter(), llvm::make_early_inc_range(), llvm::make_range(), llvm::SplitBlock(), and llvm::successors().