aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Transforms/Vectorize/SLPVectorizer.cpp
diff options
context:
space:
mode:
authorMatt Arsenault <Matthew.Arsenault@amd.com>2013-08-26 17:56:38 +0000
committerMatt Arsenault <Matthew.Arsenault@amd.com>2013-08-26 17:56:38 +0000
commit6a804acc4ae77c014e4ef97c37f8e720ef360394 (patch)
treeeaf09ddf51da63297d794d6ed8ae356130ac044e /lib/Transforms/Vectorize/SLPVectorizer.cpp
parent1b00d910058c31abb7cc5333b42cd380a3c8e128 (diff)
downloadexternal_llvm-6a804acc4ae77c014e4ef97c37f8e720ef360394.zip
external_llvm-6a804acc4ae77c014e4ef97c37f8e720ef360394.tar.gz
external_llvm-6a804acc4ae77c014e4ef97c37f8e720ef360394.tar.bz2
Constify functions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189234 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Vectorize/SLPVectorizer.cpp')
-rw-r--r--lib/Transforms/Vectorize/SLPVectorizer.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/lib/Transforms/Vectorize/SLPVectorizer.cpp b/lib/Transforms/Vectorize/SLPVectorizer.cpp
index 60749b4..0313e98 100644
--- a/lib/Transforms/Vectorize/SLPVectorizer.cpp
+++ b/lib/Transforms/Vectorize/SLPVectorizer.cpp
@@ -278,7 +278,7 @@ private:
/// \returns the pointer to the vectorized value if \p VL is already
/// vectorized, or NULL. They may happen in cycles.
- Value *alreadyVectorized(ArrayRef<Value *> VL);
+ Value *alreadyVectorized(ArrayRef<Value *> VL) const;
/// \brief Take the pointer operand from the Load/Store instruction.
/// \returns NULL if this is not a valid Load/Store instruction.
@@ -319,7 +319,7 @@ private:
NeedToGather(0) {}
/// \returns true if the scalars in VL are equal to this entry.
- bool isSame(ArrayRef<Value *> VL) {
+ bool isSame(ArrayRef<Value *> VL) const {
assert(VL.size() == Scalars.size() && "Invalid size");
for (int i = 0, e = VL.size(); i != e; ++i)
if (VL[i] != Scalars[i])
@@ -1098,10 +1098,12 @@ Value *BoUpSLP::Gather(ArrayRef<Value *> VL, VectorType *Ty) {
return Vec;
}
-Value *BoUpSLP::alreadyVectorized(ArrayRef<Value *> VL) {
- if (ScalarToTreeEntry.count(VL[0])) {
- int Idx = ScalarToTreeEntry[VL[0]];
- TreeEntry *En = &VectorizableTree[Idx];
+Value *BoUpSLP::alreadyVectorized(ArrayRef<Value *> VL) const {
+ SmallDenseMap<Value*, int>::const_iterator Entry
+ = ScalarToTreeEntry.find(VL[0]);
+ if (Entry != ScalarToTreeEntry.end()) {
+ int Idx = Entry->second;
+ const TreeEntry *En = &VectorizableTree[Idx];
if (En->isSame(VL) && En->VectorizedValue)
return En->VectorizedValue;
}