Thanks to visit codestin.com
Credit goes to llvm.org

LLVM 22.0.0git
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.
void insert (VPRecipeBase *R)
 Insert R at the current insertion 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, ArrayRef< VPValue * > Operands, const VPIRFlags &Flags, DebugLoc DL=DebugLoc::getUnknown(), const Twine &Name="")
VPInstructioncreateNaryOp (unsigned Opcode, ArrayRef< VPValue * > Operands, Type *ResultTy, const VPIRFlags &Flags={}, DebugLoc DL=DebugLoc::getUnknown(), const Twine &Name="")
VPInstructioncreateOverflowingOp (unsigned Opcode, ArrayRef< VPValue * > Operands, VPRecipeWithIRFlags::WrapFlagsTy WrapFlags, DebugLoc DL=DebugLoc::getUnknown(), const Twine &Name="")
VPInstructioncreateNot (VPValue *Operand, DebugLoc DL=DebugLoc::getUnknown(), const Twine &Name="")
VPInstructioncreateAnd (VPValue *LHS, VPValue *RHS, DebugLoc DL=DebugLoc::getUnknown(), const Twine &Name="")
VPInstructioncreateOr (VPValue *LHS, VPValue *RHS, DebugLoc DL=DebugLoc::getUnknown(), const Twine &Name="")
VPInstructioncreateLogicalAnd (VPValue *LHS, VPValue *RHS, DebugLoc DL=DebugLoc::getUnknown(), const Twine &Name="")
VPInstructioncreateSelect (VPValue *Cond, VPValue *TrueVal, VPValue *FalseVal, DebugLoc DL=DebugLoc::getUnknown(), const Twine &Name="", std::optional< FastMathFlags > FMFs=std::nullopt)
VPInstructioncreateICmp (CmpInst::Predicate Pred, VPValue *A, VPValue *B, DebugLoc DL=DebugLoc::getUnknown(), const Twine &Name="")
 Create a new ICmp VPInstruction with predicate Pred and operands A and B.
VPInstructioncreateFCmp (CmpInst::Predicate Pred, VPValue *A, VPValue *B, DebugLoc DL=DebugLoc::getUnknown(), const Twine &Name="")
 Create a new FCmp VPInstruction with predicate Pred and operands A and B.
VPInstructioncreatePtrAdd (VPValue *Ptr, VPValue *Offset, DebugLoc DL=DebugLoc::getUnknown(), const Twine &Name="")
VPInstructioncreateNoWrapPtrAdd (VPValue *Ptr, VPValue *Offset, GEPNoWrapFlags GEPFlags, DebugLoc DL=DebugLoc::getUnknown(), const Twine &Name="")
VPInstructioncreateWidePtrAdd (VPValue *Ptr, VPValue *Offset, DebugLoc DL=DebugLoc::getUnknown(), const Twine &Name="")
VPPhicreateScalarPhi (ArrayRef< VPValue * > IncomingValues, DebugLoc DL, const Twine &Name="")
VPValuecreateElementCount (Type *Ty, ElementCount EC)
VPDerivedIVRecipecreateDerivedIV (InductionDescriptor::InductionKind Kind, FPMathOperator *FPBinOp, VPValue *Start, VPValue *Current, VPValue *Step, const Twine &Name="")
 Convert the input value Current to the corresponding value of an induction with Start and Step values, using Start + Current * Step.
VPInstructioncreateScalarCast (Instruction::CastOps Opcode, VPValue *Op, Type *ResultTy, DebugLoc DL)
VPValuecreateScalarZExtOrTrunc (VPValue *Op, Type *ResultTy, Type *SrcTy, DebugLoc DL)
VPWidenCastRecipecreateWidenCast (Instruction::CastOps Opcode, VPValue *Op, Type *ResultTy)
VPScalarIVStepsRecipecreateScalarIVSteps (Instruction::BinaryOps InductionOpcode, FPMathOperator *FPBinOp, VPValue *IV, VPValue *Step, VPValue *VF, DebugLoc DL)
VPExpandSCEVRecipecreateExpandSCEV (const SCEV *Expr)

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 54 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 73 of file LoopVectorizationPlanner.h.

References setInsertPoint().

◆ VPBuilder() [3/4]

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

Definition at line 74 of file LoopVectorizationPlanner.h.

References setInsertPoint().

◆ VPBuilder() [4/4]

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

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

Referenced by restoreIP().

◆ createAnd()

VPInstruction * llvm::VPBuilder::createAnd ( VPValue * LHS,
VPValue * RHS,
DebugLoc DL = DebugLoc::getUnknown(),
const Twine & Name = "" )
inline

Definition at line 196 of file LoopVectorizationPlanner.h.

References DL, llvm::DebugLoc::getUnknown(), LHS, and RHS.

◆ createDerivedIV()

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

Convert the input value Current to the corresponding value of an induction with Start and Step values, using Start + Current * Step.

Definition at line 298 of file LoopVectorizationPlanner.h.

Referenced by addResumePhiRecipeForInduction().

◆ createElementCount()

◆ createExpandSCEV()

VPExpandSCEVRecipe * llvm::VPBuilder::createExpandSCEV ( const SCEV * Expr)
inline

Definition at line 337 of file LoopVectorizationPlanner.h.

◆ createFCmp()

VPInstruction * llvm::VPBuilder::createFCmp ( CmpInst::Predicate Pred,
VPValue * A,
VPValue * B,
DebugLoc DL = DebugLoc::getUnknown(),
const Twine & Name = "" )
inline

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

Definition at line 243 of file LoopVectorizationPlanner.h.

References A(), assert(), B(), DL, llvm::CmpInst::FIRST_FCMP_PREDICATE, llvm::DebugLoc::getUnknown(), and llvm::CmpInst::LAST_FCMP_PREDICATE.

◆ createICmp()

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

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

Definition at line 232 of file LoopVectorizationPlanner.h.

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

◆ createLogicalAnd()

VPInstruction * llvm::VPBuilder::createLogicalAnd ( VPValue * LHS,
VPValue * RHS,
DebugLoc DL = DebugLoc::getUnknown(),
const Twine & Name = "" )
inline

◆ createNaryOp() [1/4]

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

Definition at line 165 of file LoopVectorizationPlanner.h.

References DL, llvm::DebugLoc::getUnknown(), and Operands.

◆ createNaryOp() [2/4]

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

Definition at line 161 of file LoopVectorizationPlanner.h.

References DL, and Operands.

◆ createNaryOp() [3/4]

◆ createNaryOp() [4/4]

VPInstruction * llvm::VPBuilder::createNaryOp ( unsigned Opcode,
ArrayRef< VPValue * > Operands,
Type * ResultTy,
const VPIRFlags & Flags = {},
DebugLoc DL = DebugLoc::getUnknown(),
const Twine & Name = "" )
inline

Definition at line 173 of file LoopVectorizationPlanner.h.

References Operands.

◆ createNot()

VPInstruction * llvm::VPBuilder::createNot ( VPValue * Operand,
DebugLoc DL = DebugLoc::getUnknown(),
const Twine & Name = "" )
inline

◆ createNoWrapPtrAdd()

VPInstruction * llvm::VPBuilder::createNoWrapPtrAdd ( VPValue * Ptr,
VPValue * Offset,
GEPNoWrapFlags GEPFlags,
DebugLoc DL = DebugLoc::getUnknown(),
const Twine & Name = "" )
inline

◆ createOr()

VPInstruction * llvm::VPBuilder::createOr ( VPValue * LHS,
VPValue * RHS,
DebugLoc DL = DebugLoc::getUnknown(),
const Twine & Name = "" )
inline

Definition at line 202 of file LoopVectorizationPlanner.h.

References DL, llvm::DebugLoc::getUnknown(), LHS, and RHS.

◆ createOverflowingOp()

VPInstruction * llvm::VPBuilder::createOverflowingOp ( unsigned Opcode,
ArrayRef< VPValue * > Operands,
VPRecipeWithIRFlags::WrapFlagsTy WrapFlags,
DebugLoc DL = DebugLoc::getUnknown(),
const Twine & Name = "" )
inline

Definition at line 181 of file LoopVectorizationPlanner.h.

References DL, llvm::DebugLoc::getUnknown(), and Operands.

Referenced by createElementCount().

◆ createPtrAdd()

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

◆ createScalarCast()

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

Definition at line 306 of file LoopVectorizationPlanner.h.

References DL.

Referenced by addResumePhiRecipeForInduction(), and createScalarZExtOrTrunc().

◆ createScalarIVSteps()

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

Definition at line 329 of file LoopVectorizationPlanner.h.

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

◆ createScalarPhi()

VPPhi * llvm::VPBuilder::createScalarPhi ( ArrayRef< VPValue * > IncomingValues,
DebugLoc DL,
const Twine & Name = "" )
inline

◆ createScalarZExtOrTrunc()

VPValue * llvm::VPBuilder::createScalarZExtOrTrunc ( VPValue * Op,
Type * ResultTy,
Type * SrcTy,
DebugLoc DL )
inline

◆ createSelect()

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

Definition at line 219 of file LoopVectorizationPlanner.h.

References Cond, DL, llvm::DebugLoc::getUnknown(), and Select.

◆ createWidenCast()

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

Definition at line 323 of file LoopVectorizationPlanner.h.

◆ createWidePtrAdd()

VPInstruction * llvm::VPBuilder::createWidePtrAdd ( VPValue * Ptr,
VPValue * Offset,
DebugLoc DL = DebugLoc::getUnknown(),
const Twine & Name = "" )
inline

◆ getInsertBlock()

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

◆ getInsertPoint()

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

◆ getToInsertAfter()

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

Create a VPBuilder to insert after R.

Definition at line 90 of file LoopVectorizationPlanner.h.

References B(), and VPBuilder().

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

◆ insert()

void llvm::VPBuilder::insert ( VPRecipeBase * R)
inline

Insert R at the current insertion point.

Definition at line 147 of file LoopVectorizationPlanner.h.

◆ 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 126 of file LoopVectorizationPlanner.h.

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

Referenced by llvm::VPlanTransforms::adjustFixedOrderRecurrences(), restoreIP(), VPBuilder(), VPBuilder(), 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 134 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 141 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: