LLVM  16.0.0git
Public Member Functions | List of all members
llvm::InnerLoopUnroller Class Reference
Inheritance diagram for llvm::InnerLoopUnroller:
Inheritance graph
[legend]
Collaboration diagram for llvm::InnerLoopUnroller:
Collaboration graph
[legend]

Public Member Functions

 InnerLoopUnroller (Loop *OrigLoop, PredicatedScalarEvolution &PSE, LoopInfo *LI, DominatorTree *DT, const TargetLibraryInfo *TLI, const TargetTransformInfo *TTI, AssumptionCache *AC, OptimizationRemarkEmitter *ORE, unsigned UnrollFactor, LoopVectorizationLegality *LVL, LoopVectorizationCostModel *CM, BlockFrequencyInfo *BFI, ProfileSummaryInfo *PSI, GeneratedRTChecks &Check)
 
- Public Member Functions inherited from llvm::InnerLoopVectorizer
 InnerLoopVectorizer (Loop *OrigLoop, PredicatedScalarEvolution &PSE, LoopInfo *LI, DominatorTree *DT, const TargetLibraryInfo *TLI, const TargetTransformInfo *TTI, AssumptionCache *AC, OptimizationRemarkEmitter *ORE, ElementCount VecWidth, ElementCount MinProfitableTripCount, unsigned UnrollFactor, LoopVectorizationLegality *LVL, LoopVectorizationCostModel *CM, BlockFrequencyInfo *BFI, ProfileSummaryInfo *PSI, GeneratedRTChecks &RTChecks)
 
virtual ~InnerLoopVectorizer ()=default
 
virtual std::pair< BasicBlock *, Value * > createVectorizedLoopSkeleton ()
 Create a new empty loop that will contain vectorized instructions later on, while the old loop will be used as the scalar remainder. More...
 
void widenCallInstruction (CallInst &CI, VPValue *Def, VPUser &ArgOperands, VPTransformState &State)
 Widen a single call instruction within the innermost loop. More...
 
void fixVectorizedLoop (VPTransformState &State, VPlan &Plan)
 Fix the vectorized code, taking care of header phi's, live-outs, and more. More...
 
bool areSafetyChecksAdded ()
 
void scalarizeInstruction (Instruction *Instr, VPReplicateRecipe *RepRecipe, const VPIteration &Instance, bool IfPredicateInstr, VPTransformState &State)
 A helper function to scalarize a single Instruction in the innermost loop. More...
 
void packScalarIntoVectorValue (VPValue *Def, const VPIteration &Instance, VPTransformState &State)
 Construct the vector value of a scalarized value V one lane at a time. More...
 
void vectorizeInterleaveGroup (const InterleaveGroup< Instruction > *Group, ArrayRef< VPValue * > VPDefs, VPTransformState &State, VPValue *Addr, ArrayRef< VPValue * > StoredValues, VPValue *BlockInMask=nullptr)
 Try to vectorize interleaved access group Group with the base address given in Addr, optionally masking the vector operations if BlockInMask is non-null. More...
 
void fixNonInductionPHIs (VPlan &Plan, VPTransformState &State)
 Fix the non-induction PHIs in Plan. More...
 
bool useOrderedReductions (const RecurrenceDescriptor &RdxDesc)
 Returns true if the reordering of FP operations is not allowed, but we are able to vectorize with strict in-order reductions for the given RdxDesc. More...
 
PHINodegetReductionResumeValue (const RecurrenceDescriptor &RdxDesc)
 

Additional Inherited Members

- Public Types inherited from llvm::InnerLoopVectorizer
using VectorParts = SmallVector< Value *, 2 >
 A type for vectorized values in the new loop. More...
 
- Protected Types inherited from llvm::InnerLoopVectorizer
using PhiVector = SmallVector< PHINode *, 4 >
 A small list of PHINodes. More...
 
using ScalarParts = SmallVector< SmallVector< Value *, 4 >, 2 >
 A type for scalarized values in the new loop. More...
 
- Protected Member Functions inherited from llvm::InnerLoopVectorizer
void fixupIVUsers (PHINode *OrigPhi, const InductionDescriptor &II, Value *VectorTripCount, Value *EndValue, BasicBlock *MiddleBlock, BasicBlock *VectorHeader, VPlan &Plan)
 Set up the values of the IVs correctly when exiting the vector loop. More...
 
void fixCrossIterationPHIs (VPTransformState &State)
 Handle all cross-iteration phis in the header. More...
 
void fixFirstOrderRecurrence (VPFirstOrderRecurrencePHIRecipe *PhiR, VPTransformState &State)
 Create the exit value of first order recurrences in the middle block and update their users. More...
 
void fixReduction (VPReductionPHIRecipe *Phi, VPTransformState &State)
 Create code for the loop exit value of the reduction. More...
 
void clearReductionWrapFlags (VPReductionPHIRecipe *PhiR, VPTransformState &State)
 Clear NSW/NUW flags from reduction instructions if necessary. More...
 
void sinkScalarOperands (Instruction *PredInst)
 Iteratively sink the scalarized operands of a predicated instruction into the block that was created for it. More...
 
void truncateToMinimalBitwidths (VPTransformState &State)
 Shrinks vector element sizes to the smallest bitwidth they can be legally represented as. More...
 
ValuegetOrCreateTripCount (BasicBlock *InsertBlock)
 Returns (and creates if needed) the original loop trip count. More...
 
ValuegetOrCreateVectorTripCount (BasicBlock *InsertBlock)
 Returns (and creates if needed) the trip count of the widened loop. More...
 
ValuecreateBitOrPointerCast (Value *V, VectorType *DstVTy, const DataLayout &DL)
 Returns a bitcasted value to the requested vector type. More...
 
void emitIterationCountCheck (BasicBlock *Bypass)
 Emit a bypass check to see if the vector trip count is zero, including if it overflows. More...
 
BasicBlockemitSCEVChecks (BasicBlock *Bypass)
 Emit a bypass check to see if all of the SCEV assumptions we've had to make are correct. More...
 
BasicBlockemitMemRuntimeChecks (BasicBlock *Bypass)
 Emit bypass checks to check any memory assumptions we may have made. More...
 
void createVectorLoopSkeleton (StringRef Prefix)
 Emit basic blocks (prefixed with Prefix) for the iteration check, vector loop preheader, middle block and scalar preheader. More...
 
void createInductionResumeValues (std::pair< BasicBlock *, Value * > AdditionalBypass={nullptr, nullptr})
 Create new phi nodes for the induction variables to resume iteration count in the scalar epilogue, from where the vectorized loop left off. More...
 
BasicBlockcompleteLoopSkeleton (MDNode *OrigLoopID)
 Complete the loop skeleton by adding debug MDs, creating appropriate conditional branches in the middle block, preparing the builder and running the verifier. More...
 
void collectPoisonGeneratingRecipes (VPTransformState &State)
 Collect poison-generating recipes that may generate a poison value that is used after vectorization, even when their operands are not poison. More...
 
virtual void printDebugTracesAtStart ()
 Allow subclasses to override and print debug traces before/after vplan execution, when trace information is requested. More...
 
virtual void printDebugTracesAtEnd ()
 
- Protected Attributes inherited from llvm::InnerLoopVectorizer
LoopOrigLoop
 The original loop. More...
 
PredicatedScalarEvolutionPSE
 A wrapper around ScalarEvolution used to add runtime SCEV checks. More...
 
LoopInfoLI
 Loop Info. More...
 
DominatorTreeDT
 Dominator Tree. More...
 
AAResultsAA
 Alias Analysis. More...
 
const TargetLibraryInfoTLI
 Target Library Info. More...
 
const TargetTransformInfoTTI
 Target Transform Info. More...
 
AssumptionCacheAC
 Assumption Cache. More...
 
OptimizationRemarkEmitterORE
 Interface to emit optimization remarks. More...
 
ElementCount VF
 The vectorization SIMD factor to use. More...
 
ElementCount MinProfitableTripCount
 
unsigned UF
 The vectorization unroll factor to use. More...
 
IRBuilder Builder
 The builder that we use. More...
 
BasicBlockLoopVectorPreHeader
 The vector-loop preheader. More...
 
BasicBlockLoopScalarPreHeader
 The scalar-loop preheader. More...
 
BasicBlockLoopMiddleBlock
 Middle Block between the vector and the scalar. More...
 
BasicBlockLoopExitBlock
 The unique ExitBlock of the scalar loop if one exists. More...
 
BasicBlockLoopScalarBody
 The scalar loop body. More...
 
SmallVector< BasicBlock *, 4 > LoopBypassBlocks
 A list of all bypass blocks. The first block is the entry of the loop. More...
 
SmallVector< Instruction *, 4 > PredicatedInstructions
 Store instructions that were predicated. More...
 
ValueTripCount = nullptr
 Trip count of the original loop. More...
 
ValueVectorTripCount = nullptr
 Trip count of the widened loop (TripCount - TripCount % (VF*UF)) More...
 
LoopVectorizationLegalityLegal
 The legality analysis. More...
 
LoopVectorizationCostModelCost
 The profitablity analysis. More...
 
bool AddedSafetyChecks = false
 
DenseMap< PHINode *, Value * > IVEndValues
 
BlockFrequencyInfoBFI
 BFI and PSI are used to check for profile guided size optimizations. More...
 
ProfileSummaryInfoPSI
 
bool OptForSizeBasedOnProfile
 
GeneratedRTChecksRTChecks
 Structure to hold information about generated runtime checks, responsible for cleaning the checks, if vectorization turns out unprofitable. More...
 
SmallMapVector< const RecurrenceDescriptor *, PHINode *, 4 > ReductionResumeValues
 

Detailed Description

Definition at line 735 of file LoopVectorize.cpp.

Constructor & Destructor Documentation

◆ InnerLoopUnroller()

llvm::InnerLoopUnroller::InnerLoopUnroller ( Loop OrigLoop,
PredicatedScalarEvolution PSE,
LoopInfo LI,
DominatorTree DT,
const TargetLibraryInfo TLI,
const TargetTransformInfo TTI,
AssumptionCache AC,
OptimizationRemarkEmitter ORE,
unsigned  UnrollFactor,
LoopVectorizationLegality LVL,
LoopVectorizationCostModel CM,
BlockFrequencyInfo BFI,
ProfileSummaryInfo PSI,
GeneratedRTChecks Check 
)
inline

Definition at line 737 of file LoopVectorize.cpp.


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