@@ -3801,7 +3801,7 @@ class BoUpSLP {
3801
3801
SetVector<const TreeEntry *> PostponedGathers;
3802
3802
3803
3803
using ValueToGatherNodesMap =
3804
- DenseMap<Value *, SmallSetVector <const TreeEntry *, 4>>;
3804
+ DenseMap<Value *, SmallPtrSet <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,15 +8328,14 @@ class PHIHandler {
8328
8328
}
8329
8329
return;
8330
8330
}
8331
- SmallMapVector<std::pair<BasicBlock *, unsigned>, SmallVector<unsigned>, 4>
8332
- Blocks;
8333
- for (unsigned I : seq<unsigned>(Main->getNumIncomingValues())) {
8331
+ SmallDenseMap<BasicBlock *, SmallVector<unsigned>, 4> Blocks;
8332
+ for (unsigned I : seq<unsigned>(0, Main->getNumIncomingValues())) {
8334
8333
BasicBlock *InBB = Main->getIncomingBlock(I);
8335
8334
if (!DT.isReachableFromEntry(InBB)) {
8336
8335
Operands[I].assign(Phis.size(), PoisonValue::get(Main->getType()));
8337
8336
continue;
8338
8337
}
8339
- Blocks.try_emplace(std::make_pair( InBB, I) ).first->second.push_back(I);
8338
+ Blocks.try_emplace(InBB).first->second.push_back(I);
8340
8339
}
8341
8340
for (auto [Idx, V] : enumerate(Phis)) {
8342
8341
if (isa<PoisonValue>(V)) {
@@ -8345,26 +8344,25 @@ class PHIHandler {
8345
8344
continue;
8346
8345
}
8347
8346
auto *P = cast<PHINode>(V);
8348
- for (unsigned I : seq<unsigned>(P->getNumIncomingValues())) {
8347
+ for (unsigned I : seq<unsigned>(0, P->getNumIncomingValues())) {
8349
8348
BasicBlock *InBB = P->getIncomingBlock(I);
8350
8349
if (InBB == Main->getIncomingBlock(I)) {
8351
8350
if (isa_and_nonnull<PoisonValue>(Operands[I][Idx]))
8352
8351
continue;
8353
8352
Operands[I][Idx] = P->getIncomingValue(I);
8354
8353
continue;
8355
8354
}
8356
- auto * It = Blocks.find(std::make_pair( InBB, I) );
8355
+ auto It = Blocks.find(InBB);
8357
8356
if (It == Blocks.end())
8358
8357
continue;
8359
8358
Operands[It->second.front()][Idx] = P->getIncomingValue(I);
8360
8359
}
8361
8360
}
8362
8361
for (const auto &P : Blocks) {
8363
- ArrayRef<unsigned> IncomingValues = P.second;
8364
- if (IncomingValues.size() <= 1)
8362
+ if (P.getSecond().size() <= 1)
8365
8363
continue;
8366
- unsigned BasicI = IncomingValues .front();
8367
- for (unsigned I : IncomingValues .drop_front()) {
8364
+ unsigned BasicI = P.getSecond() .front();
8365
+ for (unsigned I : ArrayRef(P.getSecond()) .drop_front()) {
8368
8366
assert(all_of(enumerate(Operands[I]),
8369
8367
[&](const auto &Data) {
8370
8368
return !Data.value() ||
0 commit comments