|
LLVM
5.0.0
|
Bottom Up SLP Vectorizer. More...
Public Types | |
| typedef SmallVector< Value *, 8 > | ValueList |
| typedef SmallVector < Instruction *, 16 > | InstrList |
| typedef SmallPtrSet< Value *, 16 > | ValueSet |
| typedef SmallVector< StoreInst *, 8 > | StoreList |
| typedef MapVector< Value *, SmallVector< Instruction *, 2 > > | ExtraValueToDebugLocsMap |
Public Member Functions | |
| BoUpSLP (Function *Func, ScalarEvolution *Se, TargetTransformInfo *Tti, TargetLibraryInfo *TLi, AliasAnalysis *Aa, LoopInfo *Li, DominatorTree *Dt, AssumptionCache *AC, DemandedBits *DB, const DataLayout *DL, OptimizationRemarkEmitter *ORE) | |
| Value * | vectorizeTree () |
Vectorize the tree that starts with the elements in VL. More... | |
| Value * | vectorizeTree (ExtraValueToDebugLocsMap &ExternallyUsedValues) |
Vectorize the tree but with the list of externally used values ExternallyUsedValues. More... | |
| int | getSpillCost () |
| int | getTreeCost () |
| void | buildTree (ArrayRef< Value * > Roots, ArrayRef< Value * > UserIgnoreLst=None) |
Construct a vectorizable tree that starts at Roots, ignoring users for the purpose of scheduling and extraction in the UserIgnoreLst. More... | |
| void | buildTree (ArrayRef< Value * > Roots, ExtraValueToDebugLocsMap &ExternallyUsedValues, ArrayRef< Value * > UserIgnoreLst=None) |
Construct a vectorizable tree that starts at Roots, ignoring users for the purpose of scheduling and extraction in the UserIgnoreLst taking into account (anf updating it, if required) list of externally used values stored in ExternallyUsedValues. More... | |
| void | deleteTree () |
| Clear the internal data structures that are created by 'buildTree'. More... | |
| unsigned | getTreeSize () const |
| void | optimizeGatherSequence () |
| Perform LICM and CSE on the newly generated gather sequences. More... | |
| bool | shouldReorder () const |
| unsigned | getVectorElementSize (Value *V) |
| void | computeMinimumValueSizes () |
| Compute the minimum type sizes required to represent the entries in a vectorizable tree. More... | |
| unsigned | getMaxVecRegSize () const |
| unsigned | getMinVecRegSize () const |
| unsigned | canMapToVector (Type *T, const DataLayout &DL) const |
| Check if ArrayType or StructType is isomorphic to some VectorType. More... | |
| bool | isTreeTinyAndNotFullyVectorizable () |
| OptimizationRemarkEmitter * | getORE () |
Friends | |
| struct | GraphTraits< BoUpSLP * > |
| struct | DOTGraphTraits< BoUpSLP * > |
| raw_ostream & | operator<< (raw_ostream &os, const BoUpSLP::ScheduleData &SD) |
Bottom Up SLP Vectorizer.
Definition at line 297 of file SLPVectorizer.cpp.
| typedef MapVector<Value *, SmallVector<Instruction *, 2> > llvm::slpvectorizer::BoUpSLP::ExtraValueToDebugLocsMap |
Definition at line 304 of file SLPVectorizer.cpp.
| typedef SmallVector<Instruction *, 16> llvm::slpvectorizer::BoUpSLP::InstrList |
Definition at line 300 of file SLPVectorizer.cpp.
| typedef SmallVector<StoreInst *, 8> llvm::slpvectorizer::BoUpSLP::StoreList |
Definition at line 302 of file SLPVectorizer.cpp.
| typedef SmallVector<Value *, 8> llvm::slpvectorizer::BoUpSLP::ValueList |
Definition at line 299 of file SLPVectorizer.cpp.
| typedef SmallPtrSet<Value *, 16> llvm::slpvectorizer::BoUpSLP::ValueSet |
Definition at line 301 of file SLPVectorizer.cpp.
|
inline |
Definition at line 306 of file SLPVectorizer.cpp.
References llvm::CodeMetrics::collectEphemeralValues(), F, MaxVectorRegSizeOption, and MinVectorRegSizeOption.
Construct a vectorizable tree that starts at Roots, ignoring users for the purpose of scheduling and extraction in the UserIgnoreLst.
Definition at line 1052 of file SLPVectorizer.cpp.
| void BoUpSLP::buildTree | ( | ArrayRef< Value * > | Roots, |
| ExtraValueToDebugLocsMap & | ExternallyUsedValues, | ||
| ArrayRef< Value * > | UserIgnoreLst = None |
||
| ) |
Construct a vectorizable tree that starts at Roots, ignoring users for the purpose of scheduling and extraction in the UserIgnoreLst taking into account (anf updating it, if required) list of externally used values stored in ExternallyUsedValues.
Definition at line 1057 of file SLPVectorizer.cpp.
References allSameType(), assert(), llvm::dbgs(), DEBUG, deleteTree(), llvm::dyn_cast(), llvm::SmallVectorImpl< T >::emplace_back(), llvm::MapVector< KeyT, ValueT, MapType, VectorType >::end(), llvm::MapVector< KeyT, ValueT, MapType, VectorType >::find(), InTreeUserNeedToExtract(), llvm::is_contained(), llvm::AArch64CC::LE, llvm::SmallVectorTemplateBase< T, isPodLike >::push_back(), llvm::NVPTX::PTXLdStInstCode::Scalar, and llvm::Value::users().
| unsigned BoUpSLP::canMapToVector | ( | Type * | T, |
| const DataLayout & | DL | ||
| ) | const |
Check if ArrayType or StructType is isomorphic to some VectorType.
Definition at line 1641 of file SLPVectorizer.cpp.
References llvm::dyn_cast(), llvm::VectorType::get(), llvm::DataLayout::getTypeStoreSizeInBits(), isValidElementType(), N, llvm::ARM_MB::ST, and T.
| void BoUpSLP::computeMinimumValueSizes | ( | ) |
Compute the minimum type sizes required to represent the entries in a vectorizable tree.
Definition at line 3627 of file SLPVectorizer.cpp.
References llvm::all_of(), collectValuesToDemote(), llvm::computeKnownBits(), llvm::ComputeNumSignBits(), llvm::dyn_cast(), llvm::SmallVectorBase::empty(), llvm::DemandedBits::getDemandedBits(), llvm::DataLayout::getTypeSizeInBits(), llvm::SmallPtrSetImpl< PtrType >::insert(), llvm::KnownBits::isNonNegative(), llvm::isPowerOf2_64(), llvm::BitmaskEnumDetail::Mask(), llvm::NextPowerOf2(), llvm::SmallVectorImpl< T >::pop_back_val(), and llvm::NVPTX::PTXLdStInstCode::Scalar.
|
inline |
Clear the internal data structures that are created by 'buildTree'.
Definition at line 360 of file SLPVectorizer.cpp.
Referenced by buildTree().
|
inline |
Definition at line 396 of file SLPVectorizer.cpp.
|
inline |
Definition at line 401 of file SLPVectorizer.cpp.
|
inline |
Definition at line 414 of file SLPVectorizer.cpp.
| int BoUpSLP::getSpillCost | ( | ) |
Definition at line 1991 of file SLPVectorizer.cpp.
References llvm::dbgs(), DEBUG, llvm::Value::dump(), llvm::dyn_cast(), llvm::SmallPtrSetImpl< PtrType >::erase(), llvm::VectorType::get(), llvm::TargetTransformInfo::getCostOfKeepingLiveOverCall(), llvm::ilist_node_impl< OptionsT >::getIterator(), llvm::Instruction::getParent(), llvm::ilist_iterator< OptionsT, IsReverse, IsConst >::getReverse(), llvm::SmallPtrSetImpl< PtrType >::insert(), N, llvm::User::operands(), llvm::SmallVectorTemplateBase< T, isPodLike< T >::value >::push_back(), llvm::BasicBlock::rbegin(), llvm::BasicBlock::rend(), llvm::SmallPtrSetImplBase::size(), and X.
Referenced by getTreeCost().
| int BoUpSLP::getTreeCost | ( | ) |
VL. A negative number means that this is profitable. Definition at line 2053 of file SLPVectorizer.cpp.
References C, llvm::dbgs(), DEBUG, F, llvm::IntegerType::get(), llvm::VectorType::get(), llvm::TargetTransformInfo::getExtractWithExtendCost(), getSpillCost(), llvm::TargetTransformInfo::getVectorInstrCost(), llvm::SmallSet< T, N, C >::insert(), llvm::ViewGraph(), and ViewSLPTree.
|
inline |
Definition at line 374 of file SLPVectorizer.cpp.
V. If V is a store, the size is the width of the stored value. Otherwise, the size is the width of the largest loaded value reaching V. This method is used by the vectorizer to calculate vectorization factors. Definition at line 3497 of file SLPVectorizer.cpp.
References llvm::SmallPtrSetImpl< PtrType >::count(), llvm::SmallVectorBase::empty(), llvm::Value::getType(), llvm::DataLayout::getTypeSizeInBits(), I, llvm::SmallPtrSetImpl< PtrType >::insert(), llvm::User::operands(), llvm::SmallVectorImpl< T >::pop_back_val(), llvm::SmallVectorTemplateBase< T, isPodLike< T >::value >::push_back(), and llvm::SPII::Store.
| bool BoUpSLP::isTreeTinyAndNotFullyVectorizable | ( | ) |
Definition at line 1970 of file SLPVectorizer.cpp.
References assert(), llvm::SmallVectorBase::empty(), and MinTreeSize.
| void BoUpSLP::optimizeGatherSequence | ( | ) |
Perform LICM and CSE on the newly generated gather sequences.
Definition at line 3012 of file SLPVectorizer.cpp.
References A, assert(), B, llvm::SmallVectorTemplateCommon< T >::begin(), llvm::BasicBlock::begin(), llvm::LoopBase< N, M >::contains(), llvm::dbgs(), DEBUG, llvm::DominatorTree::dominates(), llvm::dyn_cast(), E, llvm::SmallVectorTemplateCommon< T >::end(), llvm::BasicBlock::end(), llvm::LoopBase< N, M >::getLoopPreheader(), llvm::DominatorTreeBase< N, IsPostDom >::getNode(), llvm::User::getOperand(), llvm::Instruction::getParent(), llvm::BasicBlock::getTerminator(), I, llvm::tgtok::In, llvm::is_contained(), llvm::Instruction::isIdenticalTo(), llvm::DominatorTree::isReachableFromEntry(), llvm::Instruction::moveBefore(), N, llvm::DominatorTreeBase< N, IsPostDom >::properlyDominates(), llvm::SmallVectorTemplateBase< T, isPodLike< T >::value >::push_back(), llvm::Value::replaceAllUsesWith(), and llvm::SmallVectorImpl< T >::reserve().
|
inline |
Definition at line 380 of file SLPVectorizer.cpp.
| Value * BoUpSLP::vectorizeTree | ( | ) |
Vectorize the tree that starts with the elements in VL.
Returns the vectorized root.
Definition at line 2855 of file SLPVectorizer.cpp.
Referenced by vectorizeTree().
| Value * BoUpSLP::vectorizeTree | ( | ExtraValueToDebugLocsMap & | ExternallyUsedValues | ) |
Vectorize the tree but with the list of externally used values ExternallyUsedValues.
Values in this MapVector can be replaced but the generated extractvalue instructions.
Definition at line 2861 of file SLPVectorizer.cpp.
References assert(), llvm::IRBuilderBase::ClearInsertionPoint(), llvm::MapVector< KeyT, ValueT, MapType, VectorType >::count(), llvm::IRBuilder< T, Inserter >::CreateExtractElement(), llvm::IRBuilder< T, Inserter >::CreateSExt(), llvm::IRBuilder< T, Inserter >::CreateTrunc(), llvm::IRBuilder< T, Inserter >::CreateZExt(), llvm::dbgs(), DEBUG, llvm::MapVector< KeyT, ValueT, MapType, VectorType >::erase(), F, llvm::IntegerType::get(), llvm::VectorType::get(), llvm::UndefValue::get(), llvm::PHINode::getIncomingBlock(), llvm::PHINode::getIncomingValue(), llvm::IRBuilderBase::getInt32(), llvm::PHINode::getNumIncomingValues(), getParent(), llvm::BasicBlock::getTerminator(), llvm::Value::getType(), llvm::MapVector< KeyT, ValueT, MapType, VectorType >::insert(), llvm::is_contained(), llvm::Type::isVoidTy(), llvm::AArch64CC::LE, llvm::Value::replaceAllUsesWith(), llvm::User::replaceUsesOfWith(), llvm::NVPTX::PTXLdStInstCode::Scalar, second, llvm::IRBuilderBase::SetInsertPoint(), llvm::User::setOperand(), llvm::SmallVectorTemplateCommon< T, typename >::size(), llvm::RegState::Undef, llvm::User::User(), llvm::Value::users(), and vectorizeTree().
|
friend |
Definition at line 760 of file SLPVectorizer.cpp.
|
friend |
Definition at line 759 of file SLPVectorizer.cpp.
|
friend |
Definition at line 753 of file SLPVectorizer.cpp.
1.8.6