Thanks to visit codestin.com
Credit goes to llvm.org

LLVM 22.0.0git
llvm::VPCostContext Struct Reference

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

#include "Transforms/Vectorize/VPlanHelpers.h"

Public Member Functions

 VPCostContext (const TargetTransformInfo &TTI, const TargetLibraryInfo &TLI, const VPlan &Plan, LoopVectorizationCostModel &CM, TargetTransformInfo::TargetCostKind CostKind)
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.
TargetTransformInfo::OperandValueInfo getOperandInfo (VPValue *V) const
 Returns the OperandInfo for V, if it is a live-in.
bool isLegacyUniformAfterVectorization (Instruction *I, ElementCount VF) const
 Return true if I is considered uniform-after-vectorization in the legacy cost model for VF.
InstructionCost getScalarizationOverhead (Type *ResultTy, ArrayRef< const VPValue * > Operands, ElementCount VF)
 Estimate the overhead of scalarizing a recipe with result type ResultTy and Operands with VF.

Public Attributes

const TargetTransformInfoTTI
const TargetLibraryInfoTLI
VPTypeAnalysis Types
LLVMContextLLVMCtx
LoopVectorizationCostModelCM
SmallPtrSet< Instruction *, 8 > SkipCostComputation
TargetTransformInfo::TargetCostKind CostKind

Detailed Description

Struct to hold various analysis needed for cost computations.

Definition at line 344 of file VPlanHelpers.h.

Constructor & Destructor Documentation

◆ VPCostContext()

llvm::VPCostContext::VPCostContext ( const TargetTransformInfo & TTI,
const TargetLibraryInfo & TLI,
const VPlan & Plan,
LoopVectorizationCostModel & CM,
TargetTransformInfo::TargetCostKind CostKind )
inline

Definition at line 353 of file VPlanHelpers.h.

References CM, CostKind, LLVMCtx, TLI, TTI, and Types.

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 6711 of file LoopVectorize.cpp.

References CM, llvm::ForceTargetInstructionCost, and InstructionCost.

◆ getOperandInfo()

TargetTransformInfo::OperandValueInfo VPCostContext::getOperandInfo ( VPValue * V) const

Returns the OperandInfo for V, if it is a live-in.

Definition at line 1774 of file VPlan.cpp.

References llvm::TargetTransformInfo::getOperandInfo().

◆ getScalarizationOverhead()

InstructionCost VPCostContext::getScalarizationOverhead ( Type * ResultTy,
ArrayRef< const VPValue * > Operands,
ElementCount VF )

Estimate the overhead of scalarizing a recipe with result type ResultTy and Operands with VF.

This is a convenience wrapper for the type-based getScalarizationOverhead API.

Definition at line 1781 of file VPlan.cpp.

References llvm::cast(), CostKind, llvm::APInt::getAllOnes(), llvm::getContainedTypes(), llvm::details::FixedOrScalableQuantity< LeafTy, ValueTy >::getFixedValue(), llvm::SmallPtrSetImpl< PtrType >::insert(), llvm::isa(), llvm::ElementCount::isScalar(), llvm::Type::isVoidTy(), Operands, llvm::SmallVectorTemplateBase< T, bool >::push_back(), llvm::to_vector(), llvm::toVectorizedTy(), TTI, and Types.

◆ isLegacyUniformAfterVectorization()

bool VPCostContext::isLegacyUniformAfterVectorization ( Instruction * I,
ElementCount VF ) const

Return true if I is considered uniform-after-vectorization in the legacy cost model for VF.

Only used to check for additional VPlan simplifications.

Definition at line 6719 of file LoopVectorize.cpp.

References CM, and I.

Referenced by planContainsAdditionalSimplifications().

◆ 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 6724 of file LoopVectorize.cpp.

References CM, and SkipCostComputation.

Member Data Documentation

◆ CM

◆ CostKind

TargetTransformInfo::TargetCostKind llvm::VPCostContext::CostKind

Definition at line 351 of file VPlanHelpers.h.

Referenced by getScalarizationOverhead(), and VPCostContext().

◆ LLVMCtx

LLVMContext& llvm::VPCostContext::LLVMCtx

Definition at line 348 of file VPlanHelpers.h.

Referenced by VPCostContext().

◆ SkipCostComputation

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

Definition at line 350 of file VPlanHelpers.h.

Referenced by skipCostComputation().

◆ TLI

const TargetLibraryInfo& llvm::VPCostContext::TLI

Definition at line 346 of file VPlanHelpers.h.

Referenced by VPCostContext().

◆ TTI

const TargetTransformInfo& llvm::VPCostContext::TTI

Definition at line 345 of file VPlanHelpers.h.

Referenced by getScalarizationOverhead(), and VPCostContext().

◆ Types

VPTypeAnalysis llvm::VPCostContext::Types

Definition at line 347 of file VPlanHelpers.h.

Referenced by getScalarizationOverhead(), and VPCostContext().


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