summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
diff options
context:
space:
mode:
authorDavid Majnemer <david.majnemer@gmail.com>2016-08-12 03:55:06 +0000
committerDavid Majnemer <david.majnemer@gmail.com>2016-08-12 03:55:06 +0000
commit42531260b3e0cc6256bd64911fc3db7aea59a68e (patch)
treebb5d1b3e84331a2673079b42a25135d177d5f8e4 /llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
parent1a2cb97f7b6b0a3ad14c7f076b10a1a19834fac7 (diff)
downloadbcm5719-llvm-42531260b3e0cc6256bd64911fc3db7aea59a68e.tar.gz
bcm5719-llvm-42531260b3e0cc6256bd64911fc3db7aea59a68e.zip
Use the range variant of find/find_if instead of unpacking begin/end
If the result of the find is only used to compare against end(), just use is_contained instead. No functionality change is intended. llvm-svn: 278469
Diffstat (limited to 'llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp')
-rw-r--r--llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
index 44de90b7d8b..83d1aff07fe 100644
--- a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+++ b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
@@ -2650,8 +2650,7 @@ Value *BoUpSLP::vectorizeTree() {
// Skip users that we already RAUW. This happens when one instruction
// has multiple uses of the same value.
- if (std::find(Scalar->user_begin(), Scalar->user_end(), User) ==
- Scalar->user_end())
+ if (!is_contained(Scalar->users(), User))
continue;
assert(ScalarToTreeEntry.count(Scalar) && "Invalid scalar");
@@ -3999,8 +3998,7 @@ public:
/// \brief Try to find a reduction tree.
bool matchAssociativeReduction(PHINode *Phi, BinaryOperator *B) {
- assert((!Phi ||
- std::find(Phi->op_begin(), Phi->op_end(), B) != Phi->op_end()) &&
+ assert((!Phi || is_contained(Phi->operands(), B)) &&
"Thi phi needs to use the binary operator");
// We could have a initial reductions that is not an add.
OpenPOWER on IntegriCloud