@@ -3801,7 +3801,7 @@ class BoUpSLP {
38013801 SetVector<const TreeEntry *> PostponedGathers;
38023802
38033803 using ValueToGatherNodesMap =
3804- DenseMap<Value *, SmallPtrSet <const TreeEntry *, 4>>;
3804+ DenseMap<Value *, SmallSetVector <const TreeEntry *, 4>>;
38053805 ValueToGatherNodesMap ValueToGatherNodes;
38063806
38073807 /// A list of the load entries (node indices), which can be vectorized using
@@ -8328,14 +8328,15 @@ class PHIHandler {
83288328 }
83298329 return;
83308330 }
8331- SmallDenseMap<BasicBlock *, SmallVector<unsigned>, 4> Blocks;
8332- for (unsigned I : seq<unsigned>(0, Main->getNumIncomingValues())) {
8331+ SmallMapVector<std::pair<BasicBlock *, unsigned>, SmallVector<unsigned>, 4>
8332+ Blocks;
8333+ for (unsigned I : seq<unsigned>(Main->getNumIncomingValues())) {
83338334 BasicBlock *InBB = Main->getIncomingBlock(I);
83348335 if (!DT.isReachableFromEntry(InBB)) {
83358336 Operands[I].assign(Phis.size(), PoisonValue::get(Main->getType()));
83368337 continue;
83378338 }
8338- Blocks.try_emplace(InBB).first->second.push_back(I);
8339+ Blocks.try_emplace(std::make_pair( InBB, I) ).first->second.push_back(I);
83398340 }
83408341 for (auto [Idx, V] : enumerate(Phis)) {
83418342 if (isa<PoisonValue>(V)) {
@@ -8344,25 +8345,26 @@ class PHIHandler {
83448345 continue;
83458346 }
83468347 auto *P = cast<PHINode>(V);
8347- for (unsigned I : seq<unsigned>(0, P->getNumIncomingValues())) {
8348+ for (unsigned I : seq<unsigned>(P->getNumIncomingValues())) {
83488349 BasicBlock *InBB = P->getIncomingBlock(I);
83498350 if (InBB == Main->getIncomingBlock(I)) {
83508351 if (isa_and_nonnull<PoisonValue>(Operands[I][Idx]))
83518352 continue;
83528353 Operands[I][Idx] = P->getIncomingValue(I);
83538354 continue;
83548355 }
8355- auto It = Blocks.find(InBB);
8356+ auto * It = Blocks.find(std::make_pair( InBB, I) );
83568357 if (It == Blocks.end())
83578358 continue;
83588359 Operands[It->second.front()][Idx] = P->getIncomingValue(I);
83598360 }
83608361 }
83618362 for (const auto &P : Blocks) {
8362- if (P.getSecond().size() <= 1)
8363+ ArrayRef<unsigned> IncomingValues = P.second;
8364+ if (IncomingValues.size() <= 1)
83638365 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()) {
83668368 assert(all_of(enumerate(Operands[I]),
83678369 [&](const auto &Data) {
83688370 return !Data.value() ||
0 commit comments