[llvm] 8b015b2 - [SLP][NFC]Formatting and reduce number of iterations, NFC.

Alexey Bataev via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 3 05:30:20 PDT 2022


Author: Alexey Bataev
Date: 2022-11-03T05:30:13-07:00
New Revision: 8b015b2078551c52a6811f58e5c4919bb8f9ff5a

URL: https://github.com/llvm/llvm-project/commit/8b015b2078551c52a6811f58e5c4919bb8f9ff5a
DIFF: https://github.com/llvm/llvm-project/commit/8b015b2078551c52a6811f58e5c4919bb8f9ff5a.diff

LOG: [SLP][NFC]Formatting and reduce number of iterations, NFC.

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 be3f560ead854..8a44c4d143506 100644
--- a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+++ b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
@@ -3996,7 +3996,7 @@ static bool isRepeatedNonIdentityClusteredMask(ArrayRef<int> Mask,
   ArrayRef<int> FirstCluster = Mask.slice(0, Sz);
   if (ShuffleVectorInst::isIdentityMask(FirstCluster))
     return false;
-  for (unsigned I = 0, E = Mask.size(); I < E; I += Sz) {
+  for (unsigned I = Sz, E = Mask.size(); I < E; I += Sz) {
     ArrayRef<int> Cluster = Mask.slice(I, Sz);
     if (Cluster != FirstCluster)
       return false;
@@ -4017,8 +4017,8 @@ void BoUpSLP::reorderNodeWithReuses(TreeEntry &TE, ArrayRef<int> Mask) const {
   // Try to improve gathered nodes with clustered reuses, if possible.
   reorderScalars(TE.Scalars, makeArrayRef(TE.ReuseShuffleIndices).slice(0, Sz));
   // Fill the reuses mask with the identity submasks.
-  for (auto It = TE.ReuseShuffleIndices.begin(),
-            End = TE.ReuseShuffleIndices.end();
+  for (auto *It = TE.ReuseShuffleIndices.begin(),
+            *End = TE.ReuseShuffleIndices.end();
        It != End; std::advance(It, Sz))
     std::iota(It, std::next(It + Sz), 0);
 }


        


More information about the llvm-commits mailing list