[llvm] r337992 - [LoadStoreVectorizer] Use const reference

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 25 18:11:36 PDT 2018


Author: maskray
Date: Wed Jul 25 18:11:36 2018
New Revision: 337992

URL: http://llvm.org/viewvc/llvm-project?rev=337992&view=rev
Log:
[LoadStoreVectorizer] Use const reference

Modified:
    llvm/trunk/lib/Transforms/Vectorize/LoadStoreVectorizer.cpp

Modified: llvm/trunk/lib/Transforms/Vectorize/LoadStoreVectorizer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Vectorize/LoadStoreVectorizer.cpp?rev=337992&r1=337991&r2=337992&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Vectorize/LoadStoreVectorizer.cpp (original)
+++ llvm/trunk/lib/Transforms/Vectorize/LoadStoreVectorizer.cpp Wed Jul 25 18:11:36 2018
@@ -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(Val
 }
 
 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::lookThroughComplexAddre
   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;




More information about the llvm-commits mailing list