@@ -3801,7 +3801,7 @@ class BoUpSLP {
3801
3801
SetVector<const TreeEntry *> PostponedGathers;
3802
3802
3803
3803
using ValueToGatherNodesMap =
3804
- DenseMap<Value *, SmallPtrSet <const TreeEntry *, 4>>;
3804
+ DenseMap<Value *, SmallSetVector <const TreeEntry *, 4>>;
3805
3805
ValueToGatherNodesMap ValueToGatherNodes;
3806
3806
3807
3807
/// A list of the load entries (node indices), which can be vectorized using
@@ -8328,8 +8328,9 @@ class PHIHandler {
8328
8328
}
8329
8329
return;
8330
8330
}
8331
- SmallDenseMap<BasicBlock *, SmallVector<unsigned>, 4> Blocks;
8332
- for (unsigned I : seq<unsigned>(0, Main->getNumIncomingValues())) {
8331
+ SmallMapVector<BasicBlock *, SmallVector<unsigned>, 4>
8332
+ Blocks;
8333
+ for (unsigned I : seq<unsigned>(Main->getNumIncomingValues())) {
8333
8334
BasicBlock *InBB = Main->getIncomingBlock(I);
8334
8335
if (!DT.isReachableFromEntry(InBB)) {
8335
8336
Operands[I].assign(Phis.size(), PoisonValue::get(Main->getType()));
@@ -8344,25 +8345,26 @@ class PHIHandler {
8344
8345
continue;
8345
8346
}
8346
8347
auto *P = cast<PHINode>(V);
8347
- for (unsigned I : seq<unsigned>(0, P->getNumIncomingValues())) {
8348
+ for (unsigned I : seq<unsigned>(P->getNumIncomingValues())) {
8348
8349
BasicBlock *InBB = P->getIncomingBlock(I);
8349
8350
if (InBB == Main->getIncomingBlock(I)) {
8350
8351
if (isa_and_nonnull<PoisonValue>(Operands[I][Idx]))
8351
8352
continue;
8352
8353
Operands[I][Idx] = P->getIncomingValue(I);
8353
8354
continue;
8354
8355
}
8355
- auto It = Blocks.find(InBB);
8356
+ auto * It = Blocks.find(InBB);
8356
8357
if (It == Blocks.end())
8357
8358
continue;
8358
8359
Operands[It->second.front()][Idx] = P->getIncomingValue(I);
8359
8360
}
8360
8361
}
8361
8362
for (const auto &P : Blocks) {
8362
- if (P.getSecond().size() <= 1)
8363
+ ArrayRef<unsigned> IncomingValues = P.second;
8364
+ if (IncomingValues.size() <= 1)
8363
8365
continue;
8364
- unsigned BasicI = P.getSecond() .front();
8365
- for (unsigned I : ArrayRef(P.getSecond()) .drop_front()) {
8366
+ unsigned BasicI = IncomingValues .front();
8367
+ for (unsigned I : IncomingValues .drop_front()) {
8366
8368
assert(all_of(enumerate(Operands[I]),
8367
8369
[&](const auto &Data) {
8368
8370
return !Data.value() ||
0 commit comments