LLVM 22.0.0git
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 253 of file VPlan.cpp.

References AC, Builder, CFG, CurrentParentLoop, LI, Plan, TTI, TypeAnalysis, VF, and VPDT.

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 293 of file VPlan.cpp.

References assert(), B(), Builder, llvm::cast(), Data, get(), hasScalarValue(), hasVectorValue(), llvm::isa(), llvm::vputils::isSingleScalar(), llvm::vputils::onlyFirstLaneUsed(), set(), and VF.

Referenced by get(), get(), and packScalarIntoVectorizedValue().

◆ get() [2/2]

◆ hasScalarValue()

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

Definition at line 240 of file VPlanHelpers.h.

References Data, I, Lane, and VF.

Referenced by get(), and get().

◆ hasVectorValue()

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

Definition at line 236 of file VPlanHelpers.h.

References Data.

Referenced by get(), 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 387 of file VPlan.cpp.

References Builder, llvm::dyn_cast(), get(), llvm::Value::getType(), I, Lane, and VF.

◆ 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(), and Data.

◆ 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, and VF.

◆ set() [1/2]

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

Set the generated vector Value for a given VPValue, if IsScalar is false.

If IsScalar is true, set the scalar in lane 0.

Definition at line 250 of file VPlanHelpers.h.

References assert(), Data, llvm::isVectorizedTy(), set(), and VF.

Referenced by get(), and set().

◆ 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, and VF.

◆ setDebugLocFrom()

void VPTransformState::setDebugLocFrom ( DebugLoc DL)

Set the debug location in the builder using the debug location DL.

Definition at line 365 of file VPlan.cpp.

References 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 VPTransformState().

◆ Builder

IRBuilderBase& llvm::VPTransformState::Builder

Hold a reference to the IRBuilder used to generate output IR code.

Definition at line 328 of file VPlanHelpers.h.

Referenced by get(), get(), packScalarIntoVectorizedValue(), and VPTransformState().

◆ CFG

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

Referenced by VPTransformState().

◆ 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 VPTransformState().

◆ Data

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

◆ Lane

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

Hold the index to generate specific scalar instructions.

Null indicates that all instances are to be generated, using either scalar or vector instructions.

Definition at line 219 of file VPlanHelpers.h.

Referenced by get(), hasScalarValue(), packScalarIntoVectorizedValue(), reset(), and set().

◆ 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 VPTransformState().

◆ Plan

VPlan* llvm::VPTransformState::Plan

Pointer to the VPlan code is generated for.

Definition at line 331 of file VPlanHelpers.h.

Referenced by VPTransformState().

◆ TTI

const TargetTransformInfo* llvm::VPTransformState::TTI

Target Transform Info.

Definition at line 211 of file VPlanHelpers.h.

Referenced by VPTransformState().

◆ TypeAnalysis

VPTypeAnalysis llvm::VPTransformState::TypeAnalysis

VPlan-based type analysis.

Definition at line 337 of file VPlanHelpers.h.

Referenced by VPTransformState().

◆ VF

ElementCount llvm::VPTransformState::VF

The chosen Vectorization Factor of the loop being vectorized.

Definition at line 214 of file VPlanHelpers.h.

Referenced by get(), get(), hasScalarValue(), packScalarIntoVectorizedValue(), llvm::VPBasicBlock::print(), reset(), set(), set(), and VPTransformState().

◆ VPDT

VPDominatorTree llvm::VPTransformState::VPDT

VPlan-based dominator tree.

Definition at line 340 of file VPlanHelpers.h.

Referenced by VPTransformState().


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