LLVM  4.0.0
Classes | Public Types | Public Member Functions | Friends | List of all members
llvm::slpvectorizer::BoUpSLP Class Reference

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
 

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)
 
ValuevectorizeTree ()
 Vectorize the tree that starts with the elements in VL. 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 deleteTree ()
 Clear the internal data structures that are created by 'buildTree'. More...
 
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 ()
 

Friends

raw_ostreamoperator<< (raw_ostream &os, const BoUpSLP::ScheduleData &SD)
 

Detailed Description

Bottom Up SLP Vectorizer.

Definition at line 301 of file SLPVectorizer.cpp.

Member Typedef Documentation

Definition at line 304 of file SLPVectorizer.cpp.

Definition at line 306 of file SLPVectorizer.cpp.

Definition at line 303 of file SLPVectorizer.cpp.

Definition at line 305 of file SLPVectorizer.cpp.

Constructor & Destructor Documentation

llvm::slpvectorizer::BoUpSLP::BoUpSLP ( Function Func,
ScalarEvolution Se,
TargetTransformInfo Tti,
TargetLibraryInfo TLi,
AliasAnalysis Aa,
LoopInfo Li,
DominatorTree Dt,
AssumptionCache AC,
DemandedBits DB,
const DataLayout DL 
)
inline

Member Function Documentation

void BoUpSLP::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.

Definition at line 923 of file SLPVectorizer.cpp.

References allSameType(), assert(), llvm::dbgs(), DEBUG, deleteTree(), llvm::dyn_cast(), 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.

Returns
number of elements in vector if isomorphism exists, 0 otherwise.

Definition at line 1499 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 ( )
void llvm::slpvectorizer::BoUpSLP::deleteTree ( )
inline

Clear the internal data structures that are created by 'buildTree'.

Definition at line 348 of file SLPVectorizer.cpp.

Referenced by buildTree().

unsigned llvm::slpvectorizer::BoUpSLP::getMaxVecRegSize ( ) const
inline

Definition at line 382 of file SLPVectorizer.cpp.

unsigned llvm::slpvectorizer::BoUpSLP::getMinVecRegSize ( ) const
inline

Definition at line 387 of file SLPVectorizer.cpp.

int BoUpSLP::getSpillCost ( )
int BoUpSLP::getTreeCost ( )
Returns
the vectorization cost of the subtree that starts at VL. A negative number means that this is profitable.

Definition at line 1902 of file SLPVectorizer.cpp.

References C, llvm::dbgs(), DEBUG, llvm::IntegerType::get(), llvm::VectorType::get(), llvm::Function::getContext(), llvm::TargetTransformInfo::getExtractWithExtendCost(), getSpillCost(), llvm::TargetTransformInfo::getVectorInstrCost(), and llvm::SmallSet< T, N, C >::insert().

unsigned BoUpSLP::getVectorElementSize ( Value V)
Returns
The vector element size in bits to use when vectorizing the expression tree ending at 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 3321 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 ( )
Returns
True if the VectorizableTree is both tiny and not fully vectorizable. We do not vectorize such trees.

Definition at line 1819 of file SLPVectorizer.cpp.

References assert(), llvm::SmallVectorBase::empty(), and MinTreeSize.

void BoUpSLP::optimizeGatherSequence ( )
bool llvm::slpvectorizer::BoUpSLP::shouldReorder ( ) const
inline
Returns
true if it is beneficial to reverse the vector order.

Definition at line 366 of file SLPVectorizer.cpp.

Value * BoUpSLP::vectorizeTree ( )

Friends And Related Function Documentation

raw_ostream& operator<< ( raw_ostream os,
const BoUpSLP::ScheduleData &  SD 
)
friend

Definition at line 703 of file SLPVectorizer.cpp.


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