[llvm] 0a349d5 - [SLP] clean up - use 'const' and ArrayRef constructor; NFC

Sanjay Patel via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 24 12:32:00 PDT 2020


Author: Sanjay Patel
Date: 2020-09-24T15:31:07-04:00
New Revision: 0a349d5827f6864ee89a5d0867d609339c07115d

URL: https://github.com/llvm/llvm-project/commit/0a349d5827f6864ee89a5d0867d609339c07115d
DIFF: https://github.com/llvm/llvm-project/commit/0a349d5827f6864ee89a5d0867d609339c07115d.diff

LOG: [SLP] clean up - use 'const' and ArrayRef constructor; NFC

Follow-on tidying suggested in the post-commit review of 6a23668.

Added: 
    

Modified: 
    llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
index 8722ff9ba95c..0f60d60726f2 100644
--- a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+++ b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
@@ -6853,7 +6853,7 @@ class HorizontalReduction {
     BoUpSLP::ExtraValueToDebugLocsMap ExternallyUsedValues;
     // The same extra argument may be used several times, so log each attempt
     // to use it.
-    for (std::pair<Instruction *, Value *> &Pair : ExtraArgs) {
+    for (const std::pair<Instruction *, Value *> &Pair : ExtraArgs) {
       assert(Pair.first && "DebugLoc must be set.");
       ExternallyUsedValues[Pair.second].push_back(Pair.first);
     }
@@ -6908,7 +6908,7 @@ class HorizontalReduction {
     Value *VectorizedTree = nullptr;
     unsigned i = 0;
     while (i < NumReducedVals - ReduxWidth + 1 && ReduxWidth > 2) {
-      ArrayRef<Value *> VL = makeArrayRef(&ReducedVals[i], ReduxWidth);
+      ArrayRef<Value *> VL(&ReducedVals[i], ReduxWidth);
       V.buildTree(VL, ExternallyUsedValues, IgnoreList);
       Optional<ArrayRef<unsigned>> Order = V.bestOrder();
       if (Order) {
@@ -7664,7 +7664,7 @@ bool SLPVectorizerPass::vectorizeGEPIndices(BasicBlock *BB, BoUpSLP &R) {
     unsigned MaxElts = MaxVecRegSize / EltSize;
     for (unsigned BI = 0, BE = Entry.second.size(); BI < BE; BI += MaxElts) {
       auto Len = std::min<unsigned>(BE - BI, MaxElts);
-      auto GEPList = makeArrayRef(&Entry.second[BI], Len);
+      ArrayRef<GetElementPtrInst *> GEPList(&Entry.second[BI], Len);
 
       // Initialize a set a candidate getelementptrs. Note that we use a
       // SetVector here to preserve program order. If the index computations


        


More information about the llvm-commits mailing list