LLVM 20.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)
 
 VPBuilder (VPBasicBlock *TheBB, VPBasicBlock::iterator IP)
 
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="")
 
VPInstructioncreateNaryOp (unsigned Opcode, std::initializer_list< VPValue * > Operands, std::optional< FastMathFlags > FMFs={}, 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.
 
VPInstructioncreatePtrAdd (VPValue *Ptr, VPValue *Offset, DebugLoc DL={}, const Twine &Name="")
 
VPValuecreateInBoundsPtrAdd (VPValue *Ptr, VPValue *Offset, DebugLoc DL={}, const Twine &Name="")
 
VPDerivedIVRecipecreateDerivedIV (InductionDescriptor::InductionKind Kind, FPMathOperator *FPBinOp, VPValue *Start, VPCanonicalIVPHIRecipe *CanonicalIV, VPValue *Step, const Twine &Name="")
 
VPScalarCastRecipecreateScalarCast (Instruction::CastOps Opcode, VPValue *Op, Type *ResultTy)
 
VPWidenCastRecipecreateWidenCast (Instruction::CastOps Opcode, VPValue *Op, Type *ResultTy)
 
VPScalarIVStepsRecipecreateScalarIVSteps (Instruction::BinaryOps InductionOpcode, FPMathOperator *FPBinOp, VPValue *IV, VPValue *Step)
 

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/4]

llvm::VPBuilder::VPBuilder ( )
default

◆ VPBuilder() [2/4]

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

Definition at line 70 of file LoopVectorizationPlanner.h.

References setInsertPoint().

◆ VPBuilder() [3/4]

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

Definition at line 71 of file LoopVectorizationPlanner.h.

References setInsertPoint().

◆ VPBuilder() [4/4]

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

Definition at line 72 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 78 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 182 of file LoopVectorizationPlanner.h.

◆ createDerivedIV()

VPDerivedIVRecipe * llvm::VPBuilder::createDerivedIV ( InductionDescriptor::InductionKind  Kind,
FPMathOperator FPBinOp,
VPValue Start,
VPCanonicalIVPHIRecipe CanonicalIV,
VPValue Step,
const Twine Name = "" 
)
inline

Definition at line 234 of file LoopVectorizationPlanner.h.

References Name.

Referenced by createScalarIVSteps().

◆ createICmp()

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

◆ createInBoundsPtrAdd()

VPValue * llvm::VPBuilder::createInBoundsPtrAdd ( VPValue Ptr,
VPValue Offset,
DebugLoc  DL = {},
const Twine Name = "" 
)
inline

Definition at line 228 of file LoopVectorizationPlanner.h.

◆ createLogicalAnd()

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

◆ createNaryOp() [1/3]

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

Definition at line 155 of file LoopVectorizationPlanner.h.

References DL, Name, and Operands.

◆ createNaryOp() [2/3]

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

◆ createNaryOp() [3/3]

VPInstruction * llvm::VPBuilder::createNaryOp ( unsigned  Opcode,
std::initializer_list< VPValue * >  Operands,
std::optional< FastMathFlags FMFs = {},
DebugLoc  DL = {},
const Twine Name = "" 
)
inline

Definition at line 159 of file LoopVectorizationPlanner.h.

◆ 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

◆ createPtrAdd()

VPInstruction * llvm::VPBuilder::createPtrAdd ( VPValue Ptr,
VPValue Offset,
DebugLoc  DL = {},
const Twine Name = "" 
)
inline

Definition at line 223 of file LoopVectorizationPlanner.h.

Referenced by legalizeAndOptimizeInductions().

◆ createScalarCast()

VPScalarCastRecipe * llvm::VPBuilder::createScalarCast ( Instruction::CastOps  Opcode,
VPValue Op,
Type ResultTy 
)
inline

Definition at line 242 of file LoopVectorizationPlanner.h.

Referenced by createScalarIVSteps().

◆ createScalarIVSteps()

VPScalarIVStepsRecipe * llvm::VPBuilder::createScalarIVSteps ( Instruction::BinaryOps  InductionOpcode,
FPMathOperator FPBinOp,
VPValue IV,
VPValue Step 
)
inline

Definition at line 253 of file LoopVectorizationPlanner.h.

References llvm::FPMathOperator::getFastMathFlags(), and IV.

Referenced by createScalarIVSteps().

◆ createSelect()

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

◆ createWidenCast()

VPWidenCastRecipe * llvm::VPBuilder::createWidenCast ( Instruction::CastOps  Opcode,
VPValue Op,
Type ResultTy 
)
inline

Definition at line 247 of file LoopVectorizationPlanner.h.

◆ getInsertBlock()

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

Definition at line 83 of file LoopVectorizationPlanner.h.

◆ getInsertPoint()

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

Definition at line 84 of file LoopVectorizationPlanner.h.

◆ getToInsertAfter()

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

Create a VPBuilder to insert after R.

Definition at line 87 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 123 of file LoopVectorizationPlanner.h.

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

Referenced by addVPLaneMaskPhiAndUpdateExitBranch(), llvm::VPlanTransforms::adjustFixedOrderRecurrences(), llvm::VPRecipeBuilder::createHeaderMask(), createScalarIVSteps(), 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 131 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 138 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 file: