LLVM
16.0.0git
|
A specialized derived class of inner loop vectorizer that performs vectorization of main loops in the process of vectorizing loops and their epilogues. More...
Protected Member Functions | |
BasicBlock * | emitIterationCountCheck (BasicBlock *Bypass, bool ForEpilogue) |
Emits an iteration count bypass check once for the main loop (when ForEpilogue is false) and once for the epilogue loop (when ForEpilogue is true). More... | |
void | printDebugTracesAtStart () override |
Allow subclasses to override and print debug traces before/after vplan execution, when trace information is requested. More... | |
void | printDebugTracesAtEnd () override |
![]() | |
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... | |
Value * | getOrCreateTripCount (BasicBlock *InsertBlock) |
Returns (and creates if needed) the original loop trip count. More... | |
Value * | getOrCreateVectorTripCount (BasicBlock *InsertBlock) |
Returns (and creates if needed) the trip count of the widened loop. More... | |
Value * | createBitOrPointerCast (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... | |
BasicBlock * | emitSCEVChecks (BasicBlock *Bypass) |
Emit a bypass check to see if all of the SCEV assumptions we've had to make are correct. More... | |
BasicBlock * | emitMemRuntimeChecks (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... | |
BasicBlock * | completeLoopSkeleton (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... | |
Additional Inherited Members | |
![]() | |
using | VectorParts = SmallVector< Value *, 2 > |
A type for vectorized values in the new loop. More... | |
![]() | |
EpilogueLoopVectorizationInfo & | EPI |
Holds and updates state information required to vectorize the main loop and its epilogue in two separate passes. More... | |
![]() | |
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... | |
![]() | |
Loop * | OrigLoop |
The original loop. More... | |
PredicatedScalarEvolution & | PSE |
A wrapper around ScalarEvolution used to add runtime SCEV checks. More... | |
LoopInfo * | LI |
Loop Info. More... | |
DominatorTree * | DT |
Dominator Tree. More... | |
AAResults * | AA |
Alias Analysis. More... | |
const TargetLibraryInfo * | TLI |
Target Library Info. More... | |
const TargetTransformInfo * | TTI |
Target Transform Info. More... | |
AssumptionCache * | AC |
Assumption Cache. More... | |
OptimizationRemarkEmitter * | ORE |
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... | |
BasicBlock * | LoopVectorPreHeader |
The vector-loop preheader. More... | |
BasicBlock * | LoopScalarPreHeader |
The scalar-loop preheader. More... | |
BasicBlock * | LoopMiddleBlock |
Middle Block between the vector and the scalar. More... | |
BasicBlock * | LoopExitBlock |
The unique ExitBlock of the scalar loop if one exists. More... | |
BasicBlock * | LoopScalarBody |
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... | |
Value * | TripCount = nullptr |
Trip count of the original loop. More... | |
Value * | VectorTripCount = nullptr |
Trip count of the widened loop (TripCount - TripCount % (VF*UF)) More... | |
LoopVectorizationLegality * | Legal |
The legality analysis. More... | |
LoopVectorizationCostModel * | Cost |
The profitablity analysis. More... | |
bool | AddedSafetyChecks = false |
DenseMap< PHINode *, Value * > | IVEndValues |
BlockFrequencyInfo * | BFI |
BFI and PSI are used to check for profile guided size optimizations. More... | |
ProfileSummaryInfo * | PSI |
bool | OptForSizeBasedOnProfile |
GeneratedRTChecks & | RTChecks |
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 |
A specialized derived class of inner loop vectorizer that performs vectorization of main loops in the process of vectorizing loops and their epilogues.
Definition at line 823 of file LoopVectorize.cpp.
|
inline |
Definition at line 825 of file LoopVectorize.cpp.
|
finalvirtual |
Implements the interface for creating a vectorized skeleton using the main loop strategy (ie the first pass of vplan execution).
This function is partially responsible for generating the control flow depicted in https://llvm.org/docs/Vectorizers.html#epilogue-vectorization.
Implements llvm::InnerLoopAndEpilogueVectorizer.
Definition at line 7678 of file LoopVectorize.cpp.
References llvm::InnerLoopVectorizer::completeLoopSkeleton(), llvm::InnerLoopVectorizer::createVectorLoopSkeleton(), emitIterationCountCheck(), llvm::InnerLoopVectorizer::emitMemRuntimeChecks(), llvm::InnerLoopVectorizer::emitSCEVChecks(), llvm::InnerLoopAndEpilogueVectorizer::EPI, llvm::EpilogueLoopVectorizationInfo::EpilogueIterationCountCheck, llvm::Loop::getLoopID(), llvm::LoopBase< BlockT, LoopT >::getLoopPreheader(), llvm::InnerLoopVectorizer::getOrCreateTripCount(), llvm::InnerLoopVectorizer::getOrCreateVectorTripCount(), llvm::InnerLoopVectorizer::LoopScalarPreHeader, llvm::InnerLoopVectorizer::LoopVectorPreHeader, llvm::EpilogueLoopVectorizationInfo::MainLoopIterationCountCheck, llvm::EpilogueLoopVectorizationInfo::MemSafetyCheck, llvm::InnerLoopVectorizer::OrigLoop, llvm::EpilogueLoopVectorizationInfo::SCEVSafetyCheck, llvm::Value::setName(), and llvm::EpilogueLoopVectorizationInfo::VectorTripCount.
|
protected |
Emits an iteration count bypass check once for the main loop (when ForEpilogue
is false) and once for the epilogue loop (when ForEpilogue
is true).
Definition at line 7744 of file LoopVectorize.cpp.
References assert(), llvm::InnerLoopVectorizer::Builder, llvm::DominatorTreeBase< NodeT, IsPostDom >::changeImmediateDominator(), llvm::InnerLoopVectorizer::Cost, llvm::BranchInst::Create(), llvm::IRBuilderBase::CreateICmp(), llvm::createStepForVF(), llvm::InnerLoopVectorizer::DT, llvm::InnerLoopAndEpilogueVectorizer::EPI, llvm::EpilogueLoopVectorizationInfo::EpilogueUF, llvm::EpilogueLoopVectorizationInfo::EpilogueVF, llvm::DomTreeNodeBase< NodeT >::getIDom(), llvm::DominatorTreeBase< NodeT, IsPostDom >::getNode(), llvm::InnerLoopVectorizer::getOrCreateTripCount(), llvm::BasicBlock::getTerminator(), llvm::Value::getType(), llvm::CmpInst::ICMP_ULE, llvm::CmpInst::ICMP_ULT, llvm::InnerLoopVectorizer::LI, llvm::InnerLoopVectorizer::LoopBypassBlocks, llvm::InnerLoopVectorizer::LoopExitBlock, llvm::InnerLoopVectorizer::LoopVectorPreHeader, P, llvm::DominatorTreeBase< NodeT, IsPostDom >::properlyDominates(), llvm::ReplaceInstWithInst(), llvm::LoopVectorizationCostModel::requiresScalarEpilogue(), llvm::Value::setName(), llvm::SplitBlock(), llvm::EpilogueLoopVectorizationInfo::TripCount, llvm::InnerLoopVectorizer::UF, and llvm::InnerLoopVectorizer::VF.
Referenced by createEpilogueVectorizedLoopSkeleton(), and llvm::InnerLoopVectorizer::createVectorizedLoopSkeleton().
|
overrideprotectedvirtual |
Reimplemented from llvm::InnerLoopVectorizer.
Definition at line 7736 of file LoopVectorize.cpp.
References llvm::dbgs(), DEBUG_WITH_TYPE, llvm::LoopBase< BlockT, LoopT >::getHeader(), llvm::BasicBlock::getParent(), llvm::InnerLoopVectorizer::OrigLoop, and VerboseDebug.
|
overrideprotectedvirtual |
Allow subclasses to override and print debug traces before/after vplan execution, when trace information is requested.
Reimplemented from llvm::InnerLoopVectorizer.
Definition at line 7726 of file LoopVectorize.cpp.
References llvm::dbgs(), llvm::InnerLoopAndEpilogueVectorizer::EPI, llvm::EpilogueLoopVectorizationInfo::EpilogueUF, llvm::EpilogueLoopVectorizationInfo::EpilogueVF, LLVM_DEBUG, llvm::EpilogueLoopVectorizationInfo::MainLoopUF, and llvm::EpilogueLoopVectorizationInfo::MainLoopVF.