summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2015-03-02 15:24:36 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2015-03-02 15:24:36 +0000
commitcc34ba687be3028ba4f50b43a29da43da6b496a2 (patch)
tree4914aabed004749e670d4309db889dc1644173c7 /llvm/lib/Transforms
parente1e33139c5fbdaaa26d1ccd210c62648695e1728 (diff)
downloadbcm5719-llvm-cc34ba687be3028ba4f50b43a29da43da6b496a2.tar.gz
bcm5719-llvm-cc34ba687be3028ba4f50b43a29da43da6b496a2.zip
SLPVectorizer: Rewrite ArrayRef slice compare to be more idiomatic.
NFC intended. llvm-svn: 230965
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp14
1 files changed, 5 insertions, 9 deletions
diff --git a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
index baf97418b56..f47d0089b1d 100644
--- a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+++ b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
@@ -3178,15 +3178,11 @@ private:
/// the WeakVH array.
/// Vectorization of part of the VL array may cause later values in the VL array
/// to become invalid. We track when this has happened in the WeakVH array.
-static bool hasValueBeenRAUWed(ArrayRef<Value *> &VL,
- SmallVectorImpl<WeakVH> &VH,
- unsigned SliceBegin,
- unsigned SliceSize) {
- for (unsigned i = SliceBegin; i < SliceBegin + SliceSize; ++i)
- if (VH[i] != VL[i])
- return true;
-
- return false;
+static bool hasValueBeenRAUWed(ArrayRef<Value *> VL, ArrayRef<WeakVH> VH,
+ unsigned SliceBegin, unsigned SliceSize) {
+ VL = VL.slice(SliceBegin, SliceSize);
+ VH = VH.slice(SliceBegin, SliceSize);
+ return !std::equal(VL.begin(), VL.end(), VH.begin());
}
bool SLPVectorizer::vectorizeStoreChain(ArrayRef<Value *> Chain,
OpenPOWER on IntegriCloud