LLVM 24.0.0git
llvm::InnerLoopVectorizer Class Reference

InnerLoopVectorizer vectorizes loops which contain only one basic block to a specified vectorization factor (VF). More...

Public Member Functions

 InnerLoopVectorizer (Loop *OrigLoop, PredicatedScalarEvolution &PSE, LoopInfo *LI, DominatorTree *DT, const TargetTransformInfo *TTI, AssumptionCache *AC, ElementCount VecWidth, unsigned UnrollFactor, GeneratedRTChecks &RTChecks)
void fixVectorizedLoop (VPTransformState &State)
 Fix the vectorized code, taking care of header phi's, and more.

Protected Attributes

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.

Friends

class LoopVectorizationPlanner

Detailed Description

InnerLoopVectorizer vectorizes loops which contain only one basic block to a specified vectorization factor (VF).

This class performs the widening of scalars into vectors, or multiple scalars. This class also implements the following features:

  • It inserts an epilogue loop for handling loops that don't have iteration counts that are known to be a multiple of the vectorization factor.
  • It handles the code generation for reduction variables.
  • Scalarization (implementation using scalars) of un-vectorizable instructions. InnerLoopVectorizer does not perform any vectorization-legality checks, and relies on the caller to check for the different legality aspects. The InnerLoopVectorizer relies on the LoopVectorizationLegality class to provide information about the induction and reduction variables that were found to a given vectorization factor.

Definition at line 308 of file LoopVectorize.cpp.

Constructor & Destructor Documentation

◆ InnerLoopVectorizer()

llvm::InnerLoopVectorizer::InnerLoopVectorizer ( Loop * OrigLoop,
PredicatedScalarEvolution & PSE,
LoopInfo * LI,
DominatorTree * DT,
const TargetTransformInfo * TTI,
AssumptionCache * AC,
ElementCount VecWidth,
unsigned UnrollFactor,
GeneratedRTChecks & RTChecks )
inline

Definition at line 310 of file LoopVectorize.cpp.

References AC, Builder, DT, LI, OrigLoop, PSE, RTChecks, TTI, UF, and VF.

Member Function Documentation

◆ fixVectorizedLoop()

void InnerLoopVectorizer::fixVectorizedLoop ( VPTransformState & State)

Fix the vectorized code, taking care of header phi's, and more.

Definition at line 1812 of file LoopVectorize.cpp.

References llvm::vputils::getFirstLoopHeader(), and legacyCSE().

Referenced by llvm::LoopVectorizationPlanner::executePlan().

◆ LoopVectorizationPlanner

friend class LoopVectorizationPlanner
friend

Definition at line 323 of file LoopVectorize.cpp.

References LoopVectorizationPlanner.

Referenced by LoopVectorizationPlanner.

Member Data Documentation

◆ AC

AssumptionCache* llvm::InnerLoopVectorizer::AC
protected

Assumption Cache.

Definition at line 343 of file LoopVectorize.cpp.

Referenced by llvm::LoopVectorizationPlanner::executePlan(), and InnerLoopVectorizer().

◆ Builder

IRBuilder llvm::InnerLoopVectorizer::Builder
protected

The builder that we use.

Definition at line 354 of file LoopVectorize.cpp.

Referenced by llvm::LoopVectorizationPlanner::executePlan(), and InnerLoopVectorizer().

◆ DT

DominatorTree* llvm::InnerLoopVectorizer::DT
protected

Dominator Tree.

Definition at line 337 of file LoopVectorize.cpp.

Referenced by InnerLoopVectorizer().

◆ LI

LoopInfo* llvm::InnerLoopVectorizer::LI
protected

Loop Info.

Definition at line 334 of file LoopVectorize.cpp.

Referenced by InnerLoopVectorizer().

◆ OrigLoop

Loop* llvm::InnerLoopVectorizer::OrigLoop
protected

The original loop.

Definition at line 326 of file LoopVectorize.cpp.

Referenced by InnerLoopVectorizer().

◆ PSE

PredicatedScalarEvolution& llvm::InnerLoopVectorizer::PSE
protected

A wrapper around ScalarEvolution used to add runtime SCEV checks.

Applies dynamic knowledge to simplify SCEV expressions and converts them to a more usable form.

Definition at line 331 of file LoopVectorize.cpp.

Referenced by InnerLoopVectorizer().

◆ RTChecks

GeneratedRTChecks& llvm::InnerLoopVectorizer::RTChecks
protected

Structure to hold information about generated runtime checks, responsible for cleaning the checks, if vectorization turns out unprofitable.

Definition at line 360 of file LoopVectorize.cpp.

Referenced by llvm::LoopVectorizationPlanner::executePlan(), and InnerLoopVectorizer().

◆ TTI

const TargetTransformInfo* llvm::InnerLoopVectorizer::TTI
protected

Target Transform Info.

Definition at line 340 of file LoopVectorize.cpp.

Referenced by InnerLoopVectorizer().

◆ UF

unsigned llvm::InnerLoopVectorizer::UF
protected

The vectorization unroll factor to use.

Each scalar is vectorized to this many different vector instructions.

Definition at line 351 of file LoopVectorize.cpp.

Referenced by InnerLoopVectorizer().

◆ VF

ElementCount llvm::InnerLoopVectorizer::VF
protected

The vectorization SIMD factor to use.

Each vector will have this many vector elements.

Definition at line 347 of file LoopVectorize.cpp.

Referenced by InnerLoopVectorizer().


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