LLVM  14.0.0git
Classes | Public Member Functions | Public Attributes | List of all members
llvm::VPTransformState Struct Reference

VPTransformState holds information passed down when "executing" a VPlan, needed for generating the output IR. More...

#include "Transforms/Vectorize/VPlan.h"

Collaboration diagram for llvm::VPTransformState:
Collaboration graph
[legend]

Classes

struct  CFGState
 Hold state information used when constructing the CFG of the output IR, traversing the VPBasicBlocks and generating corresponding IR BasicBlocks. More...
 
struct  DataState
 

Public Member Functions

 VPTransformState (ElementCount VF, unsigned UF, LoopInfo *LI, DominatorTree *DT, IRBuilder<> &Builder, InnerLoopVectorizer *ILV, VPlan *Plan)
 
Valueget (VPValue *Def, unsigned Part)
 Get the generated Value for a given VPValue and a given Part. More...
 
Valueget (VPValue *Def, const VPIteration &Instance)
 Get the generated Value for a given VPValue and given Part and Lane. More...
 
bool hasVectorValue (VPValue *Def, unsigned Part)
 
bool hasAnyVectorValue (VPValue *Def) const
 
bool hasScalarValue (VPValue *Def, VPIteration Instance)
 
void set (VPValue *Def, Value *V, unsigned Part)
 Set the generated Value for a given VPValue and a given Part. More...
 
void reset (VPValue *Def, Value *V, unsigned Part)
 Reset an existing vector value for Def and a given Part. More...
 
void set (VPValue *Def, Value *V, const VPIteration &Instance)
 Set the generated scalar V for Def and the given Instance. More...
 
void reset (VPValue *Def, Value *V, const VPIteration &Instance)
 Reset an existing scalar value for Def and a given Instance. More...
 

Public Attributes

ElementCount VF
 The chosen Vectorization and Unroll Factors of the loop being vectorized. More...
 
unsigned UF
 
Optional< VPIterationInstance
 Hold the indices to generate specific scalar instructions. More...
 
struct llvm::VPTransformState::DataState Data
 
struct llvm::VPTransformState::CFGState CFG
 
LoopInfoLI
 Hold a pointer to LoopInfo to register new basic blocks in the loop. More...
 
DominatorTreeDT
 Hold a pointer to Dominator Tree to register new basic blocks in the loop. More...
 
IRBuilderBuilder
 Hold a reference to the IRBuilder used to generate output IR code. More...
 
VPValue2ValueTy VPValue2Value
 
ValueCanonicalIV = nullptr
 Hold the canonical scalar IV of the vector loop (start=0, step=VF*UF). More...
 
ValueTripCount = nullptr
 Hold the trip count of the scalar loop. More...
 
InnerLoopVectorizerILV
 Hold a pointer to InnerLoopVectorizer to reuse its IR generation methods. More...
 
VPlanPlan
 Pointer to the VPlan code is generated for. More...
 
SmallPtrSet< VPRecipeBase *, 16 > MayGeneratePoisonRecipes
 Holds recipes that may generate a poison value that is used after vectorization, even when their operands are not poison. More...
 

Detailed Description

VPTransformState holds information passed down when "executing" a VPlan, needed for generating the output IR.

Definition at line 195 of file VPlan.h.

Constructor & Destructor Documentation

◆ VPTransformState()

llvm::VPTransformState::VPTransformState ( ElementCount  VF,
unsigned  UF,
LoopInfo LI,
DominatorTree DT,
IRBuilder<> &  Builder,
InnerLoopVectorizer ILV,
VPlan Plan 
)
inline

Definition at line 196 of file VPlan.h.

Member Function Documentation

◆ get() [1/2]

Value * VPTransformState::get ( VPValue Def,
const VPIteration Instance 
)

◆ get() [2/2]

Value * VPTransformState::get ( VPValue Def,
unsigned  Part 
)

Get the generated Value for a given VPValue and a given Part.

Note that as some Defs are still created by ILV and managed in its ValueMap, this method will delegate the call to ILV in such cases in order to provide callers a consistent API.

See also
set.

Definition at line 10102 of file LoopVectorize.cpp.

References assert(), B, llvm::InnerLoopVectorizer::Builder, llvm::Data, llvm::tgtok::Def, get, llvm::VectorType::get(), llvm::PoisonValue::get(), llvm::LinearPolySize< LeafTy >::getKnownMinValue(), llvm::LinearPolySize< LeafTy >::isScalable(), llvm::ElementCount::isScalar(), llvm::IRBuilderBase::restoreIP(), llvm::IRBuilderBase::saveIP(), set, llvm::IRBuilderBase::SetInsertPoint(), llvm::RegState::Undef, and llvm::InnerLoopVectorizer::VF.

Referenced by llvm::InnerLoopVectorizer::clearReductionWrapFlags(), llvm::VPWidenRecipe::execute(), llvm::VPWidenSelectRecipe::execute(), llvm::VPWidenGEPRecipe::execute(), llvm::VPReductionPHIRecipe::execute(), llvm::VPReductionRecipe::execute(), llvm::VPBranchOnMaskRecipe::execute(), llvm::VPPredInstPHIRecipe::execute(), llvm::VPWidenMemoryInstructionRecipe::execute(), llvm::VPBasicBlock::execute(), llvm::VPlan::execute(), llvm::InnerLoopVectorizer::fixFirstOrderRecurrence(), llvm::InnerLoopVectorizer::fixLCSSAPHIs(), llvm::InnerLoopVectorizer::fixNonInductionPHIs(), llvm::InnerLoopVectorizer::fixReduction(), llvm::InnerLoopVectorizer::packScalarIntoVectorValue(), llvm::InnerLoopVectorizer::scalarizeInstruction(), llvm::InnerLoopVectorizer::truncateToMinimalBitwidths(), llvm::InnerLoopVectorizer::vectorizeInterleaveGroup(), and llvm::InnerLoopVectorizer::widenCallInstruction().

◆ hasAnyVectorValue()

bool llvm::VPTransformState::hasAnyVectorValue ( VPValue Def) const
inline

◆ hasScalarValue()

bool llvm::VPTransformState::hasScalarValue ( VPValue Def,
VPIteration  Instance 
)
inline

◆ hasVectorValue()

bool llvm::VPTransformState::hasVectorValue ( VPValue Def,
unsigned  Part 
)
inline

◆ reset() [1/2]

void llvm::VPTransformState::reset ( VPValue Def,
Value V,
const VPIteration Instance 
)
inline

Reset an existing scalar value for Def and a given Instance.

Definition at line 284 of file VPlan.h.

References assert(), Data, llvm::tgtok::Def, Instance, llvm::VPTransformState::DataState::PerPartScalars, and VF.

◆ reset() [2/2]

void llvm::VPTransformState::reset ( VPValue Def,
Value V,
unsigned  Part 
)
inline

◆ set() [1/2]

void llvm::VPTransformState::set ( VPValue Def,
Value V,
const VPIteration Instance 
)
inline

Set the generated scalar V for Def and the given Instance.

Definition at line 270 of file VPlan.h.

References assert(), Data, llvm::tgtok::Def, Instance, llvm::VPTransformState::DataState::PerPartScalars, and VF.

◆ set() [2/2]

void llvm::VPTransformState::set ( VPValue Def,
Value V,
unsigned  Part 
)
inline

Member Data Documentation

◆ Builder

IRBuilder& llvm::VPTransformState::Builder

◆ CanonicalIV

Value* llvm::VPTransformState::CanonicalIV = nullptr

Hold the canonical scalar IV of the vector loop (start=0, step=VF*UF).

Definition at line 340 of file VPlan.h.

Referenced by llvm::VPWidenCanonicalIVRecipe::execute().

◆ CFG

struct llvm::VPTransformState::CFGState llvm::VPTransformState::CFG

◆ Data

struct llvm::VPTransformState::DataState llvm::VPTransformState::Data

◆ DT

DominatorTree* llvm::VPTransformState::DT

Hold a pointer to Dominator Tree to register new basic blocks in the loop.

Definition at line 332 of file VPlan.h.

Referenced by llvm::VPlan::execute().

◆ ILV

InnerLoopVectorizer* llvm::VPTransformState::ILV

◆ Instance

Optional<VPIteration> llvm::VPTransformState::Instance

◆ LI

LoopInfo* llvm::VPTransformState::LI

Hold a pointer to LoopInfo to register new basic blocks in the loop.

Definition at line 329 of file VPlan.h.

Referenced by llvm::VPReductionPHIRecipe::execute(), llvm::VPBasicBlock::execute(), and llvm::VPlan::execute().

◆ MayGeneratePoisonRecipes

SmallPtrSet<VPRecipeBase *, 16> llvm::VPTransformState::MayGeneratePoisonRecipes

Holds recipes that may generate a poison value that is used after vectorization, even when their operands are not poison.

Definition at line 353 of file VPlan.h.

Referenced by llvm::VPWidenRecipe::execute(), llvm::VPWidenGEPRecipe::execute(), and llvm::InnerLoopVectorizer::scalarizeInstruction().

◆ Plan

VPlan* llvm::VPTransformState::Plan

◆ TripCount

Value* llvm::VPTransformState::TripCount = nullptr

Hold the trip count of the scalar loop.

Definition at line 343 of file VPlan.h.

Referenced by llvm::VPlan::execute().

◆ UF

unsigned llvm::VPTransformState::UF

◆ VF

ElementCount llvm::VPTransformState::VF

◆ VPValue2Value

VPValue2ValueTy llvm::VPTransformState::VPValue2Value

Definition at line 337 of file VPlan.h.

Referenced by llvm::VPlan::execute().


The documentation for this struct was generated from the following files: