LLVM 22.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/VPlanHelpers.h"

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 (const TargetTransformInfo *TTI, ElementCount VF, LoopInfo *LI, DominatorTree *DT, AssumptionCache *AC, IRBuilderBase &Builder, VPlan *Plan, Loop *CurrentParentLoop, Type *CanonicalIVTy)
 
Valueget (const VPValue *Def, bool IsScalar=false)
 Get the generated vector Value for a given VPValue Def if IsScalar is false, otherwise return the generated scalar.
 
Valueget (const VPValue *Def, const VPLane &Lane)
 Get the generated Value for a given VPValue and given Part and Lane.
 
bool hasVectorValue (const VPValue *Def)
 
bool hasScalarValue (const VPValue *Def, VPLane Lane)
 
void set (const VPValue *Def, Value *V, bool IsScalar=false)
 Set the generated vector Value for a given VPValue, if IsScalar is false.
 
void reset (const VPValue *Def, Value *V)
 Reset an existing vector value for Def and a given Part.
 
void set (const VPValue *Def, Value *V, const VPLane &Lane)
 Set the generated scalar V for Def and the given Lane.
 
void reset (const VPValue *Def, Value *V, const VPLane &Lane)
 Reset an existing scalar value for Def and a given Lane.
 
void setDebugLocFrom (DebugLoc DL)
 Set the debug location in the builder using the debug location DL.
 
ValuepackScalarIntoVectorizedValue (const VPValue *Def, Value *WideValue, const VPLane &Lane)
 Insert the scalar value of Def at Lane into Lane of WideValue and return the resulting value.
 

Public Attributes

const TargetTransformInfoTTI
 Target Transform Info.
 
ElementCount VF
 The chosen Vectorization Factor of the loop being vectorized.
 
std::optional< VPLaneLane
 Hold the index to generate specific scalar instructions.
 
struct llvm::VPTransformState::DataState Data
 
struct llvm::VPTransformState::CFGState CFG
 
LoopInfoLI
 Hold a pointer to LoopInfo to register new basic blocks in the loop.
 
AssumptionCacheAC
 Hold a pointer to AssumptionCache to register new assumptions after replicating assume calls.
 
IRBuilderBaseBuilder
 Hold a reference to the IRBuilder used to generate output IR code.
 
VPlanPlan
 Pointer to the VPlan code is generated for.
 
LoopCurrentParentLoop = nullptr
 The parent loop object for the current scope, or nullptr.
 
VPTypeAnalysis TypeAnalysis
 VPlan-based type analysis.
 
VPDominatorTree VPDT
 VPlan-based dominator tree.
 

Detailed Description

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

Definition at line 205 of file VPlanHelpers.h.

Constructor & Destructor Documentation

◆ VPTransformState()

VPTransformState::VPTransformState ( const TargetTransformInfo TTI,
ElementCount  VF,
LoopInfo LI,
DominatorTree DT,
AssumptionCache AC,
IRBuilderBase Builder,
VPlan Plan,
Loop CurrentParentLoop,
Type CanonicalIVTy 
)

Definition at line 243 of file VPlan.cpp.

Member Function Documentation

◆ get() [1/2]

Value * VPTransformState::get ( const VPValue Def,
bool  IsScalar = false 
)

Get the generated vector Value for a given VPValue Def if IsScalar is false, otherwise return the generated scalar.

\See set.

Definition at line 283 of file VPlan.cpp.

References assert(), B, Builder, llvm::IRBuilderBase::CreateVectorSplat(), Data, get(), llvm::PoisonValue::get(), llvm::details::FixedOrScalableQuantity< LeafTy, ValueTy >::getFixedValue(), hasScalarValue(), hasVectorValue(), llvm::isa(), llvm::details::FixedOrScalableQuantity< LeafTy, ValueTy >::isScalable(), llvm::ElementCount::isScalar(), llvm::vputils::isSingleScalar(), Lane, llvm::vputils::onlyFirstLaneUsed(), packScalarIntoVectorizedValue(), llvm::IRBuilderBase::saveIP(), set(), llvm::IRBuilderBase::SetInsertPoint(), llvm::toVectorizedTy(), VF, llvm::VPTransformState::DataState::VPV2Scalars, and llvm::VPTransformState::DataState::VPV2Vector.

Referenced by llvm::VPInstructionWithType::execute(), llvm::VPPhi::execute(), llvm::VPIRPhi::execute(), llvm::VPWidenRecipe::execute(), llvm::VPWidenCastRecipe::execute(), llvm::VPWidenIntrinsicRecipe::execute(), llvm::VPWidenCallRecipe::execute(), llvm::VPHistogramRecipe::execute(), llvm::VPWidenSelectRecipe::execute(), llvm::VPWidenGEPRecipe::execute(), llvm::VPVectorEndPointerRecipe::execute(), llvm::VPVectorPointerRecipe::execute(), llvm::VPWidenPHIRecipe::execute(), llvm::VPReductionPHIRecipe::execute(), llvm::VPInterleaveRecipe::execute(), llvm::VPReductionRecipe::execute(), llvm::VPPartialReductionRecipe::execute(), llvm::VPReductionEVLRecipe::execute(), llvm::VPReplicateRecipe::execute(), llvm::VPBranchOnMaskRecipe::execute(), llvm::VPPredInstPHIRecipe::execute(), llvm::VPWidenLoadRecipe::execute(), llvm::VPWidenLoadEVLRecipe::execute(), llvm::VPWidenStoreRecipe::execute(), llvm::VPWidenStoreEVLRecipe::execute(), llvm::VPActiveLaneMaskPHIRecipe::execute(), llvm::VPWidenCanonicalIVRecipe::execute(), llvm::VPDerivedIVRecipe::execute(), llvm::VPScalarIVStepsRecipe::execute(), llvm::VPlan::execute(), llvm::InnerLoopVectorizer::fixNonInductionPHIs(), fixReductionScalarResumeWhenVectorizingEpilog(), get(), llvm::VPUnrollPartAccessor< 1 >::getUnrollPart(), packScalarIntoVectorizedValue(), and scalarizeInstruction().

◆ get() [2/2]

Value * VPTransformState::get ( const VPValue Def,
const VPLane Lane 
)

◆ hasScalarValue()

bool llvm::VPTransformState::hasScalarValue ( const VPValue Def,
VPLane  Lane 
)
inline

Definition at line 240 of file VPlanHelpers.h.

References Data, I, Lane, VF, and llvm::VPTransformState::DataState::VPV2Scalars.

Referenced by llvm::VPPredInstPHIRecipe::execute(), and get().

◆ hasVectorValue()

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

Definition at line 236 of file VPlanHelpers.h.

References Data, and llvm::VPTransformState::DataState::VPV2Vector.

Referenced by llvm::VPPredInstPHIRecipe::execute(), and get().

◆ packScalarIntoVectorizedValue()

Value * VPTransformState::packScalarIntoVectorizedValue ( const VPValue Def,
Value WideValue,
const VPLane Lane 
)

Insert the scalar value of Def at Lane into Lane of WideValue and return the resulting value.

Definition at line 393 of file VPlan.cpp.

References Builder, llvm::IRBuilderBase::CreateExtractValue(), llvm::IRBuilderBase::CreateInsertElement(), llvm::IRBuilderBase::CreateInsertValue(), get(), llvm::Value::getType(), I, Lane, and VF.

Referenced by llvm::VPReplicateRecipe::execute(), and get().

◆ reset() [1/2]

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

Reset an existing vector value for Def and a given Part.

Definition at line 261 of file VPlanHelpers.h.

References assert(), Data, and llvm::VPTransformState::DataState::VPV2Vector.

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

◆ reset() [2/2]

void llvm::VPTransformState::reset ( const VPValue Def,
Value V,
const VPLane Lane 
)
inline

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

Definition at line 277 of file VPlanHelpers.h.

References assert(), Data, Lane, VF, and llvm::VPTransformState::DataState::VPV2Scalars.

◆ set() [1/2]

void llvm::VPTransformState::set ( const VPValue Def,
Value V,
bool  IsScalar = false 
)
inline

◆ set() [2/2]

void llvm::VPTransformState::set ( const VPValue Def,
Value V,
const VPLane Lane 
)
inline

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

Definition at line 267 of file VPlanHelpers.h.

References assert(), Data, Lane, VF, and llvm::VPTransformState::DataState::VPV2Scalars.

◆ setDebugLocFrom()

void VPTransformState::setDebugLocFrom ( DebugLoc  DL)

Member Data Documentation

◆ AC

AssumptionCache* llvm::VPTransformState::AC

Hold a pointer to AssumptionCache to register new assumptions after replicating assume calls.

Definition at line 325 of file VPlanHelpers.h.

Referenced by scalarizeInstruction().

◆ Builder

IRBuilderBase& llvm::VPTransformState::Builder

◆ CFG

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

◆ CurrentParentLoop

Loop* llvm::VPTransformState::CurrentParentLoop = nullptr

The parent loop object for the current scope, or nullptr.

Definition at line 334 of file VPlanHelpers.h.

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

◆ Data

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

◆ Lane

std::optional<VPLane> llvm::VPTransformState::Lane

◆ LI

LoopInfo* llvm::VPTransformState::LI

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

Definition at line 321 of file VPlanHelpers.h.

Referenced by llvm::VPBasicBlock::connectToPredecessors(), and llvm::VPBasicBlock::execute().

◆ Plan

VPlan* llvm::VPTransformState::Plan

Pointer to the VPlan code is generated for.

Definition at line 331 of file VPlanHelpers.h.

Referenced by llvm::VPBasicBlock::connectToPredecessors(), llvm::InnerLoopVectorizer::fixVectorizedLoop(), and setDebugLocFrom().

◆ TTI

const TargetTransformInfo* llvm::VPTransformState::TTI

Target Transform Info.

Definition at line 211 of file VPlanHelpers.h.

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

◆ TypeAnalysis

VPTypeAnalysis llvm::VPTransformState::TypeAnalysis

◆ VF

ElementCount llvm::VPTransformState::VF

◆ VPDT

VPDominatorTree llvm::VPTransformState::VPDT

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