LLVM 19.0.0git
Classes | Public Member Functions | Static Public Member Functions | List of all members
llvm::VPBuilder Class Reference

VPlan-based builder utility analogous to IRBuilder. More...

#include "Transforms/Vectorize/LoopVectorizationPlanner.h"

Classes

class  InsertPointGuard
 RAII object that stores the current insertion point and restores it when the object is destroyed. More...
 
class  VPInsertPoint
 InsertPoint - A saved insertion point. More...
 

Public Member Functions

 VPBuilder ()=default
 
 VPBuilder (VPBasicBlock *InsertBB)
 
 VPBuilder (VPRecipeBase *InsertPt)
 
void clearInsertionPoint ()
 Clear the insertion point: created instructions will not be inserted into a block.
 
VPBasicBlockgetInsertBlock () const
 
VPBasicBlock::iterator getInsertPoint () const
 
void restoreIP (VPInsertPoint IP)
 Sets the current insert point to a previously-saved location.
 
void setInsertPoint (VPBasicBlock *TheBB)
 This specifies that created VPInstructions should be appended to the end of the specified block.
 
void setInsertPoint (VPBasicBlock *TheBB, VPBasicBlock::iterator IP)
 This specifies that created instructions should be inserted at the specified point.
 
void setInsertPoint (VPRecipeBase *IP)
 This specifies that created instructions should be inserted at the specified point.
 
VPInstructioncreateNaryOp (unsigned Opcode, ArrayRef< VPValue * > Operands, Instruction *Inst=nullptr, const Twine &Name="")
 Create an N-ary operation with Opcode, Operands and set Inst as its underlying Instruction.
 
VPInstructioncreateNaryOp (unsigned Opcode, ArrayRef< VPValue * > Operands, DebugLoc DL, const Twine &Name="")
 
VPInstructioncreateOverflowingOp (unsigned Opcode, std::initializer_list< VPValue * > Operands, VPRecipeWithIRFlags::WrapFlagsTy WrapFlags, DebugLoc DL={}, const Twine &Name="")
 
VPValuecreateNot (VPValue *Operand, DebugLoc DL={}, const Twine &Name="")
 
VPValuecreateAnd (VPValue *LHS, VPValue *RHS, DebugLoc DL={}, const Twine &Name="")
 
VPValuecreateOr (VPValue *LHS, VPValue *RHS, DebugLoc DL={}, const Twine &Name="")
 
VPValuecreateLogicalAnd (VPValue *LHS, VPValue *RHS, DebugLoc DL={}, const Twine &Name="")
 
VPValuecreateSelect (VPValue *Cond, VPValue *TrueVal, VPValue *FalseVal, DebugLoc DL={}, const Twine &Name="", std::optional< FastMathFlags > FMFs=std::nullopt)
 
VPValuecreateICmp (CmpInst::Predicate Pred, VPValue *A, VPValue *B, DebugLoc DL={}, const Twine &Name="")
 Create a new ICmp VPInstruction with predicate Pred and operands A and B.
 

Static Public Member Functions

static VPBuilder getToInsertAfter (VPRecipeBase *R)
 Create a VPBuilder to insert after R.
 

Detailed Description

VPlan-based builder utility analogous to IRBuilder.

Definition at line 45 of file LoopVectorizationPlanner.h.

Constructor & Destructor Documentation

◆ VPBuilder() [1/3]

llvm::VPBuilder::VPBuilder ( )
default

◆ VPBuilder() [2/3]

llvm::VPBuilder::VPBuilder ( VPBasicBlock InsertBB)
inline

Definition at line 70 of file LoopVectorizationPlanner.h.

References setInsertPoint().

◆ VPBuilder() [3/3]

llvm::VPBuilder::VPBuilder ( VPRecipeBase InsertPt)
inline

Definition at line 71 of file LoopVectorizationPlanner.h.

References setInsertPoint().

Member Function Documentation

◆ clearInsertionPoint()

void llvm::VPBuilder::clearInsertionPoint ( )
inline

Clear the insertion point: created instructions will not be inserted into a block.

Definition at line 75 of file LoopVectorizationPlanner.h.

Referenced by restoreIP().

◆ createAnd()

VPValue * llvm::VPBuilder::createAnd ( VPValue LHS,
VPValue RHS,
DebugLoc  DL = {},
const Twine Name = "" 
)
inline

Definition at line 169 of file LoopVectorizationPlanner.h.

◆ createICmp()

VPValue * VPBuilder::createICmp ( CmpInst::Predicate  Pred,
VPValue A,
VPValue B,
DebugLoc  DL = {},
const Twine Name = "" 
)

Create a new ICmp VPInstruction with predicate Pred and operands A and B.

TODO: add createFCmp when needed.

Definition at line 7134 of file LoopVectorize.cpp.

References A, assert(), B, DL, llvm::CmpInst::FIRST_ICMP_PREDICATE, llvm::CmpInst::LAST_ICMP_PREDICATE, and Name.

Referenced by llvm::VPRecipeBuilder::createHeaderMask().

◆ createLogicalAnd()

VPValue * llvm::VPBuilder::createLogicalAnd ( VPValue LHS,
VPValue RHS,
DebugLoc  DL = {},
const Twine Name = "" 
)
inline

Definition at line 182 of file LoopVectorizationPlanner.h.

Referenced by llvm::VPRecipeBuilder::createEdgeMask().

◆ createNaryOp() [1/2]

VPInstruction * llvm::VPBuilder::createNaryOp ( unsigned  Opcode,
ArrayRef< VPValue * >  Operands,
DebugLoc  DL,
const Twine Name = "" 
)
inline

Definition at line 152 of file LoopVectorizationPlanner.h.

References DL, Name, and Operands.

◆ createNaryOp() [2/2]

VPInstruction * llvm::VPBuilder::createNaryOp ( unsigned  Opcode,
ArrayRef< VPValue * >  Operands,
Instruction Inst = nullptr,
const Twine Name = "" 
)
inline

Create an N-ary operation with Opcode, Operands and set Inst as its underlying Instruction.

Definition at line 142 of file LoopVectorizationPlanner.h.

References DL, Name, Operands, and llvm::VPValue::setUnderlyingValue().

Referenced by addCanonicalIVRecipes(), addVPLaneMaskPhiAndUpdateExitBranch(), and llvm::VPlanTransforms::adjustFixedOrderRecurrences().

◆ createNot()

VPValue * llvm::VPBuilder::createNot ( VPValue Operand,
DebugLoc  DL = {},
const Twine Name = "" 
)
inline

◆ createOr()

VPValue * llvm::VPBuilder::createOr ( VPValue LHS,
VPValue RHS,
DebugLoc  DL = {},
const Twine Name = "" 
)
inline

◆ createOverflowingOp()

VPInstruction * llvm::VPBuilder::createOverflowingOp ( unsigned  Opcode,
std::initializer_list< VPValue * >  Operands,
VPRecipeWithIRFlags::WrapFlagsTy  WrapFlags,
DebugLoc  DL = {},
const Twine Name = "" 
)
inline

◆ createSelect()

VPValue * llvm::VPBuilder::createSelect ( VPValue Cond,
VPValue TrueVal,
VPValue FalseVal,
DebugLoc  DL = {},
const Twine Name = "",
std::optional< FastMathFlags FMFs = std::nullopt 
)
inline

Definition at line 188 of file LoopVectorizationPlanner.h.

◆ getInsertBlock()

VPBasicBlock * llvm::VPBuilder::getInsertBlock ( ) const
inline

Definition at line 80 of file LoopVectorizationPlanner.h.

◆ getInsertPoint()

VPBasicBlock::iterator llvm::VPBuilder::getInsertPoint ( ) const
inline

Definition at line 81 of file LoopVectorizationPlanner.h.

◆ getToInsertAfter()

static VPBuilder llvm::VPBuilder::getToInsertAfter ( VPRecipeBase R)
inlinestatic

Create a VPBuilder to insert after R.

Definition at line 84 of file LoopVectorizationPlanner.h.

References B.

Referenced by llvm::VPlanTransforms::addActiveLaneMask().

◆ restoreIP()

void llvm::VPBuilder::restoreIP ( VPInsertPoint  IP)
inline

◆ setInsertPoint() [1/3]

void llvm::VPBuilder::setInsertPoint ( VPBasicBlock TheBB)
inline

This specifies that created VPInstructions should be appended to the end of the specified block.

Definition at line 120 of file LoopVectorizationPlanner.h.

References assert(), and llvm::VPBasicBlock::end().

Referenced by addVPLaneMaskPhiAndUpdateExitBranch(), llvm::VPlanTransforms::adjustFixedOrderRecurrences(), llvm::VPRecipeBuilder::createHeaderMask(), restoreIP(), and VPBuilder().

◆ setInsertPoint() [2/3]

void llvm::VPBuilder::setInsertPoint ( VPBasicBlock TheBB,
VPBasicBlock::iterator  IP 
)
inline

This specifies that created instructions should be inserted at the specified point.

Definition at line 128 of file LoopVectorizationPlanner.h.

◆ setInsertPoint() [3/3]

void llvm::VPBuilder::setInsertPoint ( VPRecipeBase IP)
inline

This specifies that created instructions should be inserted at the specified point.

Definition at line 135 of file LoopVectorizationPlanner.h.

References llvm::ilist_node_impl< OptionsT >::getIterator(), and llvm::VPRecipeBase::getParent().


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