Skip to content

Commit a2c1948

Browse files
committed
fixup! [SLP] More OOP to simplify vectorizeStores() (NFC)
1 parent 5415ce8 commit a2c1948

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20442,7 +20442,8 @@ class RelatedStoreInsts {
2044220442
}
2044320443

2044420444
void reset(unsigned NewBaseInstr) {
20445-
assert(NewBaseInstr < AllStores.size());
20445+
assert(NewBaseInstr < AllStores.size() &&
20446+
"Instruction index out of bounds");
2044620447
BaseInstrIdx = NewBaseInstr;
2044720448
Instrs.clear();
2044820449
insertOrLookup(NewBaseInstr, 0);
@@ -20472,9 +20473,8 @@ class RelatedStoreInsts {
2047220473
// again. Their distance will be "rebased" to use NewBaseInstIdx as
2047320474
// reference.
2047420475
for (auto [Dist, InstIdx] : PrevSet) {
20475-
if (InstIdx >= MinSafeIdx) {
20476+
if (InstIdx >= MinSafeIdx)
2047620477
insertOrLookup(InstIdx, Dist - DistFromCurBase);
20477-
}
2047820478
}
2047920479
}
2048020480

@@ -20848,6 +20848,7 @@ bool SLPVectorizerPass::vectorizeStores(
2084820848

2084920849
// If there is already a store in the group with the same PtrDiff, try to
2085020850
// vectorize the existing instructions before adding the current store.
20851+
// Otherwise, insert this store and keep collecting.
2085120852
if (std::optional<unsigned> PrevInst =
2085220853
RelatedStores->insertOrLookup(Idx, *Diff)) {
2085320854
TryToVectorize(RelatedStores->getStores());

0 commit comments

Comments
 (0)