LLVM 24.0.0git
llvm::EpilogueVectorizerEpilogueLoop Class Reference

A specialized derived class of inner loop vectorizer that performs vectorization of epilogue loops in the process of vectorizing loops and their epilogues. More...

Inheritance diagram for llvm::EpilogueVectorizerEpilogueLoop:
[legend]

Public Member Functions

 EpilogueVectorizerEpilogueLoop (Loop *OrigLoop, PredicatedScalarEvolution &PSE, LoopInfo *LI, DominatorTree *DT, const TargetTransformInfo *TTI, AssumptionCache *AC, ElementCount VecWidth, unsigned UnrollFactor, GeneratedRTChecks &Checks, VPlan &Plan, VPlan &MainPlan)
BasicBlock * createVectorizedLoopSkeleton () final
 Implements the interface for creating a vectorized skeleton using the epilogue loop strategy (i.e., the second pass of VPlan execution).
Public Member Functions inherited from llvm::InnerLoopVectorizer
 InnerLoopVectorizer (Loop *OrigLoop, PredicatedScalarEvolution &PSE, LoopInfo *LI, DominatorTree *DT, const TargetTransformInfo *TTI, AssumptionCache *AC, ElementCount VecWidth, unsigned UnrollFactor, GeneratedRTChecks &RTChecks, VPlan &Plan)
virtual ~InnerLoopVectorizer ()=default
void fixVectorizedLoop (VPTransformState &State)
 Fix the vectorized code, taking care of header phi's, and more.

Public Attributes

VPIRBasicBlock * VecEpilogueIterationCountCheck = nullptr

Additional Inherited Members

Protected Member Functions inherited from llvm::InnerLoopVectorizer
BasicBlock * createScalarPreheader (StringRef Prefix)
 Create and return a new IR basic block for the scalar preheader whose name is prefixed with Prefix.
Protected Attributes inherited from llvm::InnerLoopVectorizer
Loop * OrigLoop
 The original loop.
PredicatedScalarEvolution & PSE
 A wrapper around ScalarEvolution used to add runtime SCEV checks.
LoopInfo * LI
 Loop Info.
DominatorTree * DT
 Dominator Tree.
const TargetTransformInfo * TTI
 Target Transform Info.
AssumptionCache * AC
 Assumption Cache.
ElementCount VF
 The vectorization SIMD factor to use.
unsigned UF
 The vectorization unroll factor to use.
IRBuilder Builder
 The builder that we use.
GeneratedRTChecks & RTChecks
 Structure to hold information about generated runtime checks, responsible for cleaning the checks, if vectorization turns out unprofitable.
VPlan & Plan
VPBasicBlock * VectorPHVPBB
 The vector preheader block of Plan, used as target for check blocks introduced during skeleton creation.

Detailed Description

A specialized derived class of inner loop vectorizer that performs vectorization of epilogue loops in the process of vectorizing loops and their epilogues.

The idea is to run the vplan on a given loop twice, firstly to vectorize the main loop, and secondly to complete the skeleton from the first step and vectorize the epilogue. This helps us avoid regenerating and recomputing runtime safety checks, and shortens the iteration-count-check path length for loops whose iteration count is so small that the main vector loop is completely skipped.

Definition at line 637 of file LoopVectorize.cpp.

Constructor & Destructor Documentation

◆ EpilogueVectorizerEpilogueLoop()

llvm::EpilogueVectorizerEpilogueLoop::EpilogueVectorizerEpilogueLoop ( Loop * OrigLoop,
PredicatedScalarEvolution & PSE,
LoopInfo * LI,
DominatorTree * DT,
const TargetTransformInfo * TTI,
AssumptionCache * AC,
ElementCount VecWidth,
unsigned UnrollFactor,
GeneratedRTChecks & Checks,
VPlan & Plan,
VPlan & MainPlan )
inline

Member Function Documentation

◆ createVectorizedLoopSkeleton()

BasicBlock * EpilogueVectorizerEpilogueLoop::createVectorizedLoopSkeleton ( )
finalvirtual

Implements the interface for creating a vectorized skeleton using the epilogue loop strategy (i.e., the second pass of VPlan execution).

This function creates a new scalar preheader, using the previous one as entry block to the epilogue VPlan.

The minimum iteration check is being represented in VPlan.

Reimplemented from llvm::InnerLoopVectorizer.

Definition at line 5985 of file LoopVectorize.cpp.

References llvm::InnerLoopVectorizer::createScalarPreheader(), llvm::VPBasicBlock::end(), llvm::BasicBlock::getSinglePredecessor(), llvm::isa(), llvm::make_early_inc_range(), llvm::VPlanTransforms::modelGeneratedMainLoopBlocks(), llvm::InnerLoopVectorizer::Plan, llvm::VPBlockUtils::reassociateBlocks(), RUN_VPLAN_PASS, llvm::Value::setName(), and VecEpilogueIterationCountCheck.

Member Data Documentation

◆ VecEpilogueIterationCountCheck

VPIRBasicBlock* llvm::EpilogueVectorizerEpilogueLoop::VecEpilogueIterationCountCheck = nullptr

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