[llvm] f090e3c - [SLP]Fix write after bounds.

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


Author: Alexey Bataev
Date: 2022-11-03T05:30:41-07:00
New Revision: f090e3c00fc31b99049a2291ebd07075fbdf0be1

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

LOG: [SLP]Fix write after bounds.

Need to use comma instead of + symbol to prevent writing after bounds.

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 8a44c4d14350..f874cfca2876 100644
--- a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+++ b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
@@ -4020,7 +4020,7 @@ void BoUpSLP::reorderNodeWithReuses(TreeEntry &TE, ArrayRef<int> Mask) const {
   for (auto *It = TE.ReuseShuffleIndices.begin(),
             *End = TE.ReuseShuffleIndices.end();
        It != End; std::advance(It, Sz))
-    std::iota(It, std::next(It + Sz), 0);
+    std::iota(It, std::next(It, Sz), 0);
 }
 
 void BoUpSLP::reorderTopToBottom() {


        


More information about the llvm-commits mailing list