LLVM 22.0.0git
llvm::VPIRBasicBlock Class Reference

A special type of VPBasicBlock that wraps an existing IR basic block. More...

#include "Transforms/Vectorize/VPlan.h"

Inheritance diagram for llvm::VPIRBasicBlock:
[legend]

Public Member Functions

 ~VPIRBasicBlock () override
void execute (VPTransformState *State) override
 The method which generates the output IR instructions that correspond to this VPBasicBlock, thereby "executing" the VPlan.
VPIRBasicBlockclone () override
 Clone the current block and it's recipes, without updating the operands of the cloned recipes.
BasicBlockgetIRBasicBlock () const
Public Member Functions inherited from llvm::VPBasicBlock
 ~VPBasicBlock () override
iterator begin ()
 Recipe iterator methods.
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 VPRecipeBasefront () const
VPRecipeBasefront ()
const VPRecipeBaseback () const
VPRecipeBaseback ()
RecipeListTygetRecipeList ()
 Returns a reference to the list of recipes.
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.
InstructionCost cost (ElementCount VF, VPCostContext &Ctx) override
 Return the cost of this VPBasicBlock.
iterator getFirstNonPhi ()
 Return the position of the first non-phi node recipe in the block.
iterator_range< iteratorphis ()
 Returns an iterator range over the PHI-like recipes in the block.
VPBasicBlocksplitAt (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.
VPRegionBlockgetEnclosingLoopRegion ()
const VPRegionBlockgetEnclosingLoopRegion () const
void print (raw_ostream &O, const Twine &Indent, VPSlotTracker &SlotTracker) const override
 Print this VPBsicBlock to O, prefixing all lines with Indent.
VPRecipeBasegetTerminator ()
 If the block has multiple successors, return the branch recipe terminating the block.
const VPRecipeBasegetTerminator () const
bool isExiting () const
 Returns true if the block is exiting it's parent region.
const VPBasicBlockgetCFGPredecessor (unsigned Idx) const
 Returns the predecessor block at index Idx with the predecessors as per the corresponding plain CFG.
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)
Static Public Member Functions inherited from llvm::VPBasicBlock
static RecipeListTy VPBasicBlock::* getSublistAccess (VPRecipeBase *)
 Returns a pointer to a member of the recipe list.
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::VPBasicBlock
using RecipeListTy = iplist<VPRecipeBase>
using iterator = RecipeListTy::iterator
 Instruction iterators...
using const_iterator = RecipeListTy::const_iterator
using reverse_iterator = RecipeListTy::reverse_iterator
using const_reverse_iterator = RecipeListTy::const_reverse_iterator
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::VPBasicBlock
 VPBasicBlock (const unsigned char BlockSC, const Twine &Name="")
void executeRecipes (VPTransformState *State, BasicBlock *BB)
 Execute the recipes in the IR basic block BB.
void connectToPredecessors (VPTransformState &State)
 Connect the VPBBs predecessors' in the VPlan CFG to the IR basic block generated for this VPBB.
Protected Member Functions inherited from llvm::VPBlockBase
 VPBlockBase (const unsigned char SC, const std::string &N)
Protected Attributes inherited from llvm::VPBasicBlock
RecipeListTy Recipes
 The VPRecipes held in the order of output instructions to generate.

Detailed Description

A special type of VPBasicBlock that wraps an existing IR basic block.

Recipes of the block get added before the first non-phi instruction in the wrapped block. Note: At the moment, VPIRBasicBlock can only be used to wrap VPlan's preheader block.

Definition at line 3917 of file VPlan.h.

Constructor & Destructor Documentation

◆ ~VPIRBasicBlock()

llvm::VPIRBasicBlock::~VPIRBasicBlock ( )
inlineoverride

Definition at line 3929 of file VPlan.h.

Member Function Documentation

◆ classof()

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

Definition at line 3931 of file VPlan.h.

◆ clone()

VPIRBasicBlock * VPIRBasicBlock::clone ( )
overridevirtual

Clone the current block and it's recipes, without updating the operands of the cloned recipes.

Reimplemented from llvm::VPBasicBlock.

Definition at line 512 of file VPlan.cpp.

References llvm::VPBasicBlock::appendRecipe(), llvm::VPlan::createEmptyVPIRBasicBlock(), llvm::VPBlockBase::getPlan(), and llvm::VPBasicBlock::Recipes.

◆ execute()

void VPIRBasicBlock::execute ( VPTransformState * State)
overridevirtual

◆ getIRBasicBlock()

BasicBlock * llvm::VPIRBasicBlock::getIRBasicBlock ( ) const
inline

◆ VPlan

friend class VPlan
friend

Definition at line 3918 of file VPlan.h.

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

Referenced by VPlan.


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