From f090e3c00fc31b99049a2291ebd07075fbdf0be1 Mon Sep 17 00:00:00 2001 From: Alexey Bataev Date: Thu, 3 Nov 2022 05:30:41 -0700 Subject: [PATCH] [SLP]Fix write after bounds. Need to use comma instead of + symbol to prevent writing after bounds. --- llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp index 8a44c4d..f874cfc 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 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() { -- 2.7.4