@@ -4677,9 +4677,7 @@ void BoUpSLP::reorderBottomToTop(bool IgnoreReorder) {
4677
4677
// Currently the are vectorized loads,extracts without alternate operands +
4678
4678
// some gathering of extracts.
4679
4679
SmallVector<TreeEntry *> NonVectorized;
4680
- for_each(VectorizableTree, [this, &OrderedEntries, &GathersToOrders,
4681
- &NonVectorized](
4682
- const std::unique_ptr<TreeEntry> &TE) {
4680
+ for (const std::unique_ptr<TreeEntry> &TE : VectorizableTree) {
4683
4681
if (TE->State != TreeEntry::Vectorize &&
4684
4682
TE->State != TreeEntry::PossibleStridedVectorize)
4685
4683
NonVectorized.push_back(TE.get());
@@ -4691,7 +4689,7 @@ void BoUpSLP::reorderBottomToTop(bool IgnoreReorder) {
4691
4689
!TE->ReuseShuffleIndices.empty())
4692
4690
GathersToOrders.try_emplace(TE.get(), *CurrentOrder);
4693
4691
}
4694
- });
4692
+ }
4695
4693
4696
4694
// 1. Propagate order to the graph nodes, which use only reordered nodes.
4697
4695
// I.e., if the node has operands, that are reordered, try to make at least
@@ -4728,8 +4726,8 @@ void BoUpSLP::reorderBottomToTop(bool IgnoreReorder) {
4728
4726
}
4729
4727
}
4730
4728
// Erase filtered entries.
4731
- for_each( Filtered,
4732
- [& OrderedEntries](TreeEntry *TE) { OrderedEntries .remove(TE); } );
4729
+ for (TreeEntry *TE : Filtered)
4730
+ OrderedEntries.remove(TE);
4733
4731
SmallVector<
4734
4732
std::pair<TreeEntry *, SmallVector<std::pair<unsigned, TreeEntry *>>>>
4735
4733
UsersVec(Users.begin(), Users.end());
@@ -4741,10 +4739,8 @@ void BoUpSLP::reorderBottomToTop(bool IgnoreReorder) {
4741
4739
SmallVector<TreeEntry *> GatherOps;
4742
4740
if (!canReorderOperands(Data.first, Data.second, NonVectorized,
4743
4741
GatherOps)) {
4744
- for_each(Data.second,
4745
- [&OrderedEntries](const std::pair<unsigned, TreeEntry *> &Op) {
4746
- OrderedEntries.remove(Op.second);
4747
- });
4742
+ for (const std::pair<unsigned, TreeEntry *> &Op : Data.second)
4743
+ OrderedEntries.remove(Op.second);
4748
4744
continue;
4749
4745
}
4750
4746
// All operands are reordered and used only in this node - propagate the
@@ -4846,11 +4842,8 @@ void BoUpSLP::reorderBottomToTop(bool IgnoreReorder) {
4846
4842
Data.first->ReuseShuffleIndices.empty() &&
4847
4843
!(IgnoreReorder &&
4848
4844
Data.first == VectorizableTree.front().get()))) {
4849
- for_each(
4850
- Data.second,
4851
- [&OrderedEntries](const std::pair<unsigned, TreeEntry *> &Op) {
4852
- OrderedEntries.remove(Op.second);
4853
- });
4845
+ for (const std::pair<unsigned, TreeEntry *> &Op : Data.second)
4846
+ OrderedEntries.remove(Op.second);
4854
4847
continue;
4855
4848
}
4856
4849
// Add (potentially!) strided vectorize orders.
@@ -4877,10 +4870,8 @@ void BoUpSLP::reorderBottomToTop(bool IgnoreReorder) {
4877
4870
}
4878
4871
// Set order of the user node (reordering of operands and user nodes).
4879
4872
if (BestOrder.empty()) {
4880
- for_each(Data.second,
4881
- [&OrderedEntries](const std::pair<unsigned, TreeEntry *> &Op) {
4882
- OrderedEntries.remove(Op.second);
4883
- });
4873
+ for (const std::pair<unsigned, TreeEntry *> &Op : Data.second)
4874
+ OrderedEntries.remove(Op.second);
4884
4875
continue;
4885
4876
}
4886
4877
// Erase operands from OrderedEntries list and adjust their orders.
@@ -13904,11 +13895,9 @@ class HorizontalReduction {
13904
13895
for (unsigned Cnt = 0, Sz = ReducedVals.size(); Cnt < Sz; ++Cnt) {
13905
13896
if (Cnt == I || (ShuffledExtracts && Cnt == I - 1))
13906
13897
continue;
13907
- for_each(ReducedVals[Cnt],
13908
- [&LocalExternallyUsedValues, &TrackedVals](Value *V) {
13909
- if (isa<Instruction>(V))
13910
- LocalExternallyUsedValues[TrackedVals[V]];
13911
- });
13898
+ for (Value *V : ReducedVals[Cnt])
13899
+ if (isa<Instruction>(V))
13900
+ LocalExternallyUsedValues[TrackedVals[V]];
13912
13901
}
13913
13902
if (!IsSupportedHorRdxIdentityOp) {
13914
13903
// Number of uses of the candidates in the vector of values.
0 commit comments