SLPVectorizer: Rewrite ArrayRef slice compare to be more idiomatic.

NFC intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230965 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Benjamin Kramer 2015-03-02 15:24:36 +00:00
parent e1244e83b9
commit 5916e9cddf

View File

@ -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,