LLVM 20.0.0git
Public Member Functions | Public Attributes | List of all members
llvm::VPCostContext Struct Reference

Struct to hold various analysis needed for cost computations. More...

#include "Transforms/Vectorize/VPlan.h"

Public Member Functions

 VPCostContext (const TargetTransformInfo &TTI, const TargetLibraryInfo &TLI, Type *CanIVTy, LLVMContext &LLVMCtx, LoopVectorizationCostModel &CM)
 
InstructionCost getLegacyCost (Instruction *UI, ElementCount VF) const
 Return the cost for UI with VF using the legacy cost model as fallback until computing the cost of all recipes migrates to VPlan.
 
bool skipCostComputation (Instruction *UI, bool IsVector) const
 Return true if the cost for UI shouldn't be computed, e.g.
 

Public Attributes

const TargetTransformInfoTTI
 
const TargetLibraryInfoTLI
 
VPTypeAnalysis Types
 
LLVMContextLLVMCtx
 
LoopVectorizationCostModelCM
 
SmallPtrSet< Instruction *, 8 > SkipCostComputation
 

Detailed Description

Struct to hold various analysis needed for cost computations.

Definition at line 737 of file VPlan.h.

Constructor & Destructor Documentation

◆ VPCostContext()

llvm::VPCostContext::VPCostContext ( const TargetTransformInfo TTI,
const TargetLibraryInfo TLI,
Type CanIVTy,
LLVMContext LLVMCtx,
LoopVectorizationCostModel CM 
)
inline

Definition at line 745 of file VPlan.h.

Member Function Documentation

◆ getLegacyCost()

InstructionCost VPCostContext::getLegacyCost ( Instruction UI,
ElementCount  VF 
) const

Return the cost for UI with VF using the legacy cost model as fallback until computing the cost of all recipes migrates to VPlan.

Definition at line 7089 of file LoopVectorize.cpp.

References CM, and llvm::LoopVectorizationCostModel::getInstructionCost().

Referenced by llvm::VPRecipeBase::computeCost(), and llvm::VPWidenRecipe::computeCost().

◆ skipCostComputation()

bool VPCostContext::skipCostComputation ( Instruction UI,
bool  IsVector 
) const

Return true if the cost for UI shouldn't be computed, e.g.

because it has already been pre-computed.

Definition at line 7094 of file LoopVectorize.cpp.

References CM, SkipCostComputation, llvm::LoopVectorizationCostModel::ValuesToIgnore, and llvm::LoopVectorizationCostModel::VecValuesToIgnore.

Referenced by llvm::VPRecipeBase::cost().

Member Data Documentation

◆ CM

LoopVectorizationCostModel& llvm::VPCostContext::CM

Definition at line 742 of file VPlan.h.

Referenced by getLegacyCost(), and skipCostComputation().

◆ LLVMCtx

LLVMContext& llvm::VPCostContext::LLVMCtx

Definition at line 741 of file VPlan.h.

◆ SkipCostComputation

SmallPtrSet<Instruction *, 8> llvm::VPCostContext::SkipCostComputation

Definition at line 743 of file VPlan.h.

Referenced by llvm::VPRecipeBase::computeCost(), and skipCostComputation().

◆ TLI

const TargetLibraryInfo& llvm::VPCostContext::TLI

Definition at line 739 of file VPlan.h.

Referenced by llvm::VPWidenRecipe::computeCost().

◆ TTI

const TargetTransformInfo& llvm::VPCostContext::TTI

Definition at line 738 of file VPlan.h.

Referenced by llvm::VPWidenRecipe::computeCost(), and llvm::VPRegionBlock::cost().

◆ Types

VPTypeAnalysis llvm::VPCostContext::Types

Definition at line 740 of file VPlan.h.

Referenced by llvm::VPWidenRecipe::computeCost().


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