LLVM  8.0.0svn
Classes | Public Types | Public Member Functions | Public Attributes | List of all members
llvm::LoopVectorizationCostModel Class Reference

LoopVectorizationCostModel - estimates the expected speedups due to vectorization. More...

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

Classes

struct  RegisterUsage
 A struct that represents some properties of the register usage of a loop. More...
 

Public Types

enum  InstWidening {
  CM_Unknown, CM_Widen, CM_Widen_Reverse, CM_Interleave,
  CM_GatherScatter, CM_Scalarize
}
 Decision that was taken during cost calculation for memory instruction. More...
 

Public Member Functions

 LoopVectorizationCostModel (Loop *L, PredicatedScalarEvolution &PSE, LoopInfo *LI, LoopVectorizationLegality *Legal, const TargetTransformInfo &TTI, const TargetLibraryInfo *TLI, DemandedBits *DB, AssumptionCache *AC, OptimizationRemarkEmitter *ORE, const Function *F, const LoopVectorizeHints *Hints, InterleavedAccessInfo &IAI)
 
Optional< unsignedcomputeMaxVF (bool OptForSize)
 
VectorizationFactor selectVectorizationFactor (unsigned MaxVF)
 
void selectUserVectorizationFactor (unsigned UserVF)
 Setup cost-based decisions for user vectorization factor. More...
 
std::pair< unsigned, unsignedgetSmallestAndWidestTypes ()
 
unsigned selectInterleaveCount (bool OptForSize, unsigned VF, unsigned LoopCost)
 
void setCostBasedWideningDecision (unsigned VF)
 Memory access instruction may be vectorized in more than one way. More...
 
SmallVector< RegisterUsage, 8 > calculateRegisterUsage (ArrayRef< unsigned > VFs)
 
void collectValuesToIgnore ()
 Collect values we want to ignore in the cost model. More...
 
const MapVector< Instruction *, uint64_t > & getMinimalBitwidths () const
 
bool isProfitableToScalarize (Instruction *I, unsigned VF) const
 
bool isUniformAfterVectorization (Instruction *I, unsigned VF) const
 Returns true if I is known to be uniform after vectorization. More...
 
bool isScalarAfterVectorization (Instruction *I, unsigned VF) const
 Returns true if I is known to be scalar after vectorization. More...
 
bool canTruncateToMinimalBitwidth (Instruction *I, unsigned VF) const
 
void setWideningDecision (Instruction *I, unsigned VF, InstWidening W, unsigned Cost)
 Save vectorization decision W and Cost taken by the cost model for instruction I and vector width VF. More...
 
void setWideningDecision (const InterleaveGroup *Grp, unsigned VF, InstWidening W, unsigned Cost)
 Save vectorization decision W and Cost taken by the cost model for interleaving group Grp and vector width VF. More...
 
InstWidening getWideningDecision (Instruction *I, unsigned VF)
 Return the cost model decision for the given instruction I and vector width VF. More...
 
unsigned getWideningCost (Instruction *I, unsigned VF)
 Return the vectorization cost for the given instruction I and vector width VF. More...
 
bool isOptimizableIVTruncate (Instruction *I, unsigned VF)
 Return True if instruction I is an optimizable truncate whose operand is an induction variable. More...
 
void collectInstsToScalarize (unsigned VF)
 Collects the instructions to scalarize for each predicated instruction in the loop. More...
 
void collectUniformsAndScalars (unsigned VF)
 Collect Uniform and Scalar values for the given VF. More...
 
bool isLegalMaskedStore (Type *DataType, Value *Ptr)
 Returns true if the target machine supports masked store operation for the given DataType and kind of access to Ptr. More...
 
bool isLegalMaskedLoad (Type *DataType, Value *Ptr)
 Returns true if the target machine supports masked load operation for the given DataType and kind of access to Ptr. More...
 
bool isLegalMaskedScatter (Type *DataType)
 Returns true if the target machine supports masked scatter operation for the given DataType. More...
 
bool isLegalMaskedGather (Type *DataType)
 Returns true if the target machine supports masked gather operation for the given DataType. More...
 
bool isLegalGatherOrScatter (Value *V)
 Returns true if the target machine can represent V as a masked gather or scatter operation. More...
 
bool isScalarWithPredication (Instruction *I)
 Returns true if I is an instruction that will be scalarized with predication. More...
 
bool memoryInstructionCanBeWidened (Instruction *I, unsigned VF=1)
 Returns true if I is a memory instruction with consecutive memory access that can be widened. More...
 
bool isAccessInterleaved (Instruction *Instr)
 Check if Instr belongs to any interleaved access group. More...
 
const InterleaveGroupgetInterleavedAccessGroup (Instruction *Instr)
 Get the interleaved access group that Instr belongs to. More...
 
bool requiresScalarEpilogue () const
 Returns true if an interleaved group requires a scalar iteration to handle accesses with gaps. More...
 

Public Attributes

LoopTheLoop
 The loop that we evaluate. More...
 
PredicatedScalarEvolutionPSE
 Predicated scalar evolution analysis. More...
 
LoopInfoLI
 Loop Info analysis. More...
 
LoopVectorizationLegalityLegal
 Vectorization legality. More...
 
const TargetTransformInfoTTI
 Vector target information. More...
 
const TargetLibraryInfoTLI
 Target Library Info. More...
 
DemandedBitsDB
 Demanded bits analysis. More...
 
AssumptionCacheAC
 Assumption cache. More...
 
OptimizationRemarkEmitterORE
 Interface to emit optimization remarks. More...
 
const FunctionTheFunction
 
const LoopVectorizeHintsHints
 Loop Vectorize Hint. More...
 
InterleavedAccessInfo & InterleaveInfo
 The interleave access information contains groups of interleaved accesses with the same stride and close to each other. More...
 
SmallPtrSet< const Value *, 16 > ValuesToIgnore
 Values to ignore in the cost model. More...
 
SmallPtrSet< const Value *, 16 > VecValuesToIgnore
 Values to ignore in the cost model when VF > 1. More...
 

Detailed Description

LoopVectorizationCostModel - estimates the expected speedups due to vectorization.

In many cases vectorization is not profitable. This can happen because of a number of reasons. In this class we mainly attempt to predict the expected speedup/slowdowns due to the supported instruction set. We use the TargetTransformInfo to query the different backends for the cost of different operations.

Definition at line 1172 of file LoopVectorize.cpp.

Member Enumeration Documentation

◆ InstWidening

Decision that was taken during cost calculation for memory instruction.

Enumerator
CM_Unknown 
CM_Widen 
CM_Widen_Reverse 
CM_Interleave 
CM_GatherScatter 
CM_Scalarize 

Definition at line 1282 of file LoopVectorize.cpp.

Constructor & Destructor Documentation

◆ LoopVectorizationCostModel()

llvm::LoopVectorizationCostModel::LoopVectorizationCostModel ( Loop L,
PredicatedScalarEvolution PSE,
LoopInfo LI,
LoopVectorizationLegality Legal,
const TargetTransformInfo TTI,
const TargetLibraryInfo TLI,
DemandedBits DB,
AssumptionCache AC,
OptimizationRemarkEmitter ORE,
const Function F,
const LoopVectorizeHints Hints,
InterleavedAccessInfo &  IAI 
)
inline

Definition at line 1174 of file LoopVectorize.cpp.

Member Function Documentation

◆ calculateRegisterUsage()

SmallVector< LoopVectorizationCostModel::RegisterUsage, 8 > LoopVectorizationCostModel::calculateRegisterUsage ( ArrayRef< unsigned VFs)

◆ canTruncateToMinimalBitwidth()

bool llvm::LoopVectorizationCostModel::canTruncateToMinimalBitwidth ( Instruction I,
unsigned  VF 
) const
inline
Returns
True if instruction I can be truncated to a smaller bitwidth for vectorization factor VF.

Definition at line 1276 of file LoopVectorize.cpp.

◆ collectInstsToScalarize()

void LoopVectorizationCostModel::collectInstsToScalarize ( unsigned  VF)

◆ collectUniformsAndScalars()

void llvm::LoopVectorizationCostModel::collectUniformsAndScalars ( unsigned  VF)
inline

Collect Uniform and Scalar values for the given VF.

The sets depend on CM decision for Load/Store instructions that may be vectorized as interleave, gather-scatter or scalarized.

Definition at line 1370 of file LoopVectorize.cpp.

◆ collectValuesToIgnore()

void LoopVectorizationCostModel::collectValuesToIgnore ( )

◆ computeMaxVF()

Optional< unsigned > LoopVectorizationCostModel::computeMaxVF ( bool  OptForSize)

◆ getInterleavedAccessGroup()

const InterleaveGroup* llvm::LoopVectorizationCostModel::getInterleavedAccessGroup ( Instruction Instr)
inline

Get the interleaved access group that Instr belongs to.

Definition at line 1429 of file LoopVectorize.cpp.

Referenced by llvm::InnerLoopVectorizer::vectorizeInterleaveGroup().

◆ getMinimalBitwidths()

const MapVector<Instruction *, uint64_t>& llvm::LoopVectorizationCostModel::getMinimalBitwidths ( ) const
inline
Returns
The smallest bitwidth each instruction can be represented with. The vector equivalents of these instructions should be truncated to this type.

Definition at line 1242 of file LoopVectorize.cpp.

Referenced by llvm::InnerLoopVectorizer::truncateToMinimalBitwidths().

◆ getSmallestAndWidestTypes()

std::pair< unsigned, unsigned > LoopVectorizationCostModel::getSmallestAndWidestTypes ( )
Returns
The size (in bits) of the smallest and widest types in the code that needs to be vectorized. We ignore values that remain scalar such as 64 bit loop indices.

Definition at line 5075 of file LoopVectorize.cpp.

References llvm::RecurrenceDescriptor::getRecurrenceType(), llvm::LoopVectorizationLegality::getReductionVars(), llvm::Type::getScalarType(), llvm::DataLayout::getTypeSizeInBits(), I, llvm::Type::isPointerTy(), llvm::LoopVectorizationLegality::isReductionVariable(), llvm::InnerLoopVectorizer::Legal, llvm::max(), and llvm::ARM_MB::ST.

◆ getWideningCost()

unsigned llvm::LoopVectorizationCostModel::getWideningCost ( Instruction I,
unsigned  VF 
)
inline

Return the vectorization cost for the given instruction I and vector width VF.

Definition at line 1330 of file LoopVectorize.cpp.

References assert().

◆ getWideningDecision()

InstWidening llvm::LoopVectorizationCostModel::getWideningDecision ( Instruction I,
unsigned  VF 
)
inline

Return the cost model decision for the given instruction I and vector width VF.

Return CM_Unknown if this instruction did not pass through the cost modeling.

Definition at line 1319 of file LoopVectorize.cpp.

References assert().

Referenced by llvm::InnerLoopVectorizer::vectorizeMemoryInstruction().

◆ isAccessInterleaved()

bool llvm::LoopVectorizationCostModel::isAccessInterleaved ( Instruction Instr)
inline

Check if Instr belongs to any interleaved access group.

Definition at line 1424 of file LoopVectorize.cpp.

◆ isLegalGatherOrScatter()

bool llvm::LoopVectorizationCostModel::isLegalGatherOrScatter ( Value V)
inline

Returns true if the target machine can represent V as a masked gather or scatter operation.

Definition at line 1405 of file LoopVectorize.cpp.

References getMemInstValueType(), I, llvm::InnerLoopVectorizer::LI, and SI.

◆ isLegalMaskedGather()

bool llvm::LoopVectorizationCostModel::isLegalMaskedGather ( Type DataType)
inline

Returns true if the target machine supports masked gather operation for the given DataType.

Definition at line 1399 of file LoopVectorize.cpp.

References llvm::TargetTransformInfo::isLegalMaskedGather(), and llvm::InnerLoopVectorizer::TTI.

◆ isLegalMaskedLoad()

bool llvm::LoopVectorizationCostModel::isLegalMaskedLoad ( Type DataType,
Value Ptr 
)
inline

Returns true if the target machine supports masked load operation for the given DataType and kind of access to Ptr.

Definition at line 1387 of file LoopVectorize.cpp.

References llvm::LoopVectorizationLegality::isConsecutivePtr(), llvm::TargetTransformInfo::isLegalMaskedLoad(), llvm::InnerLoopVectorizer::Legal, and llvm::InnerLoopVectorizer::TTI.

◆ isLegalMaskedScatter()

bool llvm::LoopVectorizationCostModel::isLegalMaskedScatter ( Type DataType)
inline

Returns true if the target machine supports masked scatter operation for the given DataType.

Definition at line 1393 of file LoopVectorize.cpp.

References llvm::TargetTransformInfo::isLegalMaskedScatter(), and llvm::InnerLoopVectorizer::TTI.

◆ isLegalMaskedStore()

bool llvm::LoopVectorizationCostModel::isLegalMaskedStore ( Type DataType,
Value Ptr 
)
inline

Returns true if the target machine supports masked store operation for the given DataType and kind of access to Ptr.

Definition at line 1381 of file LoopVectorize.cpp.

References llvm::LoopVectorizationLegality::isConsecutivePtr(), llvm::TargetTransformInfo::isLegalMaskedStore(), llvm::InnerLoopVectorizer::Legal, and llvm::InnerLoopVectorizer::TTI.

◆ isOptimizableIVTruncate()

bool llvm::LoopVectorizationCostModel::isOptimizableIVTruncate ( Instruction I,
unsigned  VF 
)
inline

Return True if instruction I is an optimizable truncate whose operand is an induction variable.

Such a truncate will be removed by adding a new induction variable with the destination type.

Definition at line 1340 of file LoopVectorize.cpp.

References llvm::dyn_cast(), llvm::LoopVectorizationLegality::getPrimaryInduction(), I, llvm::LoopVectorizationLegality::isInductionPhi(), llvm::TargetTransformInfo::isTruncateFree(), llvm::InnerLoopVectorizer::Legal, ToVectorTy(), and llvm::InnerLoopVectorizer::TTI.

◆ isProfitableToScalarize()

bool llvm::LoopVectorizationCostModel::isProfitableToScalarize ( Instruction I,
unsigned  VF 
) const
inline
Returns
True if it is more profitable to scalarize instruction I for vectorization factor VF.

Definition at line 1248 of file LoopVectorize.cpp.

References assert().

Referenced by llvm::InnerLoopVectorizer::shouldScalarizeInstruction().

◆ isScalarAfterVectorization()

bool llvm::LoopVectorizationCostModel::isScalarAfterVectorization ( Instruction I,
unsigned  VF 
) const
inline

Returns true if I is known to be scalar after vectorization.

Definition at line 1266 of file LoopVectorize.cpp.

References assert().

Referenced by llvm::InnerLoopVectorizer::shouldScalarizeInstruction().

◆ isScalarWithPredication()

bool LoopVectorizationCostModel::isScalarWithPredication ( Instruction I)

Returns true if I is an instruction that will be scalarized with predication.

Such instructions include conditional stores and instructions that may divide by zero.

Definition at line 4351 of file LoopVectorize.cpp.

References llvm::LoopVectorizationLegality::blockNeedsPredication(), llvm::getLoadStorePointerOperand(), getMemInstValueType(), llvm::Instruction::getOpcode(), llvm::Instruction::getParent(), I, llvm::LoopVectorizationLegality::isMaskRequired(), llvm::InnerLoopVectorizer::Legal, llvm::SPII::Load, mayDivideByZero(), Ptr, and llvm::SPII::Store.

◆ isUniformAfterVectorization()

bool llvm::LoopVectorizationCostModel::isUniformAfterVectorization ( Instruction I,
unsigned  VF 
) const
inline

◆ memoryInstructionCanBeWidened()

bool LoopVectorizationCostModel::memoryInstructionCanBeWidened ( Instruction I,
unsigned  VF = 1 
)

Returns true if I is a memory instruction with consecutive memory access that can be widened.

Definition at line 4376 of file LoopVectorize.cpp.

References llvm::AMDGPU::HSAMD::Kernel::Arg::Key::Align, llvm::all_of(), assert(), B, llvm::SetVector< T, Vector, Set >::begin(), llvm::LoopBlocksDFS::beginRPO(), llvm::SetVector< T, Vector, Set >::count(), llvm::SmallPtrSetImpl< PtrType >::count(), llvm::dbgs(), DFS(), llvm::dyn_cast(), E, llvm::MapVector< KeyT, ValueT, MapType, VectorType >::empty(), llvm::SetVector< T, Vector, Set >::end(), llvm::LoopBlocksDFS::endRPO(), llvm::SCEVConstant::getAPInt(), llvm::Module::getDataLayout(), llvm::PointerType::getElementType(), llvm::InterleaveGroup::getIndex(), llvm::LoopVectorizationLegality::getInductionVars(), llvm::getLoadStorePointerOperand(), getMemInstAddressSpace(), getMemInstAlignment(), llvm::ScalarEvolution::getMinusSCEV(), llvm::Instruction::getModule(), llvm::User::getOperand(), llvm::Instruction::getParent(), llvm::getPtrStride(), llvm::PredicatedScalarEvolution::getSE(), llvm::APInt::getSExtValue(), llvm::BasicBlock::getTerminator(), llvm::Value::getType(), hasIrregularType(), I, llvm::InnerLoopVectorizer::Induction, llvm::SetVector< T, Vector, Set >::insert(), llvm::SetVector< T, SmallVector< T, N >, SmallDenseSet< T, N > >::insert(), llvm::SmallPtrSetImpl< PtrType >::insert(), llvm::InterleaveGroup::insertMember(), llvm::LoopVectorizationLegality::isConsecutivePtr(), llvm::HexagonMCInstrInfo::isPredicated(), llvm::InnerLoopVectorizer::Legal, llvm::InnerLoopVectorizer::LI, LLVM_DEBUG, llvm::make_range(), llvm::Instruction::mayReadFromMemory(), llvm::Instruction::mayWriteToMemory(), llvm::User::operand_values(), llvm::LoopBlocksDFS::perform(), llvm::InnerLoopVectorizer::PSE, Ptr, llvm::MapVector< KeyT, ValueT, MapType, VectorType >::rbegin(), llvm::SetVector< T, SmallVector< T, N >, SmallDenseSet< T, N > >::remove(), llvm::MapVector< KeyT, ValueT, MapType, VectorType >::rend(), llvm::replaceSymbolicStrideSCEV(), llvm::InterleaveGroup::setInsertPos(), SI, llvm::SetVector< T, Vector, Set >::size(), llvm::AMDGPU::HSAMD::Kernel::Arg::Key::Size, and llvm::InnerLoopVectorizer::VF.

◆ requiresScalarEpilogue()

bool llvm::LoopVectorizationCostModel::requiresScalarEpilogue ( ) const
inline

Returns true if an interleaved group requires a scalar iteration to handle accesses with gaps.

Definition at line 1435 of file LoopVectorize.cpp.

References llvm::createLVMissedAnalysis().

Referenced by llvm::InnerLoopVectorizer::emitMinimumIterationCountCheck(), and llvm::InnerLoopVectorizer::getOrCreateVectorTripCount().

◆ selectInterleaveCount()

unsigned LoopVectorizationCostModel::selectInterleaveCount ( bool  OptForSize,
unsigned  VF,
unsigned  LoopCost 
)
Returns
The desired interleave count. If interleave count has been specified by metadata it will be returned. Otherwise, the interleave count is computed and returned. VF and LoopCost are the selected vectorization factor and the cost of the selected VF.

Definition at line 5130 of file LoopVectorize.cpp.

References llvm::dbgs(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::empty(), llvm::TargetTransformInfo::enableAggressiveInterleaving(), EnableIndVarRegisterHeur, EnableLoadStoreRuntimeInterleave, F(), ForceTargetMaxScalarInterleaveFactor, ForceTargetMaxVectorInterleaveFactor, ForceTargetNumScalarRegs, ForceTargetNumVectorRegs, llvm::TargetTransformInfo::getMaxInterleaveFactor(), llvm::LoopVectorizationLegality::getMaxSafeDepDistBytes(), llvm::TargetTransformInfo::getNumberOfRegisters(), llvm::LoopVectorizationLegality::getNumLoads(), llvm::LoopVectorizationLegality::getNumStores(), llvm::LoopVectorizationLegality::getReductionVars(), llvm::LoopVectorizationLegality::getRuntimePointerChecking(), llvm::PredicatedScalarEvolution::getSE(), llvm::ScalarEvolution::getSmallConstantTripCount(), llvm::InnerLoopVectorizer::Legal, LLVM_DEBUG, llvm::LoopVectorizationCostModel::RegisterUsage::LoopInvariantRegs, llvm::max(), llvm::LoopVectorizationCostModel::RegisterUsage::MaxLocalUsers, MaxNestedScalarReductionIC, llvm::RuntimePointerChecking::Need, llvm::PowerOf2Floor(), llvm::InnerLoopVectorizer::PSE, SmallLoopCost, and llvm::InnerLoopVectorizer::TTI.

Referenced by llvm::LoopVectorizePass::processLoop().

◆ selectUserVectorizationFactor()

void llvm::LoopVectorizationCostModel::selectUserVectorizationFactor ( unsigned  UserVF)
inline

Setup cost-based decisions for user vectorization factor.

Definition at line 1196 of file LoopVectorize.cpp.

References llvm::InnerLoopVectorizer::VF.

◆ selectVectorizationFactor()

VectorizationFactor LoopVectorizationCostModel::selectVectorizationFactor ( unsigned  MaxVF)
Returns
The most profitable vectorization factor and the cost of that VF. This method checks every power of two up to MaxVF. If UserVF is not ZERO then this vectorization factor will be selected if vectorization is possible.

Definition at line 5023 of file LoopVectorize.cpp.

References C, llvm::InnerLoopVectorizer::Cost, llvm::dbgs(), llvm::OptimizationRemarkEmitter::emit(), EnableCondStoresVectorization, llvm::LoopVectorizeHints::FK_Enabled, LLVM_DEBUG, llvm::max(), and llvm::InnerLoopVectorizer::ORE.

◆ setCostBasedWideningDecision()

void LoopVectorizationCostModel::setCostBasedWideningDecision ( unsigned  VF)

Memory access instruction may be vectorized in more than one way.

Form of instruction after vectorization depends on cost. This function takes cost-based decisions for Load/Store instructions and collects them in a map. This decisions map is used for building the lists of loop-uniform and loop-scalar instructions. The calculated cost is saved with widening decision in order to avoid redundant calculations.

Definition at line 5841 of file LoopVectorize.cpp.

References llvm::MCID::Add, assert(), llvm::MCID::Call, llvm::InnerLoopVectorizer::Cost, llvm::dyn_cast(), llvm::SmallVectorBase::empty(), llvm::IntegerType::get(), llvm::VectorType::get(), llvm::TargetTransformInfo::getArithmeticInstrCost(), llvm::TargetTransformInfo::getCastInstrCost(), llvm::TargetTransformInfo::getCFInstrCost(), llvm::TargetTransformInfo::getCmpSelInstrCost(), llvm::SelectInst::getCondition(), llvm::Type::getContext(), llvm::Type::getInt1Ty(), llvm::getLoadStorePointerOperand(), getMemInstValueType(), llvm::Instruction::getOpcode(), llvm::User::getOperand(), llvm::Instruction::getParent(), getReciprocalPredBlockProb(), llvm::TargetTransformInfo::getScalarizationOverhead(), getScalarizationOverhead(), llvm::PredicatedScalarEvolution::getSE(), llvm::TargetTransformInfo::getShuffleCost(), llvm::getSplatValue(), llvm::BranchInst::getSuccessor(), llvm::Value::getType(), llvm::ConstantInt::getValue(), getVectorCallCost(), getVectorIntrinsicCost(), llvm::getVectorIntrinsicIDForCall(), I, llvm::SmallPtrSetImpl< PtrType >::insert(), llvm::BranchInst::isConditional(), llvm::LoopVectorizationLegality::isConsecutivePtr(), llvm::LoopVectorizationLegality::isFirstOrderRecurrence(), llvm::APInt::isPowerOf2(), isStrideMul(), llvm::LoopVectorizationLegality::isUniform(), llvm::Type::isVectorTy(), largestIntegerVectorType(), llvm::InnerLoopVectorizer::Legal, LLVM_FALLTHROUGH, llvm::SPII::Load, llvm::max(), N, llvm::TargetTransformInfo::OK_AnyValue, llvm::TargetTransformInfo::OK_NonUniformConstantValue, llvm::TargetTransformInfo::OK_UniformConstantValue, llvm::TargetTransformInfo::OK_UniformValue, llvm::TargetTransformInfo::OP_None, llvm::TargetTransformInfo::OP_PowerOf2, llvm::User::operand_values(), llvm::User::operands(), llvm::SmallVectorImpl< T >::pop_back_val(), llvm::TargetTransformInfo::prefersVectorizedAddressing(), llvm::InnerLoopVectorizer::PSE, Ptr, llvm::SmallVectorTemplateBase< T, isPodLike< T >::value >::push_back(), llvm::MCID::Select, SI, llvm::TargetTransformInfo::SK_ExtractSubvector, smallestIntegerVectorType(), llvm::SPII::Store, llvm::InnerLoopVectorizer::TLI, ToVectorTy(), llvm::InnerLoopVectorizer::TTI, and llvm::InnerLoopVectorizer::VF.

◆ setWideningDecision() [1/2]

void llvm::LoopVectorizationCostModel::setWideningDecision ( Instruction I,
unsigned  VF,
InstWidening  W,
unsigned  Cost 
)
inline

Save vectorization decision W and Cost taken by the cost model for instruction I and vector width VF.

Definition at line 1293 of file LoopVectorize.cpp.

References assert().

◆ setWideningDecision() [2/2]

void llvm::LoopVectorizationCostModel::setWideningDecision ( const InterleaveGroup Grp,
unsigned  VF,
InstWidening  W,
unsigned  Cost 
)
inline

Save vectorization decision W and Cost taken by the cost model for interleaving group Grp and vector width VF.

Broadcast this decicion to all instructions inside the group. But the cost will be assigned to one instruction only.

Definition at line 1301 of file LoopVectorize.cpp.

References assert(), llvm::InterleaveGroup::getFactor(), llvm::InterleaveGroup::getInsertPos(), llvm::InterleaveGroup::getMember(), and I.

Member Data Documentation

◆ AC

AssumptionCache* llvm::LoopVectorizationCostModel::AC

Assumption cache.

Definition at line 1594 of file LoopVectorize.cpp.

◆ DB

DemandedBits* llvm::LoopVectorizationCostModel::DB

Demanded bits analysis.

Definition at line 1591 of file LoopVectorize.cpp.

◆ Hints

const LoopVectorizeHints* llvm::LoopVectorizationCostModel::Hints

Loop Vectorize Hint.

Definition at line 1602 of file LoopVectorize.cpp.

◆ InterleaveInfo

InterleavedAccessInfo& llvm::LoopVectorizationCostModel::InterleaveInfo

The interleave access information contains groups of interleaved accesses with the same stride and close to each other.

Definition at line 1606 of file LoopVectorize.cpp.

◆ Legal

LoopVectorizationLegality* llvm::LoopVectorizationCostModel::Legal

Vectorization legality.

Definition at line 1582 of file LoopVectorize.cpp.

◆ LI

LoopInfo* llvm::LoopVectorizationCostModel::LI

Loop Info analysis.

Definition at line 1579 of file LoopVectorize.cpp.

◆ ORE

OptimizationRemarkEmitter* llvm::LoopVectorizationCostModel::ORE

Interface to emit optimization remarks.

Definition at line 1597 of file LoopVectorize.cpp.

◆ PSE

PredicatedScalarEvolution& llvm::LoopVectorizationCostModel::PSE

Predicated scalar evolution analysis.

Definition at line 1576 of file LoopVectorize.cpp.

◆ TheFunction

const Function* llvm::LoopVectorizationCostModel::TheFunction

Definition at line 1599 of file LoopVectorize.cpp.

◆ TheLoop

Loop* llvm::LoopVectorizationCostModel::TheLoop

The loop that we evaluate.

Definition at line 1573 of file LoopVectorize.cpp.

◆ TLI

const TargetLibraryInfo* llvm::LoopVectorizationCostModel::TLI

Target Library Info.

Definition at line 1588 of file LoopVectorize.cpp.

◆ TTI

const TargetTransformInfo& llvm::LoopVectorizationCostModel::TTI

Vector target information.

Definition at line 1585 of file LoopVectorize.cpp.

◆ ValuesToIgnore

SmallPtrSet<const Value *, 16> llvm::LoopVectorizationCostModel::ValuesToIgnore

Values to ignore in the cost model.

Definition at line 1609 of file LoopVectorize.cpp.

◆ VecValuesToIgnore

SmallPtrSet<const Value *, 16> llvm::LoopVectorizationCostModel::VecValuesToIgnore

Values to ignore in the cost model when VF > 1.

Definition at line 1612 of file LoopVectorize.cpp.


The documentation for this class was generated from the following file: