LLVM 20.0.0git
Classes | Namespaces | Macros | Typedefs | Functions
VPlan.h File Reference

This file contains the declarations of the Vectorization Plan base classes: More...

#include "VPlanAnalysis.h"
#include "VPlanValue.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/MapVector.h"
#include "llvm/ADT/SmallBitVector.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/Twine.h"
#include "llvm/ADT/ilist.h"
#include "llvm/ADT/ilist_node.h"
#include "llvm/Analysis/DomTreeUpdater.h"
#include "llvm/Analysis/IVDescriptors.h"
#include "llvm/Analysis/LoopInfo.h"
#include "llvm/Analysis/VectorUtils.h"
#include "llvm/IR/DebugLoc.h"
#include "llvm/IR/FMF.h"
#include "llvm/IR/Operator.h"
#include "llvm/Support/InstructionCost.h"
#include <algorithm>
#include <cassert>
#include <cstddef>
#include <string>

Go to the source code of this file.

Classes

struct  llvm::VFRange
 A range of powers-of-2 vectorization factors with fixed start and adjustable end. More...
 
class  llvm::VFRange::iterator
 Iterator to iterate over vectorization factors in a VFRange. More...
 
class  llvm::VPLane
 In what follows, the term "input IR" refers to code that is fed into the vectorizer whereas the term "output IR" refers to code that is generated by the vectorizer. More...
 
struct  llvm::VPIteration
 VPIteration represents a single point in the iteration space of the output (vectorized and/or unrolled) IR loop. More...
 
struct  llvm::VPTransformState
 VPTransformState holds information passed down when "executing" a VPlan, needed for generating the output IR. More...
 
struct  llvm::VPTransformState::DataState
 
struct  llvm::VPTransformState::CFGState
 Hold state information used when constructing the CFG of the output IR, traversing the VPBasicBlocks and generating corresponding IR BasicBlocks. More...
 
class  llvm::VPBlockBase
 VPBlockBase is the building block of the Hierarchical Control-Flow Graph. More...
 
class  llvm::VPLiveOut
 A value that is used outside the VPlan. More...
 
struct  llvm::VPCostContext
 Struct to hold various analysis needed for cost computations. More...
 
class  llvm::VPRecipeBase
 VPRecipeBase is a base class modeling a sequence of one or more output IR instructions. More...
 
class  llvm::VPSingleDefRecipe
 VPSingleDef is a base class for recipes for modeling a sequence of one or more output IR that define a single result VPValue. More...
 
class  llvm::VPRecipeWithIRFlags
 Class to record LLVM IR flag for a recipe along with it. More...
 
struct  llvm::VPRecipeWithIRFlags::WrapFlagsTy
 
struct  llvm::VPRecipeWithIRFlags::DisjointFlagsTy
 
struct  llvm::VPRecipeWithIRFlags::GEPFlagsTy
 
class  llvm::VPInstruction
 This is a concrete Recipe that models a single VPlan-level instruction. More...
 
class  llvm::VPWidenRecipe
 VPWidenRecipe is a recipe for producing a widened instruction using the opcode and operands of the recipe. More...
 
class  llvm::VPWidenCastRecipe
 VPWidenCastRecipe is a recipe to create vector cast instructions. More...
 
class  llvm::VPScalarCastRecipe
 VPScalarCastRecipe is a recipe to create scalar cast instructions. More...
 
class  llvm::VPWidenCallRecipe
 A recipe for widening Call instructions. More...
 
struct  llvm::VPWidenSelectRecipe
 A recipe for widening select instructions. More...
 
class  llvm::VPWidenGEPRecipe
 A recipe for handling GEP instructions. More...
 
class  llvm::VPVectorPointerRecipe
 A recipe to compute the pointers for widened memory accesses of IndexTy for all parts. More...
 
class  llvm::VPHeaderPHIRecipe
 A pure virtual base class for all recipes modeling header phis, including phis for first order recurrences, pointer inductions and reductions. More...
 
class  llvm::VPWidenIntOrFpInductionRecipe
 A recipe for handling phi nodes of integer and floating-point inductions, producing their vector values. More...
 
class  llvm::VPWidenPointerInductionRecipe
 
class  llvm::VPWidenPHIRecipe
 A recipe for handling phis that are widened in the vector loop. More...
 
struct  llvm::VPFirstOrderRecurrencePHIRecipe
 A recipe for handling first-order recurrence phis. More...
 
class  llvm::VPReductionPHIRecipe
 A recipe for handling reduction phis. More...
 
class  llvm::VPBlendRecipe
 A recipe for vectorizing a phi-node as a sequence of mask-based select instructions. More...
 
class  llvm::VPInterleaveRecipe
 VPInterleaveRecipe is a recipe for transforming an interleave group of load or stores into one wide load/store and shuffles. More...
 
class  llvm::VPReductionRecipe
 A recipe to represent inloop reduction operations, performing a reduction on a vector operand into a scalar value, and adding the result to a chain. More...
 
class  llvm::VPReductionEVLRecipe
 A recipe to represent inloop reduction operations with vector-predication intrinsics, performing a reduction on a vector operand with the explicit vector length (EVL) into a scalar value, and adding the result to a chain. More...
 
class  llvm::VPReplicateRecipe
 VPReplicateRecipe replicates a given instruction producing multiple scalar copies of the original scalar type, one per lane, instead of producing a single copy of widened type for all lanes. More...
 
class  llvm::VPBranchOnMaskRecipe
 A recipe for generating conditional branches on the bits of a mask. More...
 
class  llvm::VPPredInstPHIRecipe
 VPPredInstPHIRecipe is a recipe for generating the phi nodes needed when control converges back from a Branch-on-Mask. More...
 
class  llvm::VPWidenMemoryRecipe
 A common base class for widening memory operations. More...
 
struct  llvm::VPWidenLoadRecipe
 A recipe for widening load operations, using the address to load from and an optional mask. More...
 
struct  llvm::VPWidenLoadEVLRecipe
 A recipe for widening load operations with vector-predication intrinsics, using the address to load from, the explicit vector length and an optional mask. More...
 
struct  llvm::VPWidenStoreRecipe
 A recipe for widening store operations, using the stored value, the address to store to and an optional mask. More...
 
struct  llvm::VPWidenStoreEVLRecipe
 A recipe for widening store operations with vector-predication intrinsics, using the value to store, the address to store to, the explicit vector length and an optional mask. More...
 
class  llvm::VPExpandSCEVRecipe
 Recipe to expand a SCEV expression. More...
 
class  llvm::VPCanonicalIVPHIRecipe
 Canonical scalar induction phi of the vector loop. More...
 
class  llvm::VPActiveLaneMaskPHIRecipe
 A recipe for generating the active lane mask for the vector loop that is used to predicate the vector operations. More...
 
class  llvm::VPEVLBasedIVPHIRecipe
 A recipe for generating the phi node for the current index of elements, adjusted in accordance with EVL value. More...
 
class  llvm::VPWidenCanonicalIVRecipe
 A Recipe for widening the canonical induction variable of the vector loop. More...
 
class  llvm::VPDerivedIVRecipe
 A recipe for converting the input value IV value to the corresponding value of an IV with different start and step values, using Start + IV * Step. More...
 
class  llvm::VPScalarIVStepsRecipe
 A recipe for handling phi nodes of integer and floating-point inductions, producing their scalar values. More...
 
class  llvm::VPBasicBlock
 VPBasicBlock serves as the leaf of the Hierarchical Control-Flow Graph. More...
 
class  llvm::VPIRBasicBlock
 A special type of VPBasicBlock that wraps an existing IR basic block. More...
 
class  llvm::VPRegionBlock
 VPRegionBlock represents a collection of VPBasicBlocks and VPRegionBlocks which form a Single-Entry-Single-Exiting subgraph of the output IR CFG. More...
 
class  llvm::VPlan
 VPlan models a candidate for vectorization, encoding various decisions take to produce efficient output IR, including which branches, basic-blocks and output IR instructions to generate, and their cost. More...
 
class  llvm::VPlanPrinter
 VPlanPrinter prints a given VPlan to a given output stream. More...
 
struct  llvm::VPlanIngredient
 
class  llvm::VPBlockUtils
 Class that provides utilities for VPBlockBases in VPlan. More...
 
class  llvm::VPInterleavedAccessInfo
 
class  llvm::VPlanSlp
 Class that maps (parts of) an existing VPlan to trees of combined VPInstructions. More...
 

Namespaces

namespace  llvm
 This is an optimization pass for GlobalISel generic memory operations.
 
namespace  llvm::Intrinsic
 This namespace contains an enum with a value for every intrinsic/builtin function known by LLVM.
 
namespace  llvm::vputils
 

Macros

#define VP_CLASSOF_IMPL(VPDefID)
 

Typedefs

using llvm::VPlanPtr = std::unique_ptr< VPlan >
 

Functions

Valuellvm::getRuntimeVF (IRBuilderBase &B, Type *Ty, ElementCount VF)
 Return the runtime value for VF.
 
Valuellvm::createStepForVF (IRBuilderBase &B, Type *Ty, ElementCount VF, int64_t Step)
 Return a value for Step multiplied by VF.
 
const SCEVllvm::createTripCountSCEV (Type *IdxTy, PredicatedScalarEvolution &PSE, Loop *OrigLoop)
 
unsigned llvm::getReciprocalPredBlockProb ()
 A helper function that returns the reciprocal of the block probability of predicated blocks.
 
raw_ostream & llvm::operator<< (raw_ostream &OS, const VPlanIngredient &I)
 
raw_ostream & llvm::operator<< (raw_ostream &OS, const VPlan &Plan)
 
bool llvm::vputils::onlyFirstLaneUsed (const VPValue *Def)
 Returns true if only the first lane of Def is used.
 
bool llvm::vputils::onlyFirstPartUsed (const VPValue *Def)
 Returns true if only the first part of Def is used.
 
VPValuellvm::vputils::getOrCreateVPValueForSCEVExpr (VPlan &Plan, const SCEV *Expr, ScalarEvolution &SE)
 Get or create a VPValue that corresponds to the expansion of Expr.
 
bool llvm::vputils::isUniformAfterVectorization (const VPValue *VPV)
 Returns true if VPV is uniform after vectorization.
 
bool llvm::vputils::isHeaderMask (const VPValue *V, VPlan &Plan)
 Return true if V is a header mask in Plan.
 

Detailed Description

This file contains the declarations of the Vectorization Plan base classes:

  1. VPBasicBlock and VPRegionBlock that inherit from a common pure virtual VPBlockBase, together implementing a Hierarchical CFG;
  2. Pure virtual VPRecipeBase serving as the base class for recipes contained within VPBasicBlocks;
  3. Pure virtual VPSingleDefRecipe serving as a base class for recipes that also inherit from VPValue.
  4. VPInstruction, a concrete Recipe and VPUser modeling a single planned instruction;
  5. The VPlan class holding a candidate for vectorization;
  6. The VPlanPrinter class providing a way to print a plan in dot format; These are documented in docs/VectorizationPlan.rst.

Definition in file VPlan.h.

Macro Definition Documentation

◆ VP_CLASSOF_IMPL

#define VP_CLASSOF_IMPL (   VPDefID)
Value:
static inline bool classof(const VPDef *D) { \
return D->getVPDefID() == VPDefID; \
} \
static inline bool classof(const VPValue *V) { \
auto *R = V->getDefiningRecipe(); \
return R && R->getVPDefID() == VPDefID; \
} \
static inline bool classof(const VPUser *U) { \
auto *R = dyn_cast<VPRecipeBase>(U); \
return R && R->getVPDefID() == VPDefID; \
} \
static inline bool classof(const VPRecipeBase *R) { \
return R->getVPDefID() == VPDefID; \
} \
static inline bool classof(const VPSingleDefRecipe *R) { \
return R->getVPDefID() == VPDefID; \
}
static GCRegistry::Add< StatepointGC > D("statepoint-example", "an example strategy for statepoint")

Definition at line 873 of file VPlan.h.