From a15fff454ff419140813902245b2c3aad1897c2e Mon Sep 17 00:00:00 2001 From: Simon Pilgrim Date: Mon, 1 Apr 2019 17:32:46 +0000 Subject: [PATCH] [SLP] getGatherCost and isFullyVectorizableTinyTree are const methods. NFCI. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357414 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/Vectorize/SLPVectorizer.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/Transforms/Vectorize/SLPVectorizer.cpp b/lib/Transforms/Vectorize/SLPVectorizer.cpp index 9bed86b16bd..1b14f7adbe1 100644 --- a/lib/Transforms/Vectorize/SLPVectorizer.cpp +++ b/lib/Transforms/Vectorize/SLPVectorizer.cpp @@ -662,12 +662,12 @@ private: /// \returns the scalarization cost for this type. Scalarization in this /// context means the creation of vectors from a group of scalars. - int getGatherCost(Type *Ty, const DenseSet &ShuffledIndices); + int getGatherCost(Type *Ty, const DenseSet &ShuffledIndices) const; /// \returns the scalarization cost for this list of values. Assuming that /// this subtree gets vectorized, we may need to extract the values from the /// roots. This method calculates the cost of extracting the values. - int getGatherCost(ArrayRef VL); + int getGatherCost(ArrayRef VL) const; /// Set the Builder insert point to one after the last instruction in /// the bundle @@ -679,7 +679,7 @@ private: /// \returns whether the VectorizableTree is fully vectorizable and will /// be beneficial even the tree height is tiny. - bool isFullyVectorizableTinyTree(); + bool isFullyVectorizableTinyTree() const; /// \reorder commutative operands to get better probability of /// generating vectorized code. @@ -2577,7 +2577,7 @@ int BoUpSLP::getEntryCost(TreeEntry *E) { } } -bool BoUpSLP::isFullyVectorizableTinyTree() { +bool BoUpSLP::isFullyVectorizableTinyTree() const { LLVM_DEBUG(dbgs() << "SLP: Check whether the tree with height " << VectorizableTree.size() << " is fully vectorizable .\n"); @@ -2772,17 +2772,17 @@ int BoUpSLP::getTreeCost() { } int BoUpSLP::getGatherCost(Type *Ty, - const DenseSet &ShuffledIndices) { + const DenseSet &ShuffledIndices) const { int Cost = 0; for (unsigned i = 0, e = cast(Ty)->getNumElements(); i < e; ++i) if (!ShuffledIndices.count(i)) Cost += TTI->getVectorInstrCost(Instruction::InsertElement, Ty, i); if (!ShuffledIndices.empty()) - Cost += TTI->getShuffleCost(TargetTransformInfo::SK_PermuteSingleSrc, Ty); + Cost += TTI->getShuffleCost(TargetTransformInfo::SK_PermuteSingleSrc, Ty); return Cost; } -int BoUpSLP::getGatherCost(ArrayRef VL) { +int BoUpSLP::getGatherCost(ArrayRef VL) const { // Find the type of the operands in VL. Type *ScalarTy = VL[0]->getType(); if (StoreInst *SI = dyn_cast(VL[0])) -- 2.50.1