From: Fangrui Song Date: Thu, 26 Jul 2018 01:11:36 +0000 (+0000) Subject: [LoadStoreVectorizer] Use const reference X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=77618f2a51733f0db0ec9db3700005abc70360b4;p=llvm [LoadStoreVectorizer] Use const reference git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@337992 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Transforms/Vectorize/LoadStoreVectorizer.cpp b/lib/Transforms/Vectorize/LoadStoreVectorizer.cpp index 719df55347a..5f3d127202a 100644 --- a/lib/Transforms/Vectorize/LoadStoreVectorizer.cpp +++ b/lib/Transforms/Vectorize/LoadStoreVectorizer.cpp @@ -147,11 +147,11 @@ private: static const unsigned MaxDepth = 3; bool isConsecutiveAccess(Value *A, Value *B); - bool areConsecutivePointers(Value *PtrA, Value *PtrB, APInt PtrDelta, + bool areConsecutivePointers(Value *PtrA, Value *PtrB, const APInt &PtrDelta, unsigned Depth = 0) const; bool lookThroughComplexAddresses(Value *PtrA, Value *PtrB, APInt PtrDelta, unsigned Depth) const; - bool lookThroughSelects(Value *PtrA, Value *PtrB, APInt PtrDelta, + bool lookThroughSelects(Value *PtrA, Value *PtrB, const APInt &PtrDelta, unsigned Depth) const; /// After vectorization, reorder the instructions that I depends on @@ -319,7 +319,8 @@ bool Vectorizer::isConsecutiveAccess(Value *A, Value *B) { } bool Vectorizer::areConsecutivePointers(Value *PtrA, Value *PtrB, - APInt PtrDelta, unsigned Depth) const { + const APInt &PtrDelta, + unsigned Depth) const { unsigned PtrBitWidth = DL.getPointerTypeSizeInBits(PtrA->getType()); APInt OffsetA(PtrBitWidth, 0); APInt OffsetB(PtrBitWidth, 0); @@ -450,7 +451,8 @@ bool Vectorizer::lookThroughComplexAddresses(Value *PtrA, Value *PtrB, return X == OffsetSCEVB; } -bool Vectorizer::lookThroughSelects(Value *PtrA, Value *PtrB, APInt PtrDelta, +bool Vectorizer::lookThroughSelects(Value *PtrA, Value *PtrB, + const APInt &PtrDelta, unsigned Depth) const { if (Depth++ == MaxDepth) return false;