class VPBlockBase

Declaration

class VPBlockBase { /* full declaration omitted */ };

Description

VPBlockBase is the building block of the Hierarchical Control-Flow Graph. A VPBlockBase can be either a VPBasicBlock or a VPRegionBlock.

Declared at: llvm/lib/Transforms/Vectorize/VPlan.h:385

Member Variables

private const unsigned char SubclassID
Subclass identifier (for isa/dyn_cast).
private std::string Name
An optional name for the block.
private llvm::VPRegionBlock* Parent = nullptr
The immediate VPRegionBlock which this VPBlockBase belongs to, or null if it is a topmost VPBlockBase.
private SmallVector<llvm::VPBlockBase*, 1> Predecessors
List of predecessor blocks.
private SmallVector<llvm::VPBlockBase*, 1> Successors
List of successor blocks.
private llvm::VPlan* Plan = nullptr
VPlan containing the block. Can only be set on the entry block of the plan.

Method Overview

Methods

VPBlockBase(const unsigned char SC,
            const std::string& N)

Declared at: llvm/lib/Transforms/Vectorize/VPlan.h:434

Parameters

const unsigned char SC
const std::string& N

void appendPredecessor(
    llvm::VPBlockBase* Predecessor)

Description

Add \p Predecessor as the last predecessor to this block.

Declared at: llvm/lib/Transforms/Vectorize/VPlan.h:414

Parameters

llvm::VPBlockBase* Predecessor

void appendSuccessor(llvm::VPBlockBase* Successor)

Description

Add \p Successor as the last successor to this block.

Declared at: llvm/lib/Transforms/Vectorize/VPlan.h:408

Parameters

llvm::VPBlockBase* Successor

void clearPredecessors()

Description

Remove all the predecessor of this block.

Declared at: llvm/lib/Transforms/Vectorize/VPlan.h:576

void clearSuccessors()

Description

Remove all the successors of this block.

Declared at: llvm/lib/Transforms/Vectorize/VPlan.h:579

static void deleteCFG(llvm::VPBlockBase* Entry)

Description

Delete all blocks reachable from a given VPBlockBase, inclusive.

Declared at: llvm/lib/Transforms/Vectorize/VPlan.h:586

Parameters

llvm::VPBlockBase* Entry

virtual void dropAllReferences(
    llvm::VPValue* NewValue)

Description

Replace all operands of VPUsers in the block with \p NewValue and also replaces all uses of VPValues defined in the block with NewValue.

Declared at: llvm/lib/Transforms/Vectorize/VPlan.h:597

Parameters

llvm::VPValue* NewValue

void dump() const

Description

Dump this VPBlockBase to dbgs().

Declared at: llvm/lib/Transforms/Vectorize/VPlan.h:624

virtual void execute(
    struct VPTransformState* State)

Description

The method which generates the output IR that correspond to this VPBlockBase, thereby "executing" the VPlan.

Declared at: llvm/lib/Transforms/Vectorize/VPlan.h:583

Parameters

struct VPTransformState* State

llvm::VPBlockBase*
getEnclosingBlockWithPredecessors()

Declared at: llvm/lib/Transforms/Vectorize/VPlan.h:514

Returns

the root enclosing block if all enclosing blocks have no predecessors.

llvm::VPBlockBase*
getEnclosingBlockWithSuccessors()

Description

An Enclosing Block of a block B is any block containing B, including B itself.

Declared at: llvm/lib/Transforms/Vectorize/VPlan.h:509

Returns

the root enclosing block if all enclosing blocks have no successors.

const llvm::VPBasicBlock* getEntryBasicBlock()
    const

Declared at: llvm/lib/Transforms/Vectorize/VPlan.h:473

Returns

the VPBasicBlock that is the entry of this VPBlockBase, recursively, if the latter is a VPRegionBlock. Otherwise, if this VPBlockBase is a VPBasicBlock, it is returned.

llvm::VPBasicBlock* getEntryBasicBlock()

Declared at: llvm/lib/Transforms/Vectorize/VPlan.h:474

const llvm::VPBasicBlock* getExitingBasicBlock()
    const

Declared at: llvm/lib/Transforms/Vectorize/VPlan.h:479

Returns

the VPBasicBlock that is the exiting this VPBlockBase, recursively, if the latter is a VPRegionBlock. Otherwise, if this VPBlockBase is a VPBasicBlock, it is returned.

llvm::VPBasicBlock* getExitingBasicBlock()

Declared at: llvm/lib/Transforms/Vectorize/VPlan.h:480

const llvm::VPBlockBase::VPBlocksTy&
getHierarchicalPredecessors()

Declared at: llvm/lib/Transforms/Vectorize/VPlan.h:538

Returns

the predecessors either attached directly to this VPBlockBase or, if this VPBlockBase is the entry block of a VPRegionBlock and has no predecessors of its own, search recursively for the first enclosing VPRegionBlock that has predecessors and return them. If no such VPRegionBlock exists, return the (empty) predecessors of the topmost VPBlockBase reached.

const llvm::VPBlockBase::VPBlocksTy&
getHierarchicalSuccessors()

Declared at: llvm/lib/Transforms/Vectorize/VPlan.h:522

Returns

the successors either attached directly to this VPBlockBase or, if this VPBlockBase is the exit block of a VPRegionBlock and has no successors of its own, search recursively for the first enclosing VPRegionBlock that has successors and return them. If no such VPRegionBlock exists, return the (empty) successors of the topmost VPBlockBase reached.

const std::string& getName() const

Declared at: llvm/lib/Transforms/Vectorize/VPlan.h:448

size_t getNumPredecessors() const

Declared at: llvm/lib/Transforms/Vectorize/VPlan.h:503

size_t getNumSuccessors() const

Declared at: llvm/lib/Transforms/Vectorize/VPlan.h:502

llvm::VPRegionBlock* getParent()

Declared at: llvm/lib/Transforms/Vectorize/VPlan.h:457

const llvm::VPRegionBlock* getParent() const

Declared at: llvm/lib/Transforms/Vectorize/VPlan.h:458

const llvm::VPlan* getPlan() const

Declared at: llvm/lib/Transforms/Vectorize/VPlan.h:462

llvm::VPlan* getPlan()

Declared at: llvm/lib/Transforms/Vectorize/VPlan.h:461

Returns

A pointer to the plan containing the current block.

llvm::VPBlockBase::VPBlocksTy& getPredecessors()

Declared at: llvm/lib/Transforms/Vectorize/VPlan.h:488

const llvm::VPBlockBase::VPBlocksTy&
getPredecessors() const

Declared at: llvm/lib/Transforms/Vectorize/VPlan.h:487

llvm::VPBlockBase*
getSingleHierarchicalPredecessor()

Declared at: llvm/lib/Transforms/Vectorize/VPlan.h:544

Returns

the hierarchical predecessor of this VPBlockBase if it has a single hierarchical predecessor. Otherwise return a null pointer.

llvm::VPBlockBase*
getSingleHierarchicalSuccessor()

Declared at: llvm/lib/Transforms/Vectorize/VPlan.h:528

Returns

the hierarchical successor of this VPBlockBase if it has a single hierarchical successor. Otherwise return a null pointer.

llvm::VPBlockBase* getSinglePredecessor() const

Declared at: llvm/lib/Transforms/Vectorize/VPlan.h:498

Returns

the predecessor of this VPBlockBase if it has a single predecessor. Otherwise return a null pointer.

llvm::VPBlockBase* getSingleSuccessor() const

Declared at: llvm/lib/Transforms/Vectorize/VPlan.h:492

Returns

the successor of this VPBlockBase if it has a single successor. Otherwise return a null pointer.

llvm::VPBlockBase::VPBlocksTy& getSuccessors()

Declared at: llvm/lib/Transforms/Vectorize/VPlan.h:483

const llvm::VPBlockBase::VPBlocksTy&
getSuccessors() const

Declared at: llvm/lib/Transforms/Vectorize/VPlan.h:482

unsigned int getVPBlockID() const

Declared at: llvm/lib/Transforms/Vectorize/VPlan.h:455

Returns

an ID for the concrete type of this object. This is used to implement the classof checks. This should not be used for any other purpose, as the values may change as LLVM evolves.

bool isLegalToHoistInto()

Description

Return true if it is legal to hoist instructions into this block.

Declared at: llvm/lib/Transforms/Vectorize/VPlan.h:589

void print(llvm::raw_ostream& O) const

Description

Print plain-text dump of this VPlan to \p O.

Declared at: llvm/lib/Transforms/Vectorize/VPlan.h:614

Parameters

llvm::raw_ostream& O

virtual void print(
    llvm::raw_ostream& O,
    const llvm::Twine& Indent,
    llvm::VPSlotTracker& SlotTracker) const

Description

Print plain-text dump of this VPBlockBase to \p O, prefixing all lines with \p Indent. \p 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.

Declared at: llvm/lib/Transforms/Vectorize/VPlan.h:610

Parameters

llvm::raw_ostream& O
const llvm::Twine& Indent
llvm::VPSlotTracker& SlotTracker

void printAsOperand(llvm::raw_ostream& OS,
                    bool PrintType) const

Declared at: llvm/lib/Transforms/Vectorize/VPlan.h:600

Parameters

llvm::raw_ostream& OS
bool PrintType

void printSuccessors(
    llvm::raw_ostream& O,
    const llvm::Twine& Indent) const

Description

Print the successors of this block to \p O, prefixing all lines with \p Indent.

Declared at: llvm/lib/Transforms/Vectorize/VPlan.h:621

Parameters

llvm::raw_ostream& O
const llvm::Twine& Indent

void removePredecessor(
    llvm::VPBlockBase* Predecessor)

Description

Remove \p Predecessor from the predecessors of this block.

Declared at: llvm/lib/Transforms/Vectorize/VPlan.h:420

Parameters

llvm::VPBlockBase* Predecessor

void removeSuccessor(llvm::VPBlockBase* Successor)

Description

Remove \p Successor from the successors of this block.

Declared at: llvm/lib/Transforms/Vectorize/VPlan.h:427

Parameters

llvm::VPBlockBase* Successor

void setName(const llvm::Twine& newName)

Declared at: llvm/lib/Transforms/Vectorize/VPlan.h:450

Parameters

const llvm::Twine& newName

void setOneSuccessor(llvm::VPBlockBase* Successor)

Description

Set a given VPBlockBase \p Successor as the single successor of this VPBlockBase. This VPBlockBase is not added as predecessor of \p Successor. This VPBlockBase must have no successors.

Declared at: llvm/lib/Transforms/Vectorize/VPlan.h:551

Parameters

llvm::VPBlockBase* Successor

void setParent(llvm::VPRegionBlock* P)

Declared at: llvm/lib/Transforms/Vectorize/VPlan.h:468

Parameters

llvm::VPRegionBlock* P

void setPlan(llvm::VPlan* ParentPlan)

Description

Sets the pointer of the plan containing the block. The block must be the entry block into the VPlan.

Declared at: llvm/lib/Transforms/Vectorize/VPlan.h:466

Parameters

llvm::VPlan* ParentPlan

void setPredecessors(
    ArrayRef<llvm::VPBlockBase*> NewPreds)

Description

Set each VPBasicBlock in \p NewPreds as predecessor of this VPBlockBase. This VPBlockBase must have no predecessors. This VPBlockBase is not added as successor of any VPBasicBlock in \p NewPreds.

Declared at: llvm/lib/Transforms/Vectorize/VPlan.h:569

Parameters

ArrayRef<llvm::VPBlockBase*> NewPreds

void setTwoSuccessors(llvm::VPBlockBase* IfTrue,
                      llvm::VPBlockBase* IfFalse)

Description

Set two given VPBlockBases \p IfTrue and \p IfFalse to be the two successors of this VPBlockBase. This VPBlockBase is not added as predecessor of \p IfTrue or \p IfFalse. This VPBlockBase must have no successors.

Declared at: llvm/lib/Transforms/Vectorize/VPlan.h:560

Parameters

llvm::VPBlockBase* IfTrue
llvm::VPBlockBase* IfFalse

iterator_range<llvm::VPBlockBase**> successors()

Declared at: llvm/lib/Transforms/Vectorize/VPlan.h:485

virtual ~VPBlockBase()

Declared at: llvm/lib/Transforms/Vectorize/VPlan.h:446