[llvm] [SLP] Use named structs in vectorizeStores() (NFC) (PR #132781)
Alexey Bataev via llvm-commits
llvm-commits at lists.llvm.org
Thu Mar 27 09:00:35 PDT 2025
================
@@ -20279,56 +20310,51 @@ bool SLPVectorizerPass::vectorizeStores(
// dependencies and no need to waste compile time to try to vectorize them.
// - Try to vectorize the sequence {1, {1, 0}, {3, 2}}.
auto FillStoresSet = [&](unsigned Idx, StoreInst *SI) {
- for (std::pair<unsigned, StoreIndexToDistSet> &Set : SortedStores) {
+ for (RelatedStoreInsts &StoreSeq : SortedStores) {
std::optional<int> Diff = getPointersDiff(
- Stores[Set.first]->getValueOperand()->getType(),
- Stores[Set.first]->getPointerOperand(),
+ Stores[StoreSeq.BaseInstrIdx]->getValueOperand()->getType(),
+ Stores[StoreSeq.BaseInstrIdx]->getPointerOperand(),
SI->getValueOperand()->getType(), SI->getPointerOperand(), *DL, *SE,
/*StrictCheck=*/true);
if (!Diff)
continue;
- auto It = Set.second.find(std::make_pair(Idx, *Diff));
- if (It == Set.second.end()) {
- Set.second.emplace(Idx, *Diff);
+ auto It = StoreSeq.Instrs.find({Idx, *Diff});
+ if (It == StoreSeq.Instrs.end()) {
+ StoreSeq.Instrs.emplace(Idx, *Diff);
return;
}
----------------
alexey-bataev wrote:
It requires double lookup in the container, which we'd like to avoid
https://github.com/llvm/llvm-project/pull/132781
More information about the llvm-commits
mailing list